package handler import ( "github.com/gin-gonic/gin" "youngee_m_api/consts" "youngee_m_api/model/http_model" ) func WrapRefreshAuthorizationHandler(ctx *gin.Context) { handler := newRefreshAuthorizationHandler(ctx) BaseRun(handler) } type RefreshAuthorizationHandler struct { ctx *gin.Context req *http_model.RefreshAuthorizationRequest resp *http_model.CommonResponse } func (c RefreshAuthorizationHandler) getContext() *gin.Context { return c.ctx } func (c RefreshAuthorizationHandler) getResponse() interface{} { return c.resp } func (c RefreshAuthorizationHandler) getRequest() interface{} { return c.req } func (c RefreshAuthorizationHandler) run() { data := http_model.RefreshAuthorizationRequest{} data = *c.req res := http_model.RefreshAuthkuaishouResponse{ Url: "https://open.kuaishou.com/oauth2/connect?app_id=ks651333097154138217&redirect_uri=https://younggee.com/kuaishouauth&scope=merchant_distribution,merchant_refund,merchant_item,merchant_order,user_info,merchant_servicemarket,merchant_user,merchant_logistics&response_type=code&state=" + data.PhoneNumber, } c.resp.Message = "已返回授权码" c.resp.Status = consts.ErrorSuccess c.resp.Data = res } func (c RefreshAuthorizationHandler) checkParam() error { return nil } func newRefreshAuthorizationHandler(ctx *gin.Context) *RefreshAuthorizationHandler { return &RefreshAuthorizationHandler{ ctx: ctx, req: http_model.NewRefreshAuthorizationRequest(), resp: http_model.NewRefreshAuthorizationResponse(), } }