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) {
|
func SetUserInfo(token string, authInfo *AuthInfo, duration time.Duration) {
|
||||||
api.Cacher.Set(token, authInfo, DefTokenDuration)
|
api.Cacher.Set(token, authInfo, DefTokenDuration)
|
||||||
|
api.Cacher.Set(authInfo.Mobile, token, DefTokenDuration)
|
||||||
}
|
}
|
||||||
|
|
||||||
func ClearUserToken(userID string) {
|
func ClearUserToken(userID string) {
|
||||||
|
|||||||
@@ -460,3 +460,19 @@ func (c *Auth2Controller) GetUserByMiniInfo() {
|
|||||||
return retVal, "", err
|
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 {
|
if c.Ctx.Input.Method() == http.MethodPost {
|
||||||
var callbackResponse *jdapi.CallbackResponse
|
var callbackResponse *jdapi.CallbackResponse
|
||||||
msg, url, err := jdapi.ImChatRiskMsg(getUsefulRequest(c.Ctx))
|
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 {
|
if err != nil {
|
||||||
callbackResponse = jdapi.Err2CallbackResponse(err, "")
|
callbackResponse = jdapi.Err2CallbackResponse(err, "")
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -235,7 +235,6 @@ func (c *MtwmController) ImgCheckOutCallback() {
|
|||||||
|
|
||||||
ddmsg.SendUserMessage(dingdingapi.MsgTyeText, "2452A93EEB9111EC9B06525400E86DC0", "ImgCheckOutCallback", fmt.Sprintf("美团返图审核:%s", utils.Format4Output(data, false)))
|
ddmsg.SendUserMessage(dingdingapi.MsgTyeText, "2452A93EEB9111EC9B06525400E86DC0", "ImgCheckOutCallback", fmt.Sprintf("美团返图审核:%s", utils.Format4Output(data, false)))
|
||||||
globals.SugarLogger.Debugf("-----data := %s", utils.Format4Output(data, false))
|
globals.SugarLogger.Debugf("-----data := %s", utils.Format4Output(data, false))
|
||||||
|
|
||||||
c.Data["json"] = map[string]interface{}{"result_code": 1}
|
c.Data["json"] = map[string]interface{}{"result_code": 1}
|
||||||
c.ServeJSON()
|
c.ServeJSON()
|
||||||
|
|
||||||
|
|||||||
@@ -284,6 +284,14 @@ func init() {
|
|||||||
MethodParams: param.Make(),
|
MethodParams: param.Make(),
|
||||||
Filters: nil,
|
Filters: nil,
|
||||||
Params: 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.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:Auth2Controller"] = append(web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:Auth2Controller"],
|
||||||
web.ControllerComments{
|
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": {
|
"/auth2/GetTokenInfo": {
|
||||||
"get": {
|
"get": {
|
||||||
"tags": [
|
"tags": [
|
||||||
|
|||||||
@@ -1177,6 +1177,21 @@ paths:
|
|||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
description: '{object} controllers.CallResult'
|
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:
|
/auth2/GetTokenInfo:
|
||||||
get:
|
get:
|
||||||
tags:
|
tags:
|
||||||
|
|||||||
Reference in New Issue
Block a user