This commit is contained in:
suyl
2021-05-14 10:04:49 +08:00
parent 87f5b06c52
commit 4a495cb077
2 changed files with 48 additions and 78 deletions

View File

@@ -235,28 +235,29 @@ func (c *DjswController) OrderInfoChange() {
}
}
func (c *DjswController) MemberCreateCard() {
if c.Ctx.Input.Method() == http.MethodPost {
callbackResponse := c.handleMsg(func(a *jdapi.API, obj interface{}) (callbackResponse *jdapi.CallbackResponse) {
callbackResponse = jd.MemberCreateMsg(obj.(*jdapi.CallbackMemberMsg))
return callbackResponse
})
c.Data["json"] = c.transferResponse("MemberCreateCard", callbackResponse)
c.ServeJSON()
} else {
c.Abort("404")
}
}
func (c *DjswController) MemberRenewCard() {
if c.Ctx.Input.Method() == http.MethodPost {
callbackResponse := c.handleMsg(func(a *jdapi.API, obj interface{}) (callbackResponse *jdapi.CallbackResponse) {
callbackResponse = jd.MemberRenewMsg(obj.(*jdapi.CallbackMemberMsg))
return callbackResponse
})
c.Data["json"] = c.transferResponse("MemberRenewCard", callbackResponse)
c.ServeJSON()
} else {
c.Abort("404")
}
}
//免费开卡接不到回调
//func (c *DjswController) MemberCreateCard() {
// if c.Ctx.Input.Method() == http.MethodPost {
// callbackResponse := c.handleMsg(func(a *jdapi.API, obj interface{}) (callbackResponse *jdapi.CallbackResponse) {
// callbackResponse = jd.MemberCreateMsg(obj.(*jdapi.CallbackMemberMsg))
// return callbackResponse
// })
// c.Data["json"] = c.transferResponse("MemberCreateCard", callbackResponse)
// c.ServeJSON()
// } else {
// c.Abort("404")
// }
//}
//
//func (c *DjswController) MemberRenewCard() {
// if c.Ctx.Input.Method() == http.MethodPost {
// callbackResponse := c.handleMsg(func(a *jdapi.API, obj interface{}) (callbackResponse *jdapi.CallbackResponse) {
// callbackResponse = jd.MemberRenewMsg(obj.(*jdapi.CallbackMemberMsg))
// return callbackResponse
// })
// c.Data["json"] = c.transferResponse("MemberRenewCard", callbackResponse)
// c.ServeJSON()
// } else {
// c.Abort("404")
// }
//}