提交 91d815c7 authored 作者: zhanglibo's avatar zhanglibo

天猫匿名账号

上级 f54764ad
......@@ -3,7 +3,6 @@ package tm
import (
"context"
"encoding/json"
"github.com/gogf/gf/util/gconv"
)
type accountTm struct {
......@@ -12,11 +11,11 @@ type accountTm struct {
var Account = accountTm{}
//Regist 注册单个淘宝账号接口(同步)
func (s *accountTm) Regist(ctx context.Context, AppID interface{}) (res *CommonRes, err error) {
func (s *accountTm) Regist(ctx context.Context, UserId string) (res *CommonRes, err error) {
method := "RegistAnonymousTbAccount"
result, err := post(ctx, method, map[string]string{
"BizUid": server.BizUid,
"ThirdPartyUserId": gconv.String(AppID),
"ThirdPartyUserId": UserId,
})
_ = json.Unmarshal([]byte(result), &res)
return
......
......@@ -3,7 +3,6 @@ package tm
import (
"context"
"encoding/json"
"github.com/gogf/gf/util/gconv"
)
type deliverTm struct {
......@@ -33,7 +32,7 @@ type DeliverInfoRes struct {
}
//Info 物流查询接口
func (s *deliverTm) Info(ctx context.Context, AppID interface{}, LmOrderId string) (res *DeliverInfoRes, err error) {
func (s *deliverTm) Info(ctx context.Context, UserId, LmOrderId string) (res *DeliverInfoRes, err error) {
method := "queryLogistics"
......@@ -41,7 +40,7 @@ func (s *deliverTm) Info(ctx context.Context, AppID interface{}, LmOrderId strin
"BizUid": server.BizUid,
"LmOrderId": LmOrderId,
"AccountType": "ANONY",
"ThirdPartyUserId": gconv.String(AppID),
"ThirdPartyUserId": UserId,
}
result, err := post(ctx, method, request)
......
......@@ -73,7 +73,7 @@ func (s *orderTm) Before(ctx context.Context, addr OrderAddress, itemLists []Ord
}
type OrderCreateReq struct {
AppID interface{}
UserId string
ChannelOrder string
Address OrderAddress
ItemLists []OrderGoodsItem
......@@ -108,7 +108,7 @@ func (s *orderTm) Create(ctx context.Context, req OrderCreateReq) (res *OrderCre
request["BizUid"] = server.BizUid
request["OutTradeId"] = req.ChannelOrder
request["AccountType"] = typeAnony
request["ThirdPartyUserId"] = gconv.String(req.AppID)
request["ThirdPartyUserId"] = req.UserId
result, err := post(ctx, method, request)
_ = json.Unmarshal([]byte(result), &res)
......@@ -136,7 +136,7 @@ func (s *orderTm) Pay(ctx context.Context, req OrderPayReq) (res *OrderCreateRes
}
type OrderListReq struct {
AppID interface{}
UserId string
ChannelOrder string
LmOrderId string
LogisticsStatus string
......@@ -231,7 +231,7 @@ func (s *orderTm) List(ctx context.Context, req OrderListReq) (res *OrderListRes
"PageNumber": "1",
"PageSize": "20",
"AccountType": typeAnony,
"ThirdPartyUserId": gconv.String(req.AppID),
"ThirdPartyUserId": req.UserId,
}
result, err := post(ctx, method, request)
......@@ -240,7 +240,7 @@ func (s *orderTm) List(ctx context.Context, req OrderListReq) (res *OrderListRes
}
type OrderCancelReq struct {
AppID interface{}
UserId string
LmOrderId string
}
......@@ -252,7 +252,7 @@ func (s *orderTm) Cancel(ctx context.Context, req OrderCancelReq) (res *OrderLis
"BizUid": server.BizUid,
"LmOrderId": req.LmOrderId,
"AccountType": typeAnony,
"ThirdPartyUserId": gconv.String(req.AppID),
"ThirdPartyUserId": req.UserId,
})
_ = json.Unmarshal([]byte(result), &res)
return
......
......@@ -12,7 +12,7 @@ type refundTm struct {
var Refund = refundTm{}
type RefundSubmitReq struct {
AppID interface{}
UserId string
SubLmOrderId string //子订单号
DisputeId string //售后ID
CpCode string //物流编码
......@@ -29,7 +29,7 @@ func (s *refundTm) Submit(ctx context.Context, req RefundSubmitReq) (res *Common
"DisputeId": req.DisputeId,
"CpCode": req.CpCode,
"LogisticsNo": req.LogisticsNo,
"ThirdPartyUserId": gconv.String(req.AppID),
"ThirdPartyUserId": req.UserId,
"AccountType": typeAnony,
}
......@@ -39,14 +39,14 @@ func (s *refundTm) Submit(ctx context.Context, req RefundSubmitReq) (res *Common
}
//Cancel 取消退款申请接口
func (s *refundTm) Cancel(ctx context.Context, AppID uint, subLmOrderId, disputeId string) (res *CommonRes, err error) {
func (s *refundTm) Cancel(ctx context.Context, UserId, subLmOrderId, disputeId string) (res *CommonRes, err error) {
method := "cancelRefund"
request := map[string]string{
"BizUid": server.BizUid,
"SubLmOrderId": subLmOrderId,
"DisputeId": disputeId,
"ThirdPartyUserId": gconv.String(AppID),
"ThirdPartyUserId": UserId,
"AccountType": typeAnony,
}
......@@ -56,7 +56,7 @@ func (s *refundTm) Cancel(ctx context.Context, AppID uint, subLmOrderId, dispute
}
type RefundBeforeReq struct {
AppID interface{}
UserId string
ChannelOrder string
SubLmOrderId string
BizClaimType string
......@@ -93,7 +93,7 @@ func (s *refundTm) Before(ctx context.Context, req RefundBeforeReq) (res *Refund
"SubLmOrderId": req.SubLmOrderId,
"GoodsStatus": req.GoodsStatus,
"BizClaimType": req.BizClaimType,
"ThirdPartyUserId": gconv.String(req.AppID),
"ThirdPartyUserId": req.UserId,
"AccountType": typeAnony,
}
......@@ -103,7 +103,7 @@ func (s *refundTm) Before(ctx context.Context, req RefundBeforeReq) (res *Refund
}
type RefundApplyReq struct {
AppID interface{}
UserId string
SubLmOrderId string //子订单号
BizClaimType string //退款类型
ApplyRefundFee string //申请退款金额
......@@ -144,7 +144,7 @@ func (s *refundTm) Apply(ctx context.Context, req *RefundApplyReq) (res *RefundA
request["GoodsStatus"] = req.GoodsStatus
request["BizUid"] = server.BizUid
request["AccountType"] = typeAnony
request["ThirdPartyUserId"] = gconv.String(req.AppID)
request["ThirdPartyUserId"] = req.UserId
result, err := post(ctx, method, request)
_ = json.Unmarshal([]byte(result), &res)
......@@ -186,13 +186,13 @@ type RefundInfoRes struct {
}
//Info 详情
func (s *refundTm) Info(ctx context.Context, AppID uint, subLmOrderId string) (res *RefundInfoRes, err error) {
func (s *refundTm) Info(ctx context.Context, UserId, subLmOrderId string) (res *RefundInfoRes, err error) {
method := "queryRefundApplicationDetail"
request := map[string]string{
"BizUid": server.BizUid,
"SubLmOrderId": subLmOrderId,
"ThirdPartyUserId": gconv.String(AppID),
"ThirdPartyUserId": UserId,
"AccountType": typeAnony,
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论