修改接口说明

This commit is contained in:
2025-06-12 09:18:25 +08:00
parent 3f5d0d7b2b
commit f7cffcae21
16 changed files with 57 additions and 55 deletions

View File

@ -3,7 +3,7 @@ package v1
import "github.com/gogf/gf/v2/frame/g" import "github.com/gogf/gf/v2/frame/g"
type AdminInfoReq struct { 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 { type AdminInfoRes struct {
g.Meta `mime:"application/json"` g.Meta `mime:"application/json"`

View File

@ -3,7 +3,7 @@ package v1
import "github.com/gogf/gf/v2/frame/g" import "github.com/gogf/gf/v2/frame/g"
type AdminLoginReq struct { 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:"用户名"` Username string `json:"username" v:"required" dc:"用户名"`
Password string `json:"password" v:"required" dc:"密码"` Password string `json:"password" v:"required" dc:"密码"`
} }
@ -14,7 +14,7 @@ type AdminLoginRes struct {
} }
type MerchantLoginReq 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:"用户名"` Username string `json:"username" dc:"用户名"`
Phone string `json:"phone" v:"regex:^1[3-9]\\d{9}$" dc:"手机号"` Phone string `json:"phone" v:"regex:^1[3-9]\\d{9}$" dc:"手机号"`
Code string `json:"code" dc:"验证码"` Code string `json:"code" dc:"验证码"`
@ -27,14 +27,14 @@ type MerchantLoginRes struct {
} }
type MerchantCodeReq 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:"手机号"` Phone string `json:"phone" v:"required" dc:"手机号"`
} }
type MerchantCodeRes struct{} type MerchantCodeRes struct{}
type MerchantRegisterReq 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:"用户名"` Username string `json:"username" v:"required" dc:"用户名"`
Phone string `json:"phone" v:"required|regex:^1[3-9]\\d{9}$" dc:"手机号"` Phone string `json:"phone" v:"required|regex:^1[3-9]\\d{9}$" dc:"手机号"`
Code string `json:"code" v:"required" dc:"验证码"` Code string `json:"code" v:"required" dc:"验证码"`
@ -49,7 +49,7 @@ type MerchantRegisterRes struct {
} }
type StoreLoginReq 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:"用户名"` Username string `json:"username" v:"required" dc:"用户名"`
Password string `json:"password" v:"required" dc:"密码"` Password string `json:"password" v:"required" dc:"密码"`
} }

View File

@ -6,7 +6,7 @@ import (
) )
type ListReq struct { 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"` //UserId int64 `json:"userId" v:"required#用户ID不能为空" dc:"用户ID"`
Status int `json:"status" v:"required#状态不能为空" dc:"状态"` Status int `json:"status" v:"required#状态不能为空" dc:"状态"`
Page int `json:"page" v:"required#页数不能为空" dc:"页数"` Page int `json:"page" v:"required#页数不能为空" dc:"页数"`
@ -21,7 +21,7 @@ type ListRes struct {
} }
type CreateReq 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:"标题"` Title string `json:"title" v:"required#标题不能为空" dc:"标题"`
Content string `json:"content" v:"required#反馈内容不能为空" dc:"反馈内容"` Content string `json:"content" v:"required#反馈内容不能为空" dc:"反馈内容"`
FeedbackType int `json:"feedbackType" v:"required#反馈类型不能为空" dc:"反馈类型"` FeedbackType int `json:"feedbackType" v:"required#反馈类型不能为空" dc:"反馈类型"`
@ -34,7 +34,7 @@ type CreateRes struct {
} }
type UpdateReq 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"` Id int64 `json:"id" v:"required#ID不能为空" dc:"ID"`
Title string `json:"title" v:"required#标题不能为空" dc:"标题"` Title string `json:"title" v:"required#标题不能为空" dc:"标题"`
Content string `json:"content" v:"required#反馈内容不能为空" dc:"反馈内容"` Content string `json:"content" v:"required#反馈内容不能为空" dc:"反馈内容"`
@ -51,7 +51,7 @@ type UpdateRes struct {
//} //}
type UpdateReplyReq 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"` Id int64 `json:"id" v:"required#ID不能为空" dc:"ID"`
Reply string `json:"reply" v:"required#回复内容不能为空" dc:"回复内容"` Reply string `json:"reply" v:"required#回复内容不能为空" dc:"回复内容"`
Status int `json:"status" v:"required#状态不能为空" dc:"状态"` Status int `json:"status" v:"required#状态不能为空" dc:"状态"`
@ -62,7 +62,7 @@ type UpdateReplyRes struct {
} }
type InfoFeedbackReq 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"` Id int64 `in:"path" json:"id" v:"required#ID不能为空" dc:"ID"`
} }

