1
This commit is contained in:
@@ -49,13 +49,13 @@ func TestQueryUnansweredInvoice(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestBathUpdateInvoiceSetting(t *testing.T) {
|
||||
api.BathUpdateInvoiceSetting("1298742562", &StoreInvoiceSetting{
|
||||
api.BathUpdateInvoiceSetting("32267545379", &StoreInvoiceSetting{
|
||||
InvoiceMaterial: "ELECTRONIC",
|
||||
InvoiceClass: "VAT_COMMON",
|
||||
InvoiceContact: struct {
|
||||
Person string `json:"person"`
|
||||
Phone string `json:"phone"`
|
||||
}{Person: "老板", Phone: "15020067079"},
|
||||
}{Person: "老板", Phone: "13551100183"},
|
||||
InvoiceMode: "SYS_MANUAL",
|
||||
})
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ func init() {
|
||||
//api = New("4123", "df2c88338b85f830cebce2a9eab56628", "", "")
|
||||
|
||||
//商超
|
||||
//api = New("5873", "41c479790a76f86326f89e8048964739", "", "token_nld07Y5m8rEQZJMMrvZGmA")
|
||||
//api = New("5873", "41c479790a76f86326f89e8048964739", "", "token_iJ_KO9kgFiaodJguyydKxg")
|
||||
//cookieStr := `
|
||||
// acctId=57396785; token=0bWbK5VbK50E2BmIhIH2zHB-am_y7mB37yXHm6RLZWx4*; wmPoiId=-1;
|
||||
//`
|
||||
|
||||
@@ -455,13 +455,13 @@ func (a *API) RetailSkuDelete(trackInfo, poiCode, foodCode, skuID string) (err e
|
||||
return err
|
||||
}
|
||||
|
||||
//category/attr/list 根据末级类目id获取类目属性列表
|
||||
// CategoryAttrList 根据末级类目id获取类目属性列表
|
||||
//https://open-shangou.meituan.com/home/docDetail/386
|
||||
func (a *API) CategoryAttrList(tag_id int64) (categoryAttrListResult []*CategoryAttrListResult, err error) {
|
||||
func (a *API) CategoryAttrList(tagId int64) (categoryAttrListResult []*CategoryAttrListResult, err error) {
|
||||
result, err := a.AccessAPI("gw/category/attr/list", true, map[string]interface{}{
|
||||
"tag_id": tag_id,
|
||||
"tag_id": tagId,
|
||||
})
|
||||
if err == nil {
|
||||
if err == nil && result != nil {
|
||||
utils.Map2StructByJson(result.(map[string]interface{})["general_attrs"], &categoryAttrListResult, false)
|
||||
}
|
||||
return categoryAttrListResult, err
|
||||
|
||||
@@ -361,7 +361,7 @@ func TestRetailSellStatus2(t *testing.T) {
|
||||
//根据分类id查询属性列表
|
||||
func TestCategoryAttrList(t *testing.T) {
|
||||
//result, err := api.CategoryAttrList(200002680)
|
||||
result, err := api.CategoryAttrList(200001746)
|
||||
result, err := api.CategoryAttrList(400000717)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -394,7 +394,7 @@ func TestRetailRecommendTag(t *testing.T) {
|
||||
|
||||
// 删除商品
|
||||
func TestRetailDelete(t *testing.T) {
|
||||
poiCode := "16193110"
|
||||
poiCode := "29913311"
|
||||
|
||||
i := 0
|
||||
count := 0
|
||||
@@ -443,18 +443,18 @@ func TestRetailCatList(t *testing.T) {
|
||||
|
||||
// 测试删除门店分类列表
|
||||
func TestDeleteCat(t *testing.T) {
|
||||
result, err := api.RetailCatList("26589198")
|
||||
result, err := api.RetailCatList("29913311")
|
||||
fmt.Println(result, err)
|
||||
for _, v := range result {
|
||||
if v.Children != nil {
|
||||
for _, v2 := range v.Children {
|
||||
err = api.RetailCatDelete("26589198", "", v2.Name, 1)
|
||||
err = api.RetailCatDelete("29913311", "", v2.Name, 1)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
err = api.RetailCatDelete("26589198", "", v.Name, 1)
|
||||
err = api.RetailCatDelete("29913311", "", v.Name, 1)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
)
|
||||
|
||||
// 京西速食(蔬菜)
|
||||
var token1 = `{"access_token":"stma20r0pv1j7t4nq1hehos0000yhugi-11","expires_in":1754283109,"scope":"SCOPE","shop_id":57939570,"shop_name":"京西菜市","refresh_token":"b6xg6c61a71j7t4nq1hehos0000yhugi-12","authority_id":""}`
|
||||
var token1 = `{"access_token":"3bgefxbys11j7t4nq1hehos0000yhugi-11","expires_in":1759128050,"scope":"SCOPE","shop_id":57939570,"shop_name":"京西菜市","refresh_token":"33306ycgy51j7t4nq1hehos0000yhugi-12","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":""}`
|
||||
@@ -25,6 +25,10 @@ func TestAfsOrder(t *testing.T) {
|
||||
globals.SugarLogger.Debugf("data=%s", utils.Format4Output(data, false))
|
||||
globals.SugarLogger.Debugf("data=%s", err)
|
||||
}
|
||||
|
||||
func TestQueryAfsOrderList(t *testing.T) {
|
||||
a.QueryAfsOrderList("6921396434481348260")
|
||||
}
|
||||
func TestAfsOrder2(t *testing.T) {
|
||||
data, err := a.QueryAfsOrderDetail("146223488418888073", false)
|
||||
globals.SugarLogger.Debugf("data=%s", utils.Format4Output(data, false))
|
||||
|
||||
@@ -8,6 +8,8 @@ import (
|
||||
afterSale_applyMarketAfterSale_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/afterSale_ApplyMarketAfterSale/request"
|
||||
afterSale_Detail_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/afterSale_Detail/request"
|
||||
afterSale_Detail_response "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/afterSale_Detail/response"
|
||||
afterSale_List_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/afterSale_List/request"
|
||||
afterSale_List_response "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/afterSale_List/response"
|
||||
afterSale_buyerExchangeConfirm_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/afterSale_buyerExchangeConfirm/request"
|
||||
afterSale_operate_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/afterSale_operate/request"
|
||||
afterSale_rejectReasonCodeList_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/afterSale_rejectReasonCodeList/request"
|
||||
@@ -59,6 +61,26 @@ func (a *API) QueryAfsOrderDetail(afterSaleId string, needOperationRecord bool)
|
||||
return result, nil
|
||||
}
|
||||
|
||||
// QueryAfsOrderList 获取订单所有的售后详情
|
||||
// https://op.jinritemai.com/docs/api-docs/17/1295
|
||||
func (a *API) QueryAfsOrderList(vendorOrderId string) (*afterSale_List_response.AfterSaleListResponse, error) {
|
||||
request := afterSale_List_request.New()
|
||||
param := request.GetParams()
|
||||
param.OrderId = vendorOrderId
|
||||
param.Page = 1
|
||||
param.Size = 50
|
||||
param.StandardAftersaleStatus = []int64{12}
|
||||
|
||||
result, err := request.Execute(a.accessTokenObj)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if result.Code != RequestSuccessCode {
|
||||
return nil, errors.New(result.SubMsg + ":" + result.LogId)
|
||||
}
|
||||
return result, nil
|
||||
}
|
||||
|
||||
// ApplyMarketAfterSale 拣货时商户发现订单缺货或者缺重
|
||||
func (a *API) ApplyMarketAfterSale(skuOrderId, count int64, afterSaleReason int32) (afterSaleId string, err error) {
|
||||
request := afterSale_applyMarketAfterSale_request.New()
|
||||
|
||||
Reference in New Issue
Block a user