1
This commit is contained in:
@@ -473,6 +473,7 @@ func GetTokenInfo(token string) (authInfo *AuthInfo, err error) {
|
||||
|
||||
func SetUserInfo(token string, authInfo *AuthInfo, duration time.Duration) {
|
||||
api.Cacher.Set(token, authInfo, DefTokenDuration)
|
||||
api.Cacher.Set(authInfo.Mobile, token, DefTokenDuration)
|
||||
}
|
||||
|
||||
func ClearUserToken(userID string) {
|
||||
|
||||
@@ -460,3 +460,19 @@ func (c *Auth2Controller) GetUserByMiniInfo() {
|
||||
return retVal, "", err
|
||||
})
|
||||
}
|
||||
|
||||
// @Title 根据电话号码获取用户头肯
|
||||
// @Description 根据电话号码获取用户头肯
|
||||
// @Param phoneNumber query string true "电话号码"
|
||||
// @Success 200 {object} controllers.CallResult
|
||||
// @Failure 200 {object} controllers.CallResult
|
||||
// @router /GetTokenByPhone [get]
|
||||
func (c *Auth2Controller) GetTokenByPhone() {
|
||||
c.callGetTokenByPhone(func(params *tAuth2GetTokenByPhoneParams) (retVal interface{}, errCode string, err error) {
|
||||
result := api.Cacher.Get(params.PhoneNumber)
|
||||
if result == nil {
|
||||
err = fmt.Errorf("暂未获取到此用户信息")
|
||||
}
|
||||
return result, "", err
|
||||
})
|
||||
}
|
||||
|
||||
@@ -252,6 +252,8 @@ func (c *DjswController) imMsg() {
|
||||
if c.Ctx.Input.Method() == http.MethodPost {
|
||||
var callbackResponse *jdapi.CallbackResponse
|
||||
msg, url, err := jdapi.ImChatRiskMsg(getUsefulRequest(c.Ctx))
|
||||
globals.SugarLogger.Debugf("-----------jdmsg := %s", utils.Format4Output(msg, false))
|
||||
globals.SugarLogger.Debugf("-----------jdmsg URL:= %s", url)
|
||||
if err != nil {
|
||||
callbackResponse = jdapi.Err2CallbackResponse(err, "")
|
||||
} else {
|
||||
|
||||
@@ -235,7 +235,6 @@ func (c *MtwmController) ImgCheckOutCallback() {
|
||||
|
||||
ddmsg.SendUserMessage(dingdingapi.MsgTyeText, "2452A93EEB9111EC9B06525400E86DC0", "ImgCheckOutCallback", fmt.Sprintf("美团返图审核:%s", utils.Format4Output(data, false)))
|
||||
globals.SugarLogger.Debugf("-----data := %s", utils.Format4Output(data, false))
|
||||
|
||||
c.Data["json"] = map[string]interface{}{"result_code": 1}
|
||||
c.ServeJSON()
|
||||
|
||||
|
||||
@@ -284,6 +284,14 @@ func init() {
|
||||
MethodParams: param.Make(),
|
||||
Filters: nil,
|
||||
Params: nil})
|
||||
web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:Auth2Controller"] = append(web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:Auth2Controller"],
|
||||
web.ControllerComments{
|
||||
Method: "GetTokenByPhone",
|
||||
Router: `/GetTokenByPhone`,
|
||||
AllowHTTPMethods: []string{"get"},
|
||||
MethodParams: param.Make(),
|
||||
Filters: nil,
|
||||
Params: nil})
|
||||
|
||||
web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:Auth2Controller"] = append(web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:Auth2Controller"],
|
||||
web.ControllerComments{
|
||||
|
||||
134860
swagger/param_parser.go.txt
134860
swagger/param_parser.go.txt
File diff suppressed because it is too large
Load Diff
@@ -1716,6 +1716,29 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/auth2/GetTokenByPhone": {
|
||||
"post": {
|
||||
"tags": [
|
||||
"auth2"
|
||||
],
|
||||
"description": "根据电话号码获取用户头肯",
|
||||
"operationId": "Auth2Controller.根据电话号码获取用户头肯",
|
||||
"parameters": [
|
||||
{
|
||||
"in": "query",
|
||||
"name": "phoneNumber",
|
||||
"description": "电话号码",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "{object} controllers.CallResult"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/auth2/GetTokenInfo": {
|
||||
"get": {
|
||||
"tags": [
|
||||
|
||||
@@ -1177,6 +1177,21 @@ paths:
|
||||
responses:
|
||||
"200":
|
||||
description: '{object} controllers.CallResult'
|
||||
/auth2/GetTokenByPhone:
|
||||
post:
|
||||
tags:
|
||||
- auth2
|
||||
description: 根据电话号码获取用户头肯
|
||||
operationId: Auth2Controller.根据电话号码获取用户头肯
|
||||
parameters:
|
||||
- in: query
|
||||
name: phoneNumber
|
||||
description: 电话号码
|
||||
required: true
|
||||
type: string
|
||||
responses:
|
||||
"200":
|
||||
description: '{object} controllers.CallResult'
|
||||
/auth2/GetTokenInfo:
|
||||
get:
|
||||
tags:
|
||||
|
||||
Reference in New Issue
Block a user