1
This commit is contained in:
@@ -1,7 +1,12 @@
|
|||||||
package controllers
|
package controllers
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"git.rosy.net.cn/baseapi/utils"
|
||||||
|
"git.rosy.net.cn/jx-callback/globals"
|
||||||
|
"git.rosy.net.cn/jx-callback/globals/api"
|
||||||
"github.com/astaxie/beego/server/web"
|
"github.com/astaxie/beego/server/web"
|
||||||
|
"io/ioutil"
|
||||||
|
"net/http"
|
||||||
)
|
)
|
||||||
|
|
||||||
type TaoBaoVegetableController struct {
|
type TaoBaoVegetableController struct {
|
||||||
@@ -9,30 +14,30 @@ type TaoBaoVegetableController struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// GetCode 淘菜菜获取商户授权code
|
// GetCode 淘菜菜获取商户授权code
|
||||||
//func (c *TaoBaoVegetableController) GetCode() {
|
func (c *TaoBaoVegetableController) GetCode() {
|
||||||
// codeData := ""
|
codeData := ""
|
||||||
// if c.Ctx.Input.Method() == http.MethodPost {
|
if c.Ctx.Input.Method() == http.MethodPost {
|
||||||
// body, err := ioutil.ReadAll(c.Ctx.Request.Body)
|
body, err := ioutil.ReadAll(c.Ctx.Request.Body)
|
||||||
// if err != nil {
|
if err != nil {
|
||||||
// globals.SugarLogger.Debugf("商户收取code获取:%s,%s", string(body), err.Error())
|
globals.SugarLogger.Debugf("商户收取code获取:%s,%s", string(body), err.Error())
|
||||||
// c.Data["json"] = MsgFail()
|
c.Data["json"] = MsgFail()
|
||||||
// c.ServeJSON()
|
c.ServeJSON()
|
||||||
// return
|
return
|
||||||
// }
|
}
|
||||||
// globals.SugarLogger.Debugf("商户收取code获取:%s", string(body))
|
globals.SugarLogger.Debugf("商户收取code获取:%s", string(body))
|
||||||
// codeData = string(body)
|
codeData = string(body)
|
||||||
// } else {
|
} else {
|
||||||
// codeData = c.Ctx.Input.Query("code")
|
codeData = c.Ctx.Input.Query("code")
|
||||||
// }
|
}
|
||||||
//
|
globals.SugarLogger.Debugf("code:%s", utils.Format4Output(codeData, false))
|
||||||
// tokenInfo, err := api.TaoVegetableApi.GetStoreToken(codeData, "")
|
tokenInfo, err := api.TaoVegetableApi.GetStoreToken(codeData, "")
|
||||||
// if err != nil {
|
if err != nil {
|
||||||
// globals.SugarLogger.Debugf("获取门店token错误:%s", err.Error())
|
globals.SugarLogger.Debugf("获取门店token错误:%s", err.Error())
|
||||||
// c.Data["json"] = MsgFail()
|
c.Data["json"] = MsgFail()
|
||||||
// c.ServeJSON()
|
c.ServeJSON()
|
||||||
// return
|
return
|
||||||
// }
|
}
|
||||||
// fmt.Println(tokenInfo)
|
globals.SugarLogger.Debugf("token:%s", utils.Format4Output(tokenInfo, false))
|
||||||
// // 创建storeMap门店信息
|
// 创建storeMap门店信息
|
||||||
// // 刷新token
|
// 刷新token
|
||||||
//}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user