Merge branch 'master' of e.coding.net:rosydev/baseapi
This commit is contained in:
@@ -5,7 +5,6 @@ import (
|
||||
"crypto/md5"
|
||||
"fmt"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"git.rosy.net.cn/jx-callback/globals"
|
||||
"mime/multipart"
|
||||
"net/http"
|
||||
"net/url"
|
||||
@@ -146,7 +145,7 @@ func (a *API) AccessAPI2(cmd string, isGet bool, bizParams map[string]interface{
|
||||
}
|
||||
signURL := a.genURL(cmd) + "?"
|
||||
params[signKey] = a.signParams(signURL, params)
|
||||
globals.SugarLogger.Debugf("test mtCancelAct cmd=%s sig=%s", cmd, utils.Format4Output(params, false))
|
||||
//globals.SugarLogger.Debugf("test mtCancelAct cmd=%s sig=%s", cmd, utils.Format4Output(params, false))
|
||||
err = platformapi.AccessPlatformAPIWithRetry(a.client,
|
||||
func() *http.Request {
|
||||
var request *http.Request
|
||||
|
||||
@@ -146,7 +146,6 @@ func (a *API) GetCallbackUrlIndex(request *http.Request) (map[string]interface{}
|
||||
if err = json.Unmarshal(data, &temp); err == nil {
|
||||
urlIndex = temp["url_index"].(string)
|
||||
}
|
||||
globals.SugarLogger.Debugf("sfsfsf test data=%s,urlIndex=%s", utils.Format4Output(temp, false), urlIndex)
|
||||
result := make(map[string]interface{}, 0)
|
||||
switch urlIndex {
|
||||
case UrlIndexRiderStatus:
|
||||
|
||||
@@ -26,13 +26,7 @@ func (a *API) PreCreateOrder(preOrder *PreCreateOrderReq) (price float64, err er
|
||||
temp := resp.BaseRetVal.Result.(map[string]interface{})
|
||||
temp1 := temp["charge_price_list"].(map[string]interface{})
|
||||
return temp1["shop_pay_price"].(float64), nil
|
||||
//retVal := PreCreateOrderResp{}
|
||||
//s, _ := json.Marshal(resp.BaseRetVal.Result)
|
||||
//if err = json.Unmarshal(s, &retVal); err == nil {
|
||||
// return retVal.ChargePriceList.ShopPayPrice, nil
|
||||
//} else {
|
||||
// return 0, err
|
||||
//}
|
||||
|
||||
}
|
||||
|
||||
// CreateOrder 创建订单(店铺)
|
||||
|
||||
@@ -65,7 +65,7 @@ func TestCreateOrder(t *testing.T) {
|
||||
DevId: AppID,
|
||||
ShopId: TestSFStoreID,
|
||||
ShopType: 1,
|
||||
ShopOrderId: "20240109",
|
||||
ShopOrderId: "20240110",
|
||||
OrderSequence: "测试",
|
||||
OrderSource: OrderSourceELM,
|
||||
OrderTime: 1694168441,
|
||||
@@ -135,7 +135,3 @@ func TestNew(t *testing.T) {
|
||||
fmt.Println(lng, lat)
|
||||
}
|
||||
}
|
||||
|
||||
func TestInterfaceConverse(t *testing.T) {
|
||||
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ func New(devId int, devKey string, config ...*platformapi.APIConfig) *API {
|
||||
}
|
||||
}
|
||||
|
||||
func (a *API) signParam(params []byte) (sig string) {
|
||||
func (a *API) SignParam(params []byte) (sig string) {
|
||||
sign := fmt.Sprintf("%s&%d&%s", string(params), a.devId, a.devKey)
|
||||
md2sign := md5.Sum([]byte(sign))
|
||||
return base64.StdEncoding.EncodeToString([]byte(fmt.Sprintf("%x", md2sign)))
|
||||
@@ -58,7 +58,7 @@ func (a *API) HttpPostJson(url string, data interface{}) *Response {
|
||||
return &result
|
||||
}
|
||||
//签名
|
||||
sign := a.signParam(b)
|
||||
sign := a.SignParam(b)
|
||||
|
||||
fullUrl := utils.GenerateGetURL(BaseURL, url, map[string]interface{}{"sign": sign})
|
||||
//fullUrl := utils.GenerateGetURL(BaseCatchUrl, url, map[string]interface{}{"sign": sign})
|
||||
|
||||
Reference in New Issue
Block a user