1
This commit is contained in:
@@ -7,7 +7,6 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"git.rosy.net.cn/jx-callback/globals"
|
|
||||||
"net/http"
|
"net/http"
|
||||||
"reflect"
|
"reflect"
|
||||||
"sort"
|
"sort"
|
||||||
@@ -205,12 +204,9 @@ func (a *API) AccessAPI2(apiStr string, jdParams map[string]interface{}, traceIn
|
|||||||
var request *http.Request
|
var request *http.Request
|
||||||
if userGet {
|
if userGet {
|
||||||
fullURL := utils.GenerateGetURL(a.baseURL, apiStr, params)
|
fullURL := utils.GenerateGetURL(a.baseURL, apiStr, params)
|
||||||
// baseapi.SugarLogger.Debug(fullURL)
|
|
||||||
request, _ = http.NewRequest(http.MethodGet, fullURL, nil)
|
request, _ = http.NewRequest(http.MethodGet, fullURL, nil)
|
||||||
} else {
|
} else {
|
||||||
fullURL := utils.GenerateGetURL(a.baseURL, apiStr, nil)
|
fullURL := utils.GenerateGetURL(a.baseURL, apiStr, nil)
|
||||||
// baseapi.SugarLogger.Debug(utils.Map2URLValues(params).Encode())
|
|
||||||
globals.SugarLogger.Debugf("-----paramsparams- :%s", utils.Format4Output(params, false))
|
|
||||||
request, _ = http.NewRequest(http.MethodPost, fullURL, strings.NewReader(utils.Map2URLValues(params).Encode()))
|
request, _ = http.NewRequest(http.MethodPost, fullURL, strings.NewReader(utils.Map2URLValues(params).Encode()))
|
||||||
request.Header.Set("charset", "UTF-8")
|
request.Header.Set("charset", "UTF-8")
|
||||||
request.Header.Set("Content-Type", "application/x-www-form-urlencoded")
|
request.Header.Set("Content-Type", "application/x-www-form-urlencoded")
|
||||||
|
|||||||
@@ -51,19 +51,18 @@ func TestGetStoreInfoByStationNo(t *testing.T) {
|
|||||||
|
|
||||||
func TestUpdateStoreInfo4Open(t *testing.T) {
|
func TestUpdateStoreInfo4Open(t *testing.T) {
|
||||||
params := &OpStoreParams{
|
params := &OpStoreParams{
|
||||||
StationNo: "12664100",
|
StationNo: "11890095",
|
||||||
StationName: "旺佳超市",
|
OutSystemID: "100654",
|
||||||
OutSystemID: "668836",
|
Mobile: "18123353875",
|
||||||
Mobile: "17751816719",
|
Phone: "18123353875",
|
||||||
Phone: "17751816719",
|
Lat: 30.745945,
|
||||||
Lat: 43.622098,
|
Lng: 103.987782,
|
||||||
Lng: 122.275918,
|
City: 1930,
|
||||||
City: 902,
|
County: 49322,
|
||||||
County: 32769,
|
StationAddress: "郫都区成都市郫都区犀浦镇华都大道东一段330号1层连心菜市场34号",
|
||||||
StationAddress: "内蒙古自治区通辽市科尔沁区百花新城",
|
Operator: "jxadmin-18981810340",
|
||||||
Operator: "18981810340",
|
ServiceTimeEnd1: 38,
|
||||||
ServiceTimeEnd1: 44,
|
ServiceTimeStart1: 16,
|
||||||
ServiceTimeStart1: 14,
|
|
||||||
CoordinateType: 3,
|
CoordinateType: 3,
|
||||||
CloseStatus: 0,
|
CloseStatus: 0,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ func (a *API) EventSignChange(c *http.Request) (*CallbackResponse, []byte) {
|
|||||||
if beego.BConfig.RunMode == "jxgy" || beego.BConfig.RunMode == "jxpet" {
|
if beego.BConfig.RunMode == "jxgy" || beego.BConfig.RunMode == "jxpet" {
|
||||||
return CallbackResponseErr(true), body
|
return CallbackResponseErr(true), body
|
||||||
}
|
}
|
||||||
|
return &CallbackResponse{Code: CallbackSuccessCode, Msg: CallbackSuccess}, body
|
||||||
signParam := a.appKey + string(body) + a.appSecret
|
signParam := a.appKey + string(body) + a.appSecret
|
||||||
sign := fmt.Sprintf("%X", md5.Sum([]byte(signParam)))
|
sign := fmt.Sprintf("%X", md5.Sum([]byte(signParam)))
|
||||||
return CallbackResponseErr(sign != c.Header.Get("event-sign")), body
|
return CallbackResponseErr(sign != c.Header.Get("event-sign")), body
|
||||||
|
|||||||
Reference in New Issue
Block a user