mtwmapi与ebaiapi返回api id的函数

This commit is contained in:
gazebo
2019-12-09 13:49:49 +08:00
parent d1a86752fc
commit 183791e49d
3 changed files with 9 additions and 1 deletions

View File

@@ -102,7 +102,7 @@ func (a *API) Decrypt(msg string) (decryptedMsg string, err error) {
if err = err2; err == nil {
var msgLen int32
if err = binary.Read(bytes.NewBuffer(binResult[16:]), binary.BigEndian, &msgLen); err == nil {
baseapi.SugarLogger.Debug(msgLen)
// baseapi.SugarLogger.Debug(msgLen)
decryptedMsg = string(binResult[16+4 : 16+4+msgLen])
}
}

View File

@@ -86,6 +86,10 @@ func (a *API) getShopID(body map[string]interface{}) (shopID string) {
return ""
}
func (a *API) GetSource() string {
return a.source
}
func (a *API) AccessAPI2(cmd string, body map[string]interface{}, trackInfo string) (retVal *ResponseResult, err error) {
baseapi.SugarLogger.Debugf("ebai AccessAPI cmd:%s", cmd)
// a.speedLimiter.AccessAPI(allAPI)

View File

@@ -111,6 +111,10 @@ func (a *API) signParams(signURL string, params map[string]interface{}) string {
return fmt.Sprintf("%x", md5.Sum([]byte(finalStr)))
}
func (a *API) GetAppID() string {
return a.appID
}
func (a *API) AccessAPI2(cmd string, isGet bool, bizParams map[string]interface{}, resultKey, trackInfo string) (retVal interface{}, err error) {
params := make(map[string]interface{})
params["timestamp"] = time.Now().Unix()