From f7cffcae21026e6eebaa953b30040a3bf7869791 Mon Sep 17 00:00:00 2001 From: denghui <1016848185@qq.com> Date: Thu, 12 Jun 2025 09:18:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8E=A5=E5=8F=A3=E8=AF=B4?= =?UTF-8?q?=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/admin/v1/admin.go | 2 +- api/auth/v1/auth.go | 10 +++++----- api/feedback/v1/feedback.go | 10 +++++----- api/game/v1/game.go | 8 ++++---- api/gamelife/v1/gamelife.go | 1 - api/merchantAdmin/v1/merchantAdmin.go | 2 +- api/reward/v1/reward.go | 16 ++++++++-------- api/rewardType/v1/rewardType.go | 8 ++++---- api/role/v1/role.go | 10 +++++----- api/store/v1/store.go | 8 ++++---- api/storeAdmin/v1/storeAdmin.go | 2 +- api/task/v1/task.go | 6 +++--- api/user/v1/user.go | 16 ++++++++-------- api/wx/v1/wx.go | 4 ++-- internal/controller/wx/wx_v1_we_chat_event.go | 6 ++++-- internal/model/user.go | 3 ++- 16 files changed, 57 insertions(+), 55 deletions(-) delete mode 100644 api/gamelife/v1/gamelife.go diff --git a/api/admin/v1/admin.go b/api/admin/v1/admin.go index 9763026..4948b5a 100644 --- a/api/admin/v1/admin.go +++ b/api/admin/v1/admin.go @@ -3,7 +3,7 @@ package v1 import "github.com/gogf/gf/v2/frame/g" type AdminInfoReq struct { - g.Meta `path:"/admin/info" method:"get" tags:"Admin" summary:"(系统管理员)获取管理员信息"` + g.Meta `path:"/admin/info" method:"get" tags:"Admin" summary:"(系统后台)获取管理员信息"` } type AdminInfoRes struct { g.Meta `mime:"application/json"` diff --git a/api/auth/v1/auth.go b/api/auth/v1/auth.go index 3ca1e96..986dc6b 100644 --- a/api/auth/v1/auth.go +++ b/api/auth/v1/auth.go @@ -3,7 +3,7 @@ package v1 import "github.com/gogf/gf/v2/frame/g" type AdminLoginReq struct { - g.Meta `path:"/admin/login" method:"post" tags:"Admin" summary:"(系统管理员)管理员登录"` + g.Meta `path:"/admin/login" method:"post" tags:"Admin" summary:"(系统后台)管理员登录"` Username string `json:"username" v:"required" dc:"用户名"` Password string `json:"password" v:"required" dc:"密码"` } @@ -14,7 +14,7 @@ type AdminLoginRes struct { } type MerchantLoginReq struct { - g.Meta `path:"/merchant/login" method:"post" tags:"Merchant" summary:"(商户管理员)商户登录"` + g.Meta `path:"/merchant/login" method:"post" tags:"Merchant" summary:"(商户门店后台)商户登录"` Username string `json:"username" dc:"用户名"` Phone string `json:"phone" v:"regex:^1[3-9]\\d{9}$" dc:"手机号"` Code string `json:"code" dc:"验证码"` @@ -27,14 +27,14 @@ type MerchantLoginRes struct { } type MerchantCodeReq struct { - g.Meta `path:"/merchant/code" method:"get" tags:"Merchant" summary:"(商户管理员)商户获取短信验证码"` + g.Meta `path:"/merchant/code" method:"get" tags:"Merchant" summary:"(商户门店后台)商户获取短信验证码"` Phone string `json:"phone" v:"required" dc:"手机号"` } type MerchantCodeRes struct{} type MerchantRegisterReq struct { - g.Meta `path:"/merchant/register" method:"post" tags:"Merchant" summary:"(商户管理员)商户注册"` + g.Meta `path:"/merchant/register" method:"post" tags:"Merchant" summary:"(商户门店后台)商户注册"` Username string `json:"username" v:"required" dc:"用户名"` Phone string `json:"phone" v:"required|regex:^1[3-9]\\d{9}$" dc:"手机号"` Code string `json:"code" v:"required" dc:"验证码"` @@ -49,7 +49,7 @@ type MerchantRegisterRes struct { } type StoreLoginReq struct { - g.Meta `path:"/store/login" method:"post" tags:"Store" summary:"(门店管理员)门店登录"` + g.Meta `path:"/store/login" method:"post" tags:"Store" summary:"(商户门店后台)门店登录"` Username string `json:"username" v:"required" dc:"用户名"` Password string `json:"password" v:"required" dc:"密码"` } diff --git a/api/feedback/v1/feedback.go b/api/feedback/v1/feedback.go index b80de7c..24c1e4d 100644 --- a/api/feedback/v1/feedback.go +++ b/api/feedback/v1/feedback.go @@ -6,7 +6,7 @@ import ( ) type ListReq struct { - g.Meta `path:"/feedback" method:"get" tags:"Feedback" summary:"根据用户查询反馈列表"` + g.Meta `path:"/feedback" method:"get" tags:"Feedback" summary:"(系统、商户门店后台)根据用户查询反馈列表"` //UserId int64 `json:"userId" v:"required#用户ID不能为空" dc:"用户ID"` Status int `json:"status" v:"required#状态不能为空" dc:"状态"` Page int `json:"page" v:"required#页数不能为空" dc:"页数"` @@ -21,7 +21,7 @@ type ListRes struct { } type CreateReq struct { - g.Meta `path:"/feedback" method:"post" tags:"Feedback" summary:"创建反馈"` + g.Meta `path:"/feedback" method:"post" tags:"Feedback" summary:"(PC)创建反馈"` Title string `json:"title" v:"required#标题不能为空" dc:"标题"` Content string `json:"content" v:"required#反馈内容不能为空" dc:"反馈内容"` FeedbackType int `json:"feedbackType" v:"required#反馈类型不能为空" dc:"反馈类型"` @@ -34,7 +34,7 @@ type CreateRes struct { } type UpdateReq struct { - g.Meta `path:"/feedback" method:"put" tags:"Feedback" summary:"更新反馈"` + g.Meta `path:"/feedback" method:"put" tags:"Feedback" summary:"(系统、商户门店后台)更新反馈"` Id int64 `json:"id" v:"required#ID不能为空" dc:"ID"` Title string `json:"title" v:"required#标题不能为空" dc:"标题"` Content string `json:"content" v:"required#反馈内容不能为空" dc:"反馈内容"` @@ -51,7 +51,7 @@ type UpdateRes struct { //} type UpdateReplyReq struct { - g.Meta `path:"/feedback/reply" method:"put" tags:"Feedback" summary:"更新反馈回复"` + g.Meta `path:"/feedback/reply" method:"put" tags:"Feedback" summary:"(系统、商户门店后台)更新反馈回复"` Id int64 `json:"id" v:"required#ID不能为空" dc:"ID"` Reply string `json:"reply" v:"required#回复内容不能为空" dc:"回复内容"` Status int `json:"status" v:"required#状态不能为空" dc:"状态"` @@ -62,7 +62,7 @@ type UpdateReplyRes struct { } type InfoFeedbackReq struct { - g.Meta `path:"/feedback/{id}" method:"get" tags:"Feedback" summary:"获取反馈信息"` + g.Meta `path:"/feedback/{id}" method:"get" tags:"Feedback" summary:"(系统、商户门店后台)获取反馈信息"` Id int64 `in:"path" json:"id" v:"required#ID不能为空" dc:"ID"` } diff --git a/api/game/v1/game.go b/api/game/v1/game.go index ef1de22..f48384c 100644 --- a/api/game/v1/game.go +++ b/api/game/v1/game.go @@ -3,7 +3,7 @@ package v1 import "github.com/gogf/gf/v2/frame/g" type ListReq struct { - g.Meta `path:"/game" method:"get" tags:"Game" summary:"获取游戏列表"` + g.Meta `path:"/game" method:"get" tags:"Game" summary:"(系统、商户门店后台、PC)获取游戏列表"` Page int `json:"page" dc:"页数"` Size int `json:"size" dc:"每页数量"` } @@ -14,7 +14,7 @@ type ListRes struct { } type CreateReq struct { - g.Meta `path:"/game" method:"post" tags:"Game" summary:"创建游戏"` + g.Meta `path:"/game" method:"post" tags:"Game" summary:"(系统)创建游戏"` GameID int64 `json:"gameId" v:"required#游戏ID不能为空" dc:"游戏ID"` GameName string `json:"gameName" v:"required#游戏名称不能为空" dc:"游戏名称"` GameCode string `json:"gameCode" v:"required#游戏代号不能为空" dc:"游戏代号"` @@ -26,7 +26,7 @@ type CreateRes struct { } type UpdateReq struct { - g.Meta `path:"/game" method:"put" tags:"Game" summary:"更新游戏"` + g.Meta `path:"/game" method:"put" tags:"Game" summary:"(系统)更新游戏"` GameID int64 `json:"gameId" v:"required#游戏ID不能为空" dc:"游戏ID"` GameName string `json:"gameName" v:"required#游戏名称不能为空" dc:"游戏名称"` GameCode string `json:"gameCode" v:"required#游戏代号不能为空" dc:"游戏代号"` @@ -39,7 +39,7 @@ type UpdateRes struct { } type DeleteReq struct { - g.Meta `path:"/game/{id}" method:"delete" tags:"Game" summary:"删除游戏"` + g.Meta `path:"/game/{id}" method:"delete" tags:"Game" summary:"(系统)删除游戏"` ID int64 `json:"Id" v:"required#ID不能为空" dc:"ID"` } diff --git a/api/gamelife/v1/gamelife.go b/api/gamelife/v1/gamelife.go deleted file mode 100644 index b7b1f99..0000000 --- a/api/gamelife/v1/gamelife.go +++ /dev/null @@ -1 +0,0 @@ -package v1 diff --git a/api/merchantAdmin/v1/merchantAdmin.go b/api/merchantAdmin/v1/merchantAdmin.go index 8b9e041..32afbfd 100644 --- a/api/merchantAdmin/v1/merchantAdmin.go +++ b/api/merchantAdmin/v1/merchantAdmin.go @@ -5,7 +5,7 @@ import ( ) type MerchantAdminInfoReq struct { - g.Meta `path:"/merchant/info" method:"get" tags:"MerchantAdmin" summary:"(商户管理员)获取商户管理员信息"` + g.Meta `path:"/merchant/info" method:"get" tags:"MerchantAdmin" summary:"(商户后台)获取商户管理员信息"` } type MerchantAdminInfoRes struct { MerchantId int64 `json:"merchantId"` diff --git a/api/reward/v1/reward.go b/api/reward/v1/reward.go index 86920cb..86d95cf 100644 --- a/api/reward/v1/reward.go +++ b/api/reward/v1/reward.go @@ -7,7 +7,7 @@ import ( // CreateSystemRewardReq 创建系统奖励请求 type CreateSystemRewardReq struct { - g.Meta `path:"/reward/system" method:"post" tags:"Reward" summary:"创建系统奖励"` + g.Meta `path:"/reward/system" method:"post" tags:"Reward" summary:"(系统)创建系统奖励"` RewardTypeId int64 `v:"required|min:1#奖励类型ID不能为空|奖励类型ID无效" json:"rewardTypeId" dc:"奖励类型ID"` Name string `v:"required|length:1,100#奖励名称不能为空|奖励名称长度为1-100" json:"name" dc:"奖励名称"` Description string `v:"length:0,255#奖励描述长度为0-255" json:"description" dc:"奖励描述,可选"` @@ -24,7 +24,7 @@ type CreateSystemRewardRes struct { // CreateStoreRewardReq 创建门店奖励请求 type CreateStoreRewardReq struct { - g.Meta `path:"/reward/store" method:"post" tags:"Reward" summary:"创建门店奖励"` + g.Meta `path:"/reward/store" method:"post" tags:"Reward" summary:"(商户门店后台)创建门店奖励"` StoreIds []int64 `v:"required|distinct|min-length:1#门店ID列表不能为空|门店ID不能重复|门店ID列表不能为空" json:"storeIds" dc:"门店ID列表"` RewardTypeId int64 `v:"required|min:1#奖励类型ID不能为空|奖励类型ID无效" json:"rewardTypeId" dc:"奖励类型ID"` Name string `v:"required|length:1,100#奖励名称不能为空|奖励名称长度为1-100" json:"name" dc:"奖励名称"` @@ -42,7 +42,7 @@ type CreateStoreRewardRes struct { // ListSystemRewardReq 查询系统奖励列表请求 type ListSystemRewardReq struct { - g.Meta `path:"/reward/system" method:"get" tags:"Reward" summary:"获取系统奖励列表"` + g.Meta `path:"/reward/system" method:"get" tags:"Reward" summary:"(系统)获取系统奖励列表"` Page int `v:"min:1#页码必须大于0" json:"page" d:"1" dc:"页码"` PageSize int `v:"min:1|max:100#每页数量必须为1-100" json:"pageSize" d:"10" dc:"每页数量"` Name string `json:"name" dc:"奖励名称,模糊查询,可选"` @@ -58,7 +58,7 @@ type ListSystemRewardRes struct { // ListStoreRewardReq 查询门店奖励列表请求 type ListStoreRewardReq struct { - g.Meta `path:"/reward/store" method:"get" tags:"Reward" summary:"获取门店奖励列表"` + g.Meta `path:"/reward/store" method:"get" tags:"Reward" summary:"(系统、商户门店后台)获取门店奖励列表"` Page int `v:"min:1#页码必须大于0" json:"page" d:"1" dc:"页码"` PageSize int `v:"min:1|max:100#每页数量必须为1-100" json:"pageSize" d:"10" dc:"每页数量"` StoreId int64 `v:"min:0#门店ID无效" json:"storeId" d:"0" dc:"门店ID,0=全部(管理员使用),其他值过滤该门店可见的奖励,可选"` @@ -75,7 +75,7 @@ type ListStoreRewardRes struct { // UpdateSystemRewardReq 更新系统奖励请求 type UpdateSystemRewardReq struct { - g.Meta `path:"/reward/system" method:"put" tags:"Reward" summary:"更新系统奖励"` + g.Meta `path:"/reward/system" method:"put" tags:"Reward" summary:"(系统)更新系统奖励"` Id uint64 `v:"required|min:1#奖励ID不能为空|奖励ID无效" json:"id" dc:"奖励ID"` RewardTypeId int64 `v:"required|min:1#奖励类型ID不能为空|奖励类型ID无效" json:"rewardTypeId" dc:"奖励类型ID"` Name string `v:"required|length:1,100#奖励名称不能为空|奖励名称长度为1-100" json:"name" dc:"奖励名称"` @@ -93,7 +93,7 @@ type UpdateSystemRewardRes struct { // UpdateStoreRewardReq 更新门店奖励请求 type UpdateStoreRewardReq struct { - g.Meta `path:"/reward/store/{id}" method:"put" tags:"Reward" summary:"更新门店奖励"` + g.Meta `path:"/reward/store/{id}" method:"put" tags:"Reward" summary:"(系统、商户门店后台)更新门店奖励"` Id uint64 `v:"required|min:1#奖励ID不能为空|奖励ID无效" json:"id" dc:"奖励ID"` StoreIds []int64 `v:"required|distinct|min-length:1#门店ID列表不能为空|门店ID不能重复|至少指定一个门店ID" json:"storeIds" dc:"关联门店ID列表"` RewardTypeId int64 `v:"required|min:1#奖励类型ID不能为空|奖励类型ID无效" json:"rewardTypeId" dc:"奖励类型ID"` @@ -112,7 +112,7 @@ type UpdateStoreRewardRes struct { // DeleteSystemRewardReq 删除系统奖励请求 type DeleteSystemRewardReq struct { - g.Meta `path:"/reward/system/{id}" method:"delete" tags:"Reward" summary:"删除系统奖励"` + g.Meta `path:"/reward/system/{id}" method:"delete" tags:"Reward" summary:"(系统)删除系统奖励"` Id uint64 `v:"required|min:1#奖励ID不能为空|奖励ID无效" json:"id" dc:"奖励ID"` } @@ -123,7 +123,7 @@ type DeleteSystemRewardRes struct { // DeleteStoreRewardReq 删除门店奖励请求 type DeleteStoreRewardReq struct { - g.Meta `path:"/reward/store/{id}" method:"delete" tags:"Reward" summary:"删除门店奖励"` + g.Meta `path:"/reward/store/{id}" method:"delete" tags:"Reward" summary:"(系统、商户门店后台)删除门店奖励"` Id uint64 `v:"required|min:1#奖励ID不能为空|奖励ID无效" json:"id" dc:"奖励ID"` } diff --git a/api/rewardType/v1/rewardType.go b/api/rewardType/v1/rewardType.go index 6add211..2e86155 100644 --- a/api/rewardType/v1/rewardType.go +++ b/api/rewardType/v1/rewardType.go @@ -3,7 +3,7 @@ package v1 import "github.com/gogf/gf/v2/frame/g" type ListReq struct { - g.Meta `path:"/rewardType" method:"get" tags:"奖励类型" summary:"获取奖励类型列表"` + g.Meta `path:"/rewardType" method:"get" tags:"奖励类型" summary:"(系统、商户门店后台)获取奖励类型列表"` Page int `json:"page" v:"required#页码不能为空" dc:"页码"` Size int `json:"size" v:"required#页大小不能为空" dc:"页大小"` } @@ -14,7 +14,7 @@ type ListRes struct { } type CreateReq struct { - g.Meta `path:"/rewardType" method:"post" tags:"奖励类型" summary:"创建奖励类型"` + g.Meta `path:"/rewardType" method:"post" tags:"奖励类型" summary:"(系统)创建奖励类型"` Name string `json:"name" v:"required#名称不能为空" dc:"名称"` //Sort int `json:"sort" v:"required#排序不能为空" dc:"排序"` Code string `json:"code" v:"required#代号不能为空" dc:"代号"` @@ -27,7 +27,7 @@ type CreateRes struct { } type UpdateReq struct { - g.Meta `path:"/rewardType" method:"put" tags:"奖励类型" summary:"更新奖励类型"` + g.Meta `path:"/rewardType" method:"put" tags:"奖励类型" summary:"(系统)更新奖励类型"` Id int64 `json:"id" v:"required#ID不能为空" dc:"ID"` Name string `json:"name" v:"required#名称不能为空" dc:"名称"` Code string `json:"code" v:"required#代号不能为空" dc:"代号"` @@ -40,7 +40,7 @@ type UpdateRes struct { } type DeleteReq struct { - g.Meta `path:"/rewardType/{id}" method:"delete" tags:"奖励类型" summary:"删除奖励类型"` + g.Meta `path:"/rewardType/{id}" method:"delete" tags:"奖励类型" summary:"(系统)删除奖励类型"` Id int64 `path:"id" v:"required#ID不能为空" dc:"ID"` } diff --git a/api/role/v1/role.go b/api/role/v1/role.go index 2f9ad67..e0f79c0 100644 --- a/api/role/v1/role.go +++ b/api/role/v1/role.go @@ -6,7 +6,7 @@ import ( // ListReq 获取角色列表请求参数 type ListReq struct { - g.Meta `path:"/role" method:"get" tags:"Role" summary:"(系统管理员)获取角色列表"` + g.Meta `path:"/role" method:"get" tags:"Role" summary:"(系统、商户门店后台)获取角色列表"` Page int `json:"page" dc:"页数"` Size int `json:"size" dc:"每页数量"` Status int `json:"status" dc:"状态:1=启用,2=禁用"` @@ -20,7 +20,7 @@ type ListRes struct { // CreateReq 创建角色请求参数 type CreateReq struct { - g.Meta `path:"/role" method:"post" tags:"Role" summary:"(系统管理员)创建角色"` + g.Meta `path:"/role" method:"post" tags:"Role" summary:"(系统、商户门店后台)创建角色"` Name string `json:"name" v:"required" dc:"角色名称"` Code string `json:"code" v:"required" dc:"角色编码"` Description string `json:"description" dc:"角色描述"` @@ -34,7 +34,7 @@ type CreateRes struct { // UpdateReq 更新角色请求参数 type UpdateReq struct { - g.Meta `path:"/role" method:"put" tags:"Role" summary:"(系统管理员)更新角色"` + g.Meta `path:"/role" method:"put" tags:"Role" summary:"(系统、商户门店后台)更新角色"` Id int64 `json:"id" v:"required" dc:"角色ID"` Name string `json:"name" v:"required" dc:"角色名称"` Code string `json:"code" v:"required" dc:"角色编码"` @@ -49,7 +49,7 @@ type UpdateRes struct { // DeleteReq 删除角色请求参数 type DeleteReq struct { - g.Meta `path:"/role/{id}" method:"delete" tags:"Role" summary:"(系统管理员)删除角色"` + g.Meta `path:"/role/{id}" method:"delete" tags:"Role" summary:"(系统、商户门店后台)删除角色"` Id int64 `json:"id" in:"path" v:"required" dc:"角色ID"` } @@ -59,7 +59,7 @@ type DeleteRes struct { } type BatchDeleteReq struct { - g.Meta `path:"/role" method:"delete" tags:"Role" summary:"(系统管理员)批量删除角色"` + g.Meta `path:"/role" method:"delete" tags:"Role" summary:"(系统、商户门店后台)批量删除角色"` Ids []int `json:"ids" v:"required" dc:"角色ID"` } type BatchDeleteRes struct { diff --git a/api/store/v1/store.go b/api/store/v1/store.go index 9b4018e..cc822ec 100644 --- a/api/store/v1/store.go +++ b/api/store/v1/store.go @@ -5,7 +5,7 @@ import ( ) type ListReq struct { - g.Meta `path:"/store" method:"get" tags:"Store" summary:"(系统管理员、商户管理员)获取门店列表"` + g.Meta `path:"/store" method:"get" tags:"Store" summary:"(系统、商户门店后台)获取门店列表"` Page int `json:"page" dc:"页数"` Size int `json:"size" dc:"每页数量"` MerchantId int `json:"merchantId" dc:"商户ID"` @@ -15,7 +15,7 @@ type ListRes struct { Total int `json:"total" dc:"总数"` } type CreateReq struct { - g.Meta `path:"/store" method:"post" tags:"Store" summary:"(商户管理员)创建门店"` + g.Meta `path:"/store" method:"post" tags:"Store" summary:"(商户门店后台)创建门店"` Name string `json:"name" v:"required" dc:"门店名称"` ContactName string `json:"contactName" v:"required" dc:"联系人"` ContactPhone string `json:"contactPhone" v:"required" dc:"联系人电话"` @@ -24,7 +24,7 @@ type CreateRes struct { Id int64 `json:"id" dc:"门店ID"` } type UpdateReq struct { - g.Meta `path:"/store" method:"put" tags:"Store" summary:"(商户管理员)更新门店"` + g.Meta `path:"/store" method:"put" tags:"Store" summary:"(系统、商户门店后台)更新门店"` Id int64 `json:"id" v:"required" dc:"门店ID"` Name string `json:"name" v:"required" dc:"门店名称"` Address string `json:"address" v:"required" dc:"门店地址"` @@ -36,7 +36,7 @@ type UpdateRes struct { Success bool `json:"success" dc:"是否成功"` } type DeleteReq struct { - g.Meta `path:"/store" method:"delete" tags:"Store" summary:"(商户管理员)删除门店"` + g.Meta `path:"/store" method:"delete" tags:"Store" summary:"(系统、商户门店后台)删除门店"` Id int64 `json:"id" v:"required" dc:"门店ID"` } type DeleteRes struct { diff --git a/api/storeAdmin/v1/storeAdmin.go b/api/storeAdmin/v1/storeAdmin.go index 1eb7b40..518ded2 100644 --- a/api/storeAdmin/v1/storeAdmin.go +++ b/api/storeAdmin/v1/storeAdmin.go @@ -3,7 +3,7 @@ package v1 import "github.com/gogf/gf/v2/frame/g" type InfoReq struct { - g.Meta `path:"/store/info" method:"get" tags:"StoreAdmin" summary:"(门店管理员)获取门店管理员信息"` + g.Meta `path:"/store/info" method:"get" tags:"StoreAdmin" summary:"(系统、商户门店后台)获取门店管理员信息"` } type InfoRes struct { diff --git a/api/task/v1/task.go b/api/task/v1/task.go index 042ca22..563017d 100644 --- a/api/task/v1/task.go +++ b/api/task/v1/task.go @@ -5,7 +5,7 @@ import "github.com/gogf/gf/v2/frame/g" type ListReq struct { } type RankingReq struct { - g.Meta `path:"/task/ranking" method:"get" tags:"Task" summary:"任务排行榜"` + g.Meta `path:"/task/ranking" method:"get" tags:"Task" summary:"(PC)任务排行榜"` StoreId int `json:"storeId" v:"required#请选择店铺" dc:"门店id"` Page int `json:"page" dc:"页数"` Size int `json:"size" dc:"条数"` @@ -20,7 +20,7 @@ type RankingRes struct { } type NonLoginTaskListReq struct { - g.Meta `path:"/task/getNonLoginTaskList" method:"get" tags:"Task" summary:"网吧未登录任务列表"` + g.Meta `path:"/task/getNonLoginTaskList" method:"get" tags:"Task" summary:"(PC)网吧未登录任务列表"` NetBarAccount string `json:"netBarAccount" v:"required#网关账号不能为空" dc:"网关账号"` Page int `json:"page" v:"required#分页索引不能为空" dc:"分页索引"` Size int `json:"size" v:"required#分页大小不能为空" dc:"分页大小"` @@ -36,7 +36,7 @@ type NonLoginTaskListRes struct { } type GetLoginTaskListReq struct { - g.Meta `path:"/task/getLoginTaskList" method:"get" tags:"Task" summary:"网吧未登录任务列表"` + g.Meta `path:"/task/getLoginTaskList" method:"get" tags:"Task" summary:"(PC)网吧未登录任务列表"` NetBarAccount string `json:"netBarAccount" v:"required#网关账号不能为空" dc:"网关账号"` Page int `json:"page" v:"required#分页索引不能为空" dc:"分页索引"` Size int `json:"size" v:"required#分页大小不能为空" dc:"分页大小"` diff --git a/api/user/v1/user.go b/api/user/v1/user.go index 3167695..857d65f 100644 --- a/api/user/v1/user.go +++ b/api/user/v1/user.go @@ -3,7 +3,7 @@ package v1 import "github.com/gogf/gf/v2/frame/g" type ListReq struct { - g.Meta `path:"/user/list" method:"get" tags:"User" summary:"获取用户列表"` + g.Meta `path:"/user/list" method:"get" tags:"User" summary:"(系统、商户门店后台)获取用户列表"` Page int `json:"page" dc:"页数"` Size int `json:"size" dc:"页数"` } @@ -13,7 +13,7 @@ type ListRes struct { } type InfoReq struct { - g.Meta `path:"/user/info" method:"get" tags:"User" summary:"获取用户信息"` + g.Meta `path:"/user/info" method:"get" tags:"User" summary:"(PC)获取用户信息"` OpenId string `json:"openId" v:"required#OpenId不能为空" dc:"OpenId"` } @@ -31,7 +31,7 @@ type InfoRes struct { } type UpdateReq struct { - g.Meta `path:"/user" method:"put" tags:"User" summary:"更新用户头像,昵称"` + g.Meta `path:"/user" method:"put" tags:"User" summary:"(PC)更新用户头像,昵称"` Avatar string `json:"avatar" v:"required#头像不能为空" dc:"头像"` Nickname string `json:"nickname" v:"required#昵称不能为空" dc:"昵称"` } @@ -41,7 +41,7 @@ type UpdateRes struct { } type BindPhoneReq struct { - g.Meta `path:"/user/bindPhone" method:"post" tags:"User" summary:"绑定手机号"` + g.Meta `path:"/user/bindPhone" method:"post" tags:"User" summary:"(PC)绑定手机号"` Phone string `json:"phone" v:"required#手机号不能为空" dc:"手机号"` Code string `json:"code" v:"required#验证码不能为空" dc:"验证码"` } @@ -51,7 +51,7 @@ type BindPhoneRes struct { } type GetPhoneCodeReq struct { - g.Meta `path:"/user/getPhoneCode" method:"post" tags:"User" summary:"获取手机验证码"` + g.Meta `path:"/user/getPhoneCode" method:"post" tags:"User" summary:"(PC)获取手机验证码"` Phone string `json:"phone" v:"required#手机号不能为空" dc:"手机号"` } @@ -59,7 +59,7 @@ type GetPhoneCodeRes struct { Success bool `json:"success" dc:"是否成功"` } type GetUserBoundInfoReq struct { - g.Meta `path:"/user/boundInfo" method:"get" tags:"User" summary:"获取用户绑定信息"` + g.Meta `path:"/user/boundInfo" method:"get" tags:"User" summary:"(PC)获取用户绑定信息"` PopenId string `json:"popenId" v:"required#popenId不能为空" dc:"用户详情接口返回的 wxPopenId 或者是 qqPopenId"` } type GetUserBoundInfoRes struct { @@ -67,7 +67,7 @@ type GetUserBoundInfoRes struct { } type GetBoundUrlReq struct { - g.Meta `path:"/user/boundUrl" method:"get" tags:"User" summary:"获取用户绑定url"` + g.Meta `path:"/user/boundUrl" method:"get" tags:"User" summary:"(PC)获取用户绑定url"` PopenId string `json:"popenId" v:"required#popenId不能为空" dc:"用户详情接口返回的 wxPopenId 或者是 qqPopenId"` BindType int `json:"bindType" v:"required|in:1,2#请选择绑定方式,只能为1或2" dc:"绑定方式,默认值1,1: qq; 2: wx" default:"1"` AppName string `json:"appName" v:"required#请选择游戏" dc:"游戏名称"` @@ -77,7 +77,7 @@ type GetBoundUrlRes struct { } type GetUnboundUrlReq struct { - g.Meta `path:"/user/unBoundUrl" method:"get" tags:"User" summary:"获取用户解绑url"` + g.Meta `path:"/user/unBoundUrl" method:"get" tags:"User" summary:"(PC)获取用户解绑url"` PopenId string `json:"popenId" v:"required#popenId不能为空" dc:"用户详情接口返回的 wxPopenId 或者是 qqPopenId"` BindType int `json:"bindType" v:"required|in:1,2#请选择绑定方式,只能为1或2" dc:"绑定方式,默认值1,1: qq; 2: wx" default:"1"` AppName string `json:"appName" v:"required#请选择游戏" dc:"游戏名称"` diff --git a/api/wx/v1/wx.go b/api/wx/v1/wx.go index d5d21f9..981d9e1 100644 --- a/api/wx/v1/wx.go +++ b/api/wx/v1/wx.go @@ -3,7 +3,7 @@ package v1 import "github.com/gogf/gf/v2/frame/g" type WeChatLoginReq struct { - g.Meta `path:"/wechat/login" method:"post" tags:"WeChat" summary:"(用户)获取微信二维码登录"` + g.Meta `path:"/wechat/login" method:"post" tags:"WeChat" summary:"(PC)获取微信二维码登录"` SceneId string `json:"sceneId" v:"required" dc:"场景ID,规则:[门店code]_[6位随机字符串]"` } type WeChatLoginRes struct { @@ -35,7 +35,7 @@ type WeChatVertifyRes struct { } type WeChatPollingReq struct { - g.Meta `path:"/wechat/polling" method:"post" tags:"WeChat" summary:"(用户)微信长轮询"` + g.Meta `path:"/wechat/polling" method:"post" tags:"WeChat" summary:"(PC)微信长轮询"` SceneId string `json:"sceneId" v:"required" dc:"场景ID"` } type WeChatPollingRes struct { diff --git a/internal/controller/wx/wx_v1_we_chat_event.go b/internal/controller/wx/wx_v1_we_chat_event.go index e4097b9..ae86c0b 100644 --- a/internal/controller/wx/wx_v1_we_chat_event.go +++ b/internal/controller/wx/wx_v1_we_chat_event.go @@ -23,7 +23,8 @@ func (c *ControllerV1) WeChatEvent(ctx context.Context, req *v1.WeChatEventReq) switch req.Event { case "subscribe": key := strings.TrimPrefix(req.EventKey, "qrscene_") - out, err := service.User().Login(ctx, &model.UserLoginIn{OpenId: req.FromUserName}) + split := strings.Split(req.EventKey, "_") + out, err := service.User().Login(ctx, &model.UserLoginIn{OpenId: req.FromUserName, StoreCode: split[0]}) if err != nil { return nil, err } @@ -32,7 +33,8 @@ func (c *ControllerV1) WeChatEvent(ctx context.Context, req *v1.WeChatEventReq) } return nil, nil case "SCAN": - out, err := service.User().Login(ctx, &model.UserLoginIn{OpenId: req.FromUserName}) + split := strings.Split(req.EventKey, "_") + out, err := service.User().Login(ctx, &model.UserLoginIn{OpenId: req.FromUserName, StoreCode: split[0]}) if err != nil { return nil, err } diff --git a/internal/model/user.go b/internal/model/user.go index 65023d8..d209f76 100644 --- a/internal/model/user.go +++ b/internal/model/user.go @@ -54,7 +54,8 @@ type LoginCache struct { } type UserLoginIn struct { - OpenId string + OpenId string + StoreCode string // 门店编码,登录时根据门店编码查询,填写最近一次登录门店 id } type WeChatLogin struct { UUID string // 使用的是微信的唯一 id,而不是openid,保证微信服务号,小程序绑定的系统用户为同一个