新增返回用户扫码登录的场景 id
This commit is contained in:
@ -4,7 +4,7 @@ import "github.com/gogf/gf/v2/frame/g"
|
|||||||
|
|
||||||
type WeChatLoginReq struct {
|
type WeChatLoginReq struct {
|
||||||
g.Meta `path:"/wechat/login" method:"post" tags:"WeChat" summary:"(PC)获取微信二维码登录"`
|
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"`
|
||||||
}
|
}
|
||||||
type WeChatLoginRes struct {
|
type WeChatLoginRes struct {
|
||||||
}
|
}
|
||||||
@ -42,3 +42,12 @@ type WeChatPollingRes struct {
|
|||||||
Status string `json:"status" dc:"状态"`
|
Status string `json:"status" dc:"状态"`
|
||||||
Token string `json:"token" dc:"token"`
|
Token string `json:"token" dc:"token"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type GetWechatSceneIdReq struct {
|
||||||
|
g.Meta `path:"/wechat/sceneId" method:"get" tags:"WeChat" summary:"(PC)获取微信场景ID"`
|
||||||
|
NetbarAccount string `json:"netbarAccount" v:"required" dc:"网关账号"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type GetWechatSceneIdRes struct {
|
||||||
|
SceneId string `json:"sceneId" v:"required" dc:"场景ID"`
|
||||||
|
}
|
||||||
|
|||||||
@ -15,4 +15,5 @@ type IWxV1 interface {
|
|||||||
WeChatEvent(ctx context.Context, req *v1.WeChatEventReq) (res *v1.WeChatEventRes, err error)
|
WeChatEvent(ctx context.Context, req *v1.WeChatEventReq) (res *v1.WeChatEventRes, err error)
|
||||||
WeChatVertify(ctx context.Context, req *v1.WeChatVertifyReq) (res *v1.WeChatVertifyRes, err error)
|
WeChatVertify(ctx context.Context, req *v1.WeChatVertifyReq) (res *v1.WeChatVertifyRes, err error)
|
||||||
WeChatPolling(ctx context.Context, req *v1.WeChatPollingReq) (res *v1.WeChatPollingRes, err error)
|
WeChatPolling(ctx context.Context, req *v1.WeChatPollingReq) (res *v1.WeChatPollingRes, err error)
|
||||||
|
GetWechatSceneId(ctx context.Context, req *v1.GetWechatSceneIdReq) (res *v1.GetWechatSceneIdRes, err error)
|
||||||
}
|
}
|
||||||
|
|||||||
12
internal/controller/wx/wx_v1_get_wechat_scene_id.go
Normal file
12
internal/controller/wx/wx_v1_get_wechat_scene_id.go
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
package wx
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"fmt"
|
||||||
|
"server/api/wx/v1"
|
||||||
|
"time"
|
||||||
|
)
|
||||||
|
|
||||||
|
func (c *ControllerV1) GetWechatSceneId(ctx context.Context, req *v1.GetWechatSceneIdReq) (res *v1.GetWechatSceneIdRes, err error) {
|
||||||
|
return &v1.GetWechatSceneIdRes{SceneId: fmt.Sprintf("%s_%d", req.NetbarAccount, time.Now().Unix())}, nil
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user