mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-10-12 04:53:47 +08:00
发布v2.8.4版本,更新内容请查看:https://github.com/bufanyun/hotgo/tree/v2.0/docs/guide-zh-CN/addon-version-upgrade.md
This commit is contained in:
@@ -7,11 +7,8 @@ package common
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
"hotgo/api/admin/common"
|
||||
"hotgo/internal/model/input/commonin"
|
||||
"hotgo/internal/service"
|
||||
"hotgo/utility/validate"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -21,29 +18,11 @@ var (
|
||||
type cWechat struct{}
|
||||
|
||||
func (c *cWechat) Authorize(ctx context.Context, req *common.WechatAuthorizeReq) (res *common.WechatAuthorizeRes, err error) {
|
||||
var in commonin.WechatAuthorizeInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if err = validate.PreFilter(ctx, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
_, err = service.CommonWechat().Authorize(ctx, in)
|
||||
_, err = service.CommonWechat().Authorize(ctx, &req.WechatAuthorizeInp)
|
||||
return
|
||||
}
|
||||
|
||||
func (c *cWechat) AuthorizeCall(ctx context.Context, req *common.WechatAuthorizeCallReq) (res *common.WechatAuthorizeCallRes, err error) {
|
||||
var in commonin.WechatAuthorizeCallInp
|
||||
if err = gconv.Scan(req, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if err = validate.PreFilter(ctx, &in); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
_, err = service.CommonWechat().AuthorizeCall(ctx, in)
|
||||
_, err = service.CommonWechat().AuthorizeCall(ctx, &req.WechatAuthorizeCallInp)
|
||||
return
|
||||
}
|
||||
|
Reference in New Issue
Block a user