Merge remote-tracking branch 'origin/master'
This commit is contained in:
@ -24,4 +24,5 @@ type IStoreV1 interface {
|
||||
GetStoreAreaList(ctx context.Context, req *v1.GetStoreAreaListReq) (res *v1.GetStoreAreaListRes, err error)
|
||||
GetNetfeeSetting(ctx context.Context, req *v1.GetNetfeeSettingReq) (res *v1.GetNetfeeSettingRes, err error)
|
||||
SaveNetfeeSetting(ctx context.Context, req *v1.SaveNetfeeSettingReq) (res *v1.SaveNetfeeSettingRes, err error)
|
||||
GetStoreInfoByNetbar(ctx context.Context, req *v1.GetStoreInfoByNetbarReq) (res *v1.GetStoreInfoByNetbarRes, err error)
|
||||
}
|
||||
|
||||
@ -143,3 +143,12 @@ type SaveNetfeeSettingReq struct {
|
||||
type SaveNetfeeSettingRes struct {
|
||||
Success bool `json:"success" dc:"是否成功"`
|
||||
}
|
||||
|
||||
type GetStoreInfoByNetbarReq struct {
|
||||
g.Meta `path:"/store/getStoreInfoByNetbar" method:"get" tags:"PC/Store" summary:"(用户)根据网关账号获取门店信息"`
|
||||
NetbarAccount string `json:"netbarAccount" v:"required" dc:"网关账号"`
|
||||
}
|
||||
|
||||
type GetStoreInfoByNetbarRes struct {
|
||||
Store interface{} `json:"store"`
|
||||
}
|
||||
|
||||
@ -0,0 +1,20 @@
|
||||
package store
|
||||
|
||||
import (
|
||||
"context"
|
||||
"server/internal/model"
|
||||
|
||||
"server/api/store/v1"
|
||||
"server/internal/service"
|
||||
)
|
||||
|
||||
func (c *ControllerV1) GetStoreInfoByNetbar(ctx context.Context, req *v1.GetStoreInfoByNetbarReq) (res *v1.GetStoreInfoByNetbarRes, err error) {
|
||||
|
||||
out, err := service.Store().GetStoreInfoByNetbarAccount(ctx, &model.StoreByNetbarAccountIn{NetbarAccount: req.NetbarAccount})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &v1.GetStoreInfoByNetbarRes{
|
||||
Store: out.Store,
|
||||
}, nil
|
||||
}
|
||||
@ -374,3 +374,15 @@ func (s *sStore) SaveNetfeeSetting(ctx context.Context, in *model.SaveNetfeeSett
|
||||
Success: true,
|
||||
}, nil
|
||||
}
|
||||
|
||||
// GetStoreInfoByNetbarAccount 根据网关账号获取门店信息
|
||||
func (s *sStore) GetStoreInfoByNetbarAccount(ctx context.Context, in *model.StoreByNetbarAccountIn) (out *model.StoreByNetbarAccountOut, err error) {
|
||||
|
||||
var data model.Store
|
||||
if err = dao.Stores.Ctx(ctx).Where(do.Stores{NetbarAccount: in.NetbarAccount}).Fields(dao.Stores.Columns().Id, dao.Stores.Columns().Name).Scan(&data); err != nil {
|
||||
return nil, ecode.Fail.Sub("查询门店信息失败")
|
||||
}
|
||||
return &model.StoreByNetbarAccountOut{
|
||||
Store: data,
|
||||
}, nil
|
||||
}
|
||||
|
||||
@ -116,3 +116,11 @@ type StoreDetailIn struct {
|
||||
type StoreDetailOut struct {
|
||||
Id int64 `json:"id"`
|
||||
}
|
||||
|
||||
type StoreByNetbarAccountIn struct {
|
||||
NetbarAccount string `json:"netbarAccount"`
|
||||
}
|
||||
|
||||
type StoreByNetbarAccountOut struct {
|
||||
Store interface{} `json:"store"`
|
||||
}
|
||||
|
||||
@ -22,6 +22,7 @@ type UserTask struct {
|
||||
User User `json:"user,omitempty" orm:"with:id=user_id"`
|
||||
Game Game `json:"game,omitempty" orm:"with:game_id=game_id"`
|
||||
// Store Store `json:"store" orm:"with:id=store_id"`
|
||||
UserTimes int64 `json:"userTimes" orm:"user_times" description:"用户完成次数"` // 用户完成次数
|
||||
}
|
||||
|
||||
type TaskReward struct {
|
||||
|
||||
@ -27,6 +27,8 @@ type (
|
||||
GetStoreAreaList(ctx context.Context, in *model.StoreAreaListIn) (out *model.StoreAreaListOut, err error)
|
||||
GetNetfeeSetting(ctx context.Context, in *model.GetNetfeeSettingIn) (out *model.StoreNetfeeAreaLevel, err error)
|
||||
SaveNetfeeSetting(ctx context.Context, in *model.SaveNetfeeSettingIn) (out *model.SaveNetfeeSettingOut, err error)
|
||||
// GetStoreInfoByNetbarAccount 根据网关账号获取门店信息
|
||||
GetStoreInfoByNetbarAccount(ctx context.Context, in *model.StoreByNetbarAccountIn) (out *model.StoreByNetbarAccountOut, err error)
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
@ -19,7 +19,7 @@ type (
|
||||
// GetTaskCompletedList 获取用户任务完成列表
|
||||
GetTaskCompletedList(ctx context.Context, in *model.TaskListIn) (out *model.TaskListOut, err error)
|
||||
GetSelectorList(ctx context.Context, in *model.SelectorIn) (out *[]model.SelectorOut, err error)
|
||||
// GetTask 完成任务
|
||||
// GetTask 领取任务
|
||||
GetTask(ctx context.Context, in *model.GetTaskIn) (out *model.GetTaskOut, err error)
|
||||
GetUserTaskRecordsList(ctx context.Context, in *model.UserTaskRecordsListIn) (out *model.UserTaskRecordsListOut, err error)
|
||||
GetTaskList(ctx context.Context, in *model.GetTaskListV2In) (out *model.GetTaskListV2Out, err error)
|
||||
|
||||
@ -40,6 +40,9 @@ func init() {
|
||||
enforcer.AddGroupingPolicy(consts.AdminRoleCode, consts.MerchantRoleCode) // 管理员继承商户角色权限
|
||||
// 游客
|
||||
{
|
||||
// 根据网关账号获取门店信息
|
||||
enforcer.AddPolicy("guest", "/x/store/getStoreInfoByNetbar", "GET", "根据网关账号获取门店信息")
|
||||
|
||||
// 任务
|
||||
enforcer.AddPolicy("guest", "/x/task/ranking", "GET", "获取排行榜")
|
||||
enforcer.AddPolicy("guest", "/x/task/getNonLoginTaskList", "GET", "未登录获取任务列表")
|
||||
|
||||
Reference in New Issue
Block a user