This commit is contained in:
邹宗楠
2023-12-27 15:12:29 +08:00
parent 937479fca3
commit d29c893341
3 changed files with 17 additions and 6 deletions

View File

@@ -24,21 +24,21 @@ func TestOrderGet(t *testing.T) {
func TestOrderAgreePartRefund(t *testing.T) { func TestOrderAgreePartRefund(t *testing.T) {
param := &RefundOrderExamine{ param := &RefundOrderExamine{
ReverseOrderId: "", ReverseOrderId: "",
OrderId: "4016410136010905219", OrderId: "4016410136052874965",
IdempotentId: utils.Int64ToStr(time.Now().UnixNano()), IdempotentId: utils.Int64ToStr(time.Now().UnixNano()),
ActionType: RefundTypeRefuse, ActionType: RefundTypeRefuse,
ReasonCode: "7001", ReasonCode: "7001",
ReasonRemarks: "1111", ReasonRemarks: "1111",
} }
refundProductList := make([]*RefundProductList, 0, 0) refundProductList := make([]*RefundProductList, 0, 0)
date, _, _ := api.GetReverseOrder("4016410136010905219") date, _, _ := api.GetReverseOrder("4016410136052874965")
for _, v := range date { for _, v := range date {
v2 := v.(map[string]interface{}) v2 := v.(map[string]interface{})
refundProduct := &RefundProductList{ refundProduct := &RefundProductList{
SubBizOrderId: v2["sub_biz_order_id"].(string), SubBizOrderId: v2["sub_biz_order_id"].(string),
PlatformSkuId: utils.Int64ToStr(utils.Interface2Int64WithDefault(v2["platform_sku_id"], 0)), PlatformSkuId: utils.Int64ToStr(utils.Interface2Int64WithDefault(v2["platform_sku_id"], 0)),
} }
param.ReverseOrderId = "2312256881892671641" //utils.Int64ToStr(utils.MustInterface2Int64(v2["refund_order_id"])) param.ReverseOrderId = utils.Int64ToStr(utils.MustInterface2Int64(v2["refund_order_id"]))
switch utils.MustInterface2Int64(v2["fund_calculate_type"]) { switch utils.MustInterface2Int64(v2["fund_calculate_type"]) {
case 0: case 0:
refundProduct.Number = utils.Int64ToStr(utils.MustInterface2Int64(v2["refund_quantity"])) refundProduct.Number = utils.Int64ToStr(utils.MustInterface2Int64(v2["refund_quantity"]))
@@ -154,7 +154,7 @@ func TestOrderSwitchselfdelivery(t *testing.T) {
} }
func TestOrderComplete(t *testing.T) { func TestOrderComplete(t *testing.T) {
err := api.OrderComplete("4087880039095667221", "") err := api.OrderComplete("4016410136237474551", "")
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }

View File

@@ -8,7 +8,7 @@ import (
) )
// 京西速食(蔬菜) // 京西速食(蔬菜)
var token1 = `{"access_token":"bbd3e475-2287-4498-9005-04efa541a24c","expires_in":1702502209,"scope":"SCOPE","shop_id":57939570,"shop_name":"京西菜市速食","refresh_token":"8dfa1c4a-153d-41a9-9fad-d9fcf2407cdf","authority_id":""}` var token1 = `{"access_token":"11dc639e-d430-4523-884f-49f25b054e02","expires_in":1703705195,"scope":"SCOPE","shop_id":57939570,"shop_name":"京西菜市速食","refresh_token":"c5e48d77-9ab7-446e-90be-0af7ee797f7f","authority_id":""}`
// 美好菜市 // 美好菜市
//var token1 = `{"access_token":"9a315a03-c737-4a82-ae52-c9a6ce827007","expires_in":1699490747,"scope":"SCOPE","shop_id":68032645,"shop_name":"美好菜市","refresh_token":"8334c006-5301-4d25-911b-4d8cc7b70ebb","authority_id":""}` //var token1 = `{"access_token":"9a315a03-c737-4a82-ae52-c9a6ce827007","expires_in":1699490747,"scope":"SCOPE","shop_id":68032645,"shop_name":"美好菜市","refresh_token":"8334c006-5301-4d25-911b-4d8cc7b70ebb","authority_id":""}`
@@ -19,7 +19,14 @@ var a = New("7267745202649957900", "51998fcf-d521-4553-8c0c-fa662c8dbd6e", token
// 查询售后单详情 // 查询售后单详情
func TestAfsOrder(t *testing.T) { func TestAfsOrder(t *testing.T) {
a.QueryAfsOrderDetail("6921428072500696298", true) data, err := a.QueryAfsOrderDetail("146223529123133957", false)
globals.SugarLogger.Debugf("data=%s", utils.Format4Output(data, false))
globals.SugarLogger.Debugf("data=%s", err)
}
func TestAfsOrder2(t *testing.T) {
data, err := a.QueryAfsOrderDetail("146223488418888073", false)
globals.SugarLogger.Debugf("data=%s", utils.Format4Output(data, false))
globals.SugarLogger.Debugf("data=%s", err)
} }
// 同意/拒绝售后单 // 同意/拒绝售后单

View File

@@ -3,6 +3,7 @@ package tiktok_api
import ( import (
"encoding/json" "encoding/json"
"errors" "errors"
"fmt"
brand_list_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/brand_list/request" brand_list_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/brand_list/request"
order_batchSensitive_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/order_batchSensitive/request" order_batchSensitive_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/order_batchSensitive/request"
product_GetRecommendCategory_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/product_GetRecommendCategory/request" product_GetRecommendCategory_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/product_GetRecommendCategory/request"
@@ -304,6 +305,9 @@ func (a *API) GetSkuDetail(productId, outProductId string) (*product_detail_resp
// GetSkuDetailLocalID 查询单个商品详情(这个只有京西平台商品id有效,查询到的商品可能为子商品也可能为主商品,主商品删除时,子商品和主商品状态不一致) // GetSkuDetailLocalID 查询单个商品详情(这个只有京西平台商品id有效,查询到的商品可能为子商品也可能为主商品,主商品删除时,子商品和主商品状态不一致)
func (a *API) GetSkuDetailLocalID(vendorStoreId, outProductId string) (*product_detail_response.ProductDetailData, error) { func (a *API) GetSkuDetailLocalID(vendorStoreId, outProductId string) (*product_detail_response.ProductDetailData, error) {
if vendorStoreId == "" && outProductId == "" {
return nil, fmt.Errorf("商品id和门店id不能为空")
}
request := product_detail_request_out.New() request := product_detail_request_out.New()
param := request.GetParams() param := request.GetParams()
param.OutProductId = outProductId param.OutProductId = outProductId