This commit is contained in:
苏尹岚
2020-12-14 16:06:06 +08:00
parent 3ab59259c8
commit 8059e29291
4 changed files with 19 additions and 10 deletions

View File

@@ -7,6 +7,7 @@ import (
"net/http"
"sort"
"strings"
"time"
"git.rosy.net.cn/baseapi"
"git.rosy.net.cn/baseapi/platformapi"
@@ -128,6 +129,7 @@ type GetStationListResult struct {
//获取油站列表
func (a *API) GetStationList() (getStationListResult []*GetStationListResult, err error) {
a.SetTimestamp(time.Now().Unix())
params := make(map[string]interface{})
// params["platformName"] = a.platformName
sign := a.signParam(params)
@@ -167,6 +169,7 @@ type GetUserOrdersResult struct {
//获取用户个人订单
func (a *API) GetUserOrders(userPhone string, page int) (getUserOrdersResult *GetUserOrdersResult, err error) {
a.SetTimestamp(time.Now().Unix())
params := make(map[string]interface{})
params["stationIds"] = ""
params["page"] = page
@@ -188,10 +191,11 @@ type UserRefundResult struct {
//用户申请退款
func (a *API) UserRefund(orderId, userPhone, reason string) (userRefundResult *UserRefundResult, err error) {
a.SetTimestamp(time.Now().Unix())
params := make(map[string]interface{})
params["reason"] = reason
sign := a.signParam(params)
result, err := a.AccessAPI("oreo/ejiayou_open_api/platform/refund/v1/"+a.platformName+"/"+userPhone+"/"+orderId+"/"+sign+"/"+utils.Int64ToStr(a.timeStamp), TestUrl, params, false)
result, err := a.AccessAPI("oreo/ejiayou_open_api/platform/refund/v1/"+a.platformName+"/"+userPhone+"/"+orderId+"/"+sign+"/"+utils.Int64ToStr(a.timeStamp), Url, params, false)
if err == nil {
utils.Map2StructByJson(result["data"], &userRefundResult, false)
}