View File

@ -3,7 +3,7 @@ package v1
import "github.com/gogf/gf/v2/frame/g" import "github.com/gogf/gf/v2/frame/g"
type ListReq struct { 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:"页数"` Page int `json:"page" dc:"页数"`
Size int `json:"size" dc:"每页数量"` Size int `json:"size" dc:"每页数量"`
} }
@ -14,7 +14,7 @@ type ListRes struct {
} }
type CreateReq 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"` GameID int64 `json:"gameId" v:"required#游戏ID不能为空" dc:"游戏ID"`
GameName string `json:"gameName" v:"required#游戏名称不能为空" dc:"游戏名称"` GameName string `json:"gameName" v:"required#游戏名称不能为空" dc:"游戏名称"`
GameCode string `json:"gameCode" v:"required#游戏代号不能为空" dc:"游戏代号"` GameCode string `json:"gameCode" v:"required#游戏代号不能为空" dc:"游戏代号"`
@ -26,7 +26,7 @@ type CreateRes struct {
} }
type UpdateReq 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"` GameID int64 `json:"gameId" v:"required#游戏ID不能为空" dc:"游戏ID"`
GameName string `json:"gameName" v:"required#游戏名称不能为空" dc:"游戏名称"` GameName string `json:"gameName" v:"required#游戏名称不能为空" dc:"游戏名称"`
GameCode string `json:"gameCode" v:"required#游戏代号不能为空" dc:"游戏代号"` GameCode string `json:"gameCode" v:"required#游戏代号不能为空" dc:"游戏代号"`
@ -39,7 +39,7 @@ type UpdateRes struct {
} }
type DeleteReq 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"` ID int64 `json:"Id" v:"required#ID不能为空" dc:"ID"`
} }

View File

@ -1 +0,0 @@
package v1

View File

@ -5,7 +5,7 @@ import (
) )
type MerchantAdminInfoReq struct { 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 { type MerchantAdminInfoRes struct {
MerchantId int64 `json:"merchantId"` MerchantId int64 `json:"merchantId"`

View File

@ -7,7 +7,7 @@ import (
// CreateSystemRewardReq 创建系统奖励请求 // CreateSystemRewardReq 创建系统奖励请求
type CreateSystemRewardReq struct { 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"` RewardTypeId int64 `v:"required|min:1#奖励类型ID不能为空|奖励类型ID无效" json:"rewardTypeId" dc:"奖励类型ID"`
Name string `v:"required|length:1,100#奖励名称不能为空|奖励名称长度为1-100" json:"name" dc:"奖励名称"` Name string `v:"required|length:1,100#奖励名称不能为空|奖励名称长度为1-100" json:"name" dc:"奖励名称"`
Description string `v:"length:0,255#奖励描述长度为0-255" json:"description" dc:"奖励描述,可选"` Description string `v:"length:0,255#奖励描述长度为0-255" json:"description" dc:"奖励描述,可选"`
@ -24,7 +24,7 @@ type CreateSystemRewardRes struct {
// CreateStoreRewardReq 创建门店奖励请求 // CreateStoreRewardReq 创建门店奖励请求
type CreateStoreRewardReq struct { 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列表"` 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"` RewardTypeId int64 `v:"required|min:1#奖励类型ID不能为空|奖励类型ID无效" json:"rewardTypeId" dc:"奖励类型ID"`
Name string `v:"required|length:1,100#奖励名称不能为空|奖励名称长度为1-100" json:"name" dc:"奖励名称"` Name string `v:"required|length:1,100#奖励名称不能为空|奖励名称长度为1-100" json:"name" dc:"奖励名称"`
@ -42,7 +42,7 @@ type CreateStoreRewardRes struct {
// ListSystemRewardReq 查询系统奖励列表请求 // ListSystemRewardReq 查询系统奖励列表请求
type ListSystemRewardReq struct { 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:"页码"` 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:"每页数量"` PageSize int `v:"min:1|max:100#每页数量必须为1-100" json:"pageSize" d:"10" dc:"每页数量"`
Name string `json:"name" dc:"奖励名称,模糊查询,可选"` Name string `json:"name" dc:"奖励名称,模糊查询,可选"`
@ -58,7 +58,7 @@ type ListSystemRewardRes struct {
// ListStoreRewardReq 查询门店奖励列表请求 // ListStoreRewardReq 查询门店奖励列表请求
type ListStoreRewardReq struct { 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:"页码"` 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:"每页数量"` 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:"门店ID0=全部(管理员使用),其他值过滤该门店可见的奖励,可选"` StoreId int64 `v:"min:0#门店ID无效" json:"storeId" d:"0" dc:"门店ID0=全部(管理员使用),其他值过滤该门店可见的奖励,可选"`
@ -75,7 +75,7 @@ type ListStoreRewardRes struct {
// UpdateSystemRewardReq 更新系统奖励请求 // UpdateSystemRewardReq 更新系统奖励请求
type UpdateSystemRewardReq struct { 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"` Id uint64 `v:"required|min:1#奖励ID不能为空|奖励ID无效" json:"id" dc:"奖励ID"`
RewardTypeId int64 `v:"required|min:1#奖励类型ID不能为空|奖励类型ID无效" json:"rewardTypeId" 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:"奖励名称"` Name string `v:"required|length:1,100#奖励名称不能为空|奖励名称长度为1-100" json:"name" dc:"奖励名称"`
@ -93,7 +93,7 @@ type UpdateSystemRewardRes struct {
// UpdateStoreRewardReq 更新门店奖励请求 // UpdateStoreRewardReq 更新门店奖励请求
type UpdateStoreRewardReq struct { 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"` 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列表"` 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"` RewardTypeId int64 `v:"required|min:1#奖励类型ID不能为空|奖励类型ID无效" json:"rewardTypeId" dc:"奖励类型ID"`
@ -112,7 +112,7 @@ type UpdateStoreRewardRes struct {
// DeleteSystemRewardReq 删除系统奖励请求 // DeleteSystemRewardReq 删除系统奖励请求
type DeleteSystemRewardReq struct { 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"` Id uint64 `v:"required|min:1#奖励ID不能为空|奖励ID无效" json:"id" dc:"奖励ID"`
} }
@ -123,7 +123,7 @@ type DeleteSystemRewardRes struct {
// DeleteStoreRewardReq 删除门店奖励请求 // DeleteStoreRewardReq 删除门店奖励请求
type DeleteStoreRewardReq struct { 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"` Id uint64 `v:"required|min:1#奖励ID不能为空|奖励ID无效" json:"id" dc:"奖励ID"`
} }

View File

@ -3,7 +3,7 @@ package v1
import "github.com/gogf/gf/v2/frame/g" import "github.com/gogf/gf/v2/frame/g"
type ListReq struct { 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:"页码"` Page int `json:"page" v:"required#页码不能为空" dc:"页码"`
Size int `json:"size" v:"required#页大小不能为空" dc:"页大小"` Size int `json:"size" v:"required#页大小不能为空" dc:"页大小"`
} }
@ -14,7 +14,7 @@ type ListRes struct {
} }
type CreateReq 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:"名称"` Name string `json:"name" v:"required#名称不能为空" dc:"名称"`
//Sort int `json:"sort" v:"required#排序不能为空" dc:"排序"` //Sort int `json:"sort" v:"required#排序不能为空" dc:"排序"`
Code string `json:"code" v:"required#代号不能为空" dc:"代号"` Code string `json:"code" v:"required#代号不能为空" dc:"代号"`
@ -27,7 +27,7 @@ type CreateRes struct {
} }
type UpdateReq 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"` Id int64 `json:"id" v:"required#ID不能为空" dc:"ID"`
Name string `json:"name" v:"required#名称不能为空" dc:"名称"` Name string `json:"name" v:"required#名称不能为空" dc:"名称"`
Code string `json:"code" v:"required#代号不能为空" dc:"代号"` Code string `json:"code" v:"required#代号不能为空" dc:"代号"`
@ -40,7 +40,7 @@ type UpdateRes struct {
} }
type DeleteReq 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"` Id int64 `path:"id" v:"required#ID不能为空" dc:"ID"`
} }

View File

@ -6,7 +6,7 @@ import (
// ListReq 获取角色列表请求参数 // ListReq 获取角色列表请求参数
type ListReq struct { 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:"页数"` Page int `json:"page" dc:"页数"`
Size int `json:"size" dc:"每页数量"` Size int `json:"size" dc:"每页数量"`
Status int `json:"status" dc:"状态1=启用2=禁用"` Status int `json:"status" dc:"状态1=启用2=禁用"`
@ -20,7 +20,7 @@ type ListRes struct {
// CreateReq 创建角色请求参数 // CreateReq 创建角色请求参数
type CreateReq struct { 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:"角色名称"` Name string `json:"name" v:"required" dc:"角色名称"`
Code string `json:"code" v:"required" dc:"角色编码"` Code string `json:"code" v:"required" dc:"角色编码"`
Description string `json:"description" dc:"角色描述"` Description string `json:"description" dc:"角色描述"`
@ -34,7 +34,7 @@ type CreateRes struct {
// UpdateReq 更新角色请求参数 // UpdateReq 更新角色请求参数
type UpdateReq struct { 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"` Id int64 `json:"id" v:"required" dc:"角色ID"`
Name string `json:"name" v:"required" dc:"角色名称"` Name string `json:"name" v:"required" dc:"角色名称"`
Code string `json:"code" v:"required" dc:"角色编码"` Code string `json:"code" v:"required" dc:"角色编码"`
@ -49,7 +49,7 @@ type UpdateRes struct {
// DeleteReq 删除角色请求参数 // DeleteReq 删除角色请求参数
type DeleteReq struct { 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"` Id int64 `json:"id" in:"path" v:"required" dc:"角色ID"`
} }
@ -59,7 +59,7 @@ type DeleteRes struct {
} }
type BatchDeleteReq 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"` Ids []int `json:"ids" v:"required" dc:"角色ID"`
} }
type BatchDeleteRes struct { type BatchDeleteRes struct {

View File

@ -5,7 +5,7 @@ import (
) )
type ListReq struct { 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:"页数"` Page int `json:"page" dc:"页数"`
Size int `json:"size" dc:"每页数量"` Size int `json:"size" dc:"每页数量"`
MerchantId int `json:"merchantId" dc:"商户ID"` MerchantId int `json:"merchantId" dc:"商户ID"`
@ -15,7 +15,7 @@ type ListRes struct {
Total int `json:"total" dc:"总数"` Total int `json:"total" dc:"总数"`
} }
type CreateReq struct { 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:"门店名称"` Name string `json:"name" v:"required" dc:"门店名称"`
ContactName string `json:"contactName" v:"required" dc:"联系人"` ContactName string `json:"contactName" v:"required" dc:"联系人"`
ContactPhone string `json:"contactPhone" v:"required" dc:"联系人电话"` ContactPhone string `json:"contactPhone" v:"required" dc:"联系人电话"`
@ -24,7 +24,7 @@ type CreateRes struct {
Id int64 `json:"id" dc:"门店ID"` Id int64 `json:"id" dc:"门店ID"`
} }
type UpdateReq struct { 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"` Id int64 `json:"id" v:"required" dc:"门店ID"`
Name string `json:"name" v:"required" dc:"门店名称"` Name string `json:"name" v:"required" dc:"门店名称"`
Address string `json:"address" v:"required" dc:"门店地址"` Address string `json:"address" v:"required" dc:"门店地址"`
@ -36,7 +36,7 @@ type UpdateRes struct {
Success bool `json:"success" dc:"是否成功"` Success bool `json:"success" dc:"是否成功"`
} }
type DeleteReq struct { 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"` Id int64 `json:"id" v:"required" dc:"门店ID"`
} }
type DeleteRes struct { type DeleteRes struct {

View File

@ -3,7 +3,7 @@ package v1
import "github.com/gogf/gf/v2/frame/g" import "github.com/gogf/gf/v2/frame/g"
type InfoReq struct { 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 { type InfoRes struct {

View File

@ -5,7 +5,7 @@ import "github.com/gogf/gf/v2/frame/g"
type ListReq struct { type ListReq struct {
} }
type RankingReq 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"` StoreId int `json:"storeId" v:"required#请选择店铺" dc:"门店id"`
Page int `json:"page" dc:"页数"` Page int `json:"page" dc:"页数"`
Size int `json:"size" dc:"条数"` Size int `json:"size" dc:"条数"`
@ -20,7 +20,7 @@ type RankingRes struct {
} }
type NonLoginTaskListReq 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:"网关账号"` NetBarAccount string `json:"netBarAccount" v:"required#网关账号不能为空" dc:"网关账号"`
Page int `json:"page" v:"required#分页索引不能为空" dc:"分页索引"` Page int `json:"page" v:"required#分页索引不能为空" dc:"分页索引"`
Size int `json:"size" v:"required#分页大小不能为空" dc:"分页大小"` Size int `json:"size" v:"required#分页大小不能为空" dc:"分页大小"`
@ -36,7 +36,7 @@ type NonLoginTaskListRes struct {
} }
type GetLoginTaskListReq 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:"网关账号"` NetBarAccount string `json:"netBarAccount" v:"required#网关账号不能为空" dc:"网关账号"`
Page int `json:"page" v:"required#分页索引不能为空" dc:"分页索引"` Page int `json:"page" v:"required#分页索引不能为空" dc:"分页索引"`
Size int `json:"size" v:"required#分页大小不能为空" dc:"分页大小"` Size int `json:"size" v:"required#分页大小不能为空" dc:"分页大小"`

View File

@ -3,7 +3,7 @@ package v1
import "github.com/gogf/gf/v2/frame/g" import "github.com/gogf/gf/v2/frame/g"
type ListReq struct { 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:"页数"` Page int `json:"page" dc:"页数"`
Size int `json:"size" dc:"页数"` Size int `json:"size" dc:"页数"`
} }
@ -13,7 +13,7 @@ type ListRes struct {
} }
type InfoReq 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"` OpenId string `json:"openId" v:"required#OpenId不能为空" dc:"OpenId"`
} }
@ -31,7 +31,7 @@ type InfoRes struct {
} }
type UpdateReq 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:"头像"` Avatar string `json:"avatar" v:"required#头像不能为空" dc:"头像"`
Nickname string `json:"nickname" v:"required#昵称不能为空" dc:"昵称"` Nickname string `json:"nickname" v:"required#昵称不能为空" dc:"昵称"`
} }
@ -41,7 +41,7 @@ type UpdateRes struct {
} }
type BindPhoneReq 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:"手机号"` Phone string `json:"phone" v:"required#手机号不能为空" dc:"手机号"`
Code string `json:"code" v:"required#验证码不能为空" dc:"验证码"` Code string `json:"code" v:"required#验证码不能为空" dc:"验证码"`
} }
@ -51,7 +51,7 @@ type BindPhoneRes struct {
} }
type GetPhoneCodeReq 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:"手机号"` Phone string `json:"phone" v:"required#手机号不能为空" dc:"手机号"`
} }
@ -59,7 +59,7 @@ type GetPhoneCodeRes struct {
Success bool `json:"success" dc:"是否成功"` Success bool `json:"success" dc:"是否成功"`
} }
type GetUserBoundInfoReq struct { 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"` PopenId string `json:"popenId" v:"required#popenId不能为空" dc:"用户详情接口返回的 wxPopenId 或者是 qqPopenId"`
} }
type GetUserBoundInfoRes struct { type GetUserBoundInfoRes struct {
@ -67,7 +67,7 @@ type GetUserBoundInfoRes struct {
} }
type GetBoundUrlReq 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"` PopenId string `json:"popenId" v:"required#popenId不能为空" dc:"用户详情接口返回的 wxPopenId 或者是 qqPopenId"`
BindType int `json:"bindType" v:"required|in:1,2#请选择绑定方式只能为1或2" dc:"绑定方式默认值11: qq; 2: wx" default:"1"` BindType int `json:"bindType" v:"required|in:1,2#请选择绑定方式只能为1或2" dc:"绑定方式默认值11: qq; 2: wx" default:"1"`
AppName string `json:"appName" v:"required#请选择游戏" dc:"游戏名称"` AppName string `json:"appName" v:"required#请选择游戏" dc:"游戏名称"`
@ -77,7 +77,7 @@ type GetBoundUrlRes struct {
} }
type GetUnboundUrlReq 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"` PopenId string `json:"popenId" v:"required#popenId不能为空" dc:"用户详情接口返回的 wxPopenId 或者是 qqPopenId"`
BindType int `json:"bindType" v:"required|in:1,2#请选择绑定方式只能为1或2" dc:"绑定方式默认值11: qq; 2: wx" default:"1"` BindType int `json:"bindType" v:"required|in:1,2#请选择绑定方式只能为1或2" dc:"绑定方式默认值11: qq; 2: wx" default:"1"`
AppName string `json:"appName" v:"required#请选择游戏" dc:"游戏名称"` AppName string `json:"appName" v:"required#请选择游戏" dc:"游戏名称"`

View File

@ -3,7 +3,7 @@ package v1
import "github.com/gogf/gf/v2/frame/g" import "github.com/gogf/gf/v2/frame/g"
type WeChatLoginReq struct { 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位随机字符串]"` SceneId string `json:"sceneId" v:"required" dc:"场景ID,规则:[门店code]_[6位随机字符串]"`
} }
type WeChatLoginRes struct { type WeChatLoginRes struct {
@ -35,7 +35,7 @@ type WeChatVertifyRes struct {
} }
type WeChatPollingReq 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"` SceneId string `json:"sceneId" v:"required" dc:"场景ID"`
} }
type WeChatPollingRes struct { type WeChatPollingRes struct {

View File

@ -23,7 +23,8 @@ func (c *ControllerV1) WeChatEvent(ctx context.Context, req *v1.WeChatEventReq)
switch req.Event { switch req.Event {
case "subscribe": case "subscribe":
key := strings.TrimPrefix(req.EventKey, "qrscene_") 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 { if err != nil {
return nil, err return nil, err
} }
@ -32,7 +33,8 @@ func (c *ControllerV1) WeChatEvent(ctx context.Context, req *v1.WeChatEventReq)
} }
return nil, nil return nil, nil
case "SCAN": 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 { if err != nil {
return nil, err return nil, err
} }

View File

@ -55,6 +55,7 @@ type LoginCache struct {
type UserLoginIn struct { type UserLoginIn struct {
OpenId string OpenId string
StoreCode string // 门店编码,登录时根据门店编码查询,填写最近一次登录门店 id
} }
type WeChatLogin struct { type WeChatLogin struct {
UUID string // 使用的是微信的唯一 id而不是openid保证微信服务号小程序绑定的系统用户为同一个 UUID string // 使用的是微信的唯一 id而不是openid保证微信服务号小程序绑定的系统用户为同一个