diff --git a/platformapi/jdshopapi/store_page.go b/platformapi/jdshopapi/store_page.go index f716e494..993299e8 100644 --- a/platformapi/jdshopapi/store_page.go +++ b/platformapi/jdshopapi/store_page.go @@ -502,15 +502,15 @@ type AllOrdersResult struct { //尝试扒订单 //https://porder.shop.jd.com/order/orderlist/allOrders func (a *API) AllOrders(allOrdersParam *AllOrdersParam) (allOrdersResult *AllOrdersResult, err error) { - result, err := a.AccessStorePage2("https://porder.shop.jd.com", map[string]interface{}{ - "current": allOrdersParam.Current, - "pageSize": allOrdersParam.PageSize, - "selectedTabName": "allOrders", - "sortName": "desc", - "orderCreateDateRange": allOrdersParam.OrderCreateDateRange, + result, err := a.AccessStorePage2("https://porder.shop.jd.com/order/orderlist", map[string]interface{}{ + "current": allOrdersParam.Current, + "pageSize": 10, //allOrdersParam.PageSize + "selectedTabName": "allOrders", + "sortName": "desc", + //"orderCreateDateRange": allOrdersParam.OrderCreateDateRange, // "storeId": allOrdersParam.StoreID, // "orderStatusArray": allOrdersParam.OrderStatusArray, - "orderId": allOrdersParam.OrderID, + //"orderId": allOrdersParam.OrderID, }, true) if err == nil { utils.Map2StructByJson(result, &allOrdersResult, false) diff --git a/platformapi/jdshopapi/store_page_test.go b/platformapi/jdshopapi/store_page_test.go index 3ebfed35..dc479d42 100644 --- a/platformapi/jdshopapi/store_page_test.go +++ b/platformapi/jdshopapi/store_page_test.go @@ -6,11 +6,14 @@ import ( "crypto/cipher" "encoding/base64" "fmt" + "git.rosy.net.cn/baseapi/platformapi" "git.rosy.net.cn/baseapi/utils" "golang.org/x/text/encoding/simplifiedchinese" "golang.org/x/text/transform" "io/ioutil" "math" + "net/http" + "reflect" "sort" "strconv" "testing" @@ -1055,3 +1058,3419 @@ func Hextob(str string) []byte { } return bHex } + +func TestAPI_AllOrders(t *testing.T) { + type fields struct { + APICookie platformapi.APICookie + accessToken string + appKey string + appSecret string + client *http.Client + config *platformapi.APIConfig + } + type args struct { + allOrdersParam *AllOrdersParam + } + tests := []struct { + name string + fields fields + args args + wantAllOrdersResult *AllOrdersResult + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + a := &API{ + APICookie: tt.fields.APICookie, + accessToken: tt.fields.accessToken, + appKey: tt.fields.appKey, + appSecret: tt.fields.appSecret, + client: tt.fields.client, + config: tt.fields.config, + } + gotAllOrdersResult, err := a.AllOrders(tt.args.allOrdersParam) + if (err != nil) != tt.wantErr { + t.Errorf("AllOrders() error = %v, wantErr %v", err, tt.wantErr) + return + } + if !reflect.DeepEqual(gotAllOrdersResult, tt.wantAllOrdersResult) { + t.Errorf("AllOrders() gotAllOrdersResult = %v, want %v", gotAllOrdersResult, tt.wantAllOrdersResult) + } + }) + } +} + +func TestAPI_AccessAPI(t *testing.T) { + type fields struct { + APICookie platformapi.APICookie + accessToken string + appKey string + appSecret string + client *http.Client + config *platformapi.APIConfig + } + type args struct { + action string + url string + bizParams map[string]interface{} + } + tests := []struct { + name string + fields fields + args args + wantRetVal map[string]interface{} + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + a := &API{ + APICookie: tt.fields.APICookie, + accessToken: tt.fields.accessToken, + appKey: tt.fields.appKey, + appSecret: tt.fields.appSecret, + client: tt.fields.client, + config: tt.fields.config, + } + gotRetVal, err := a.AccessAPI(tt.args.action, tt.args.url, tt.args.bizParams) + if (err != nil) != tt.wantErr { + t.Errorf("AccessAPI() error = %v, wantErr %v", err, tt.wantErr) + return + } + if !reflect.DeepEqual(gotRetVal, tt.wantRetVal) { + t.Errorf("AccessAPI() gotRetVal = %v, want %v", gotRetVal, tt.wantRetVal) + } + }) + } +} + +func TestAPI_AccessAPI2(t *testing.T) { + type fields struct { + APICookie platformapi.APICookie + accessToken string + appKey string + appSecret string + client *http.Client + config *platformapi.APIConfig + } + type args struct { + action string + pURL string + bizParams map[string]interface{} + } + tests := []struct { + name string + fields fields + args args + wantRetVal map[string]interface{} + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + a := &API{ + APICookie: tt.fields.APICookie, + accessToken: tt.fields.accessToken, + appKey: tt.fields.appKey, + appSecret: tt.fields.appSecret, + client: tt.fields.client, + config: tt.fields.config, + } + gotRetVal, err := a.AccessAPI2(tt.args.action, tt.args.pURL, tt.args.bizParams) + if (err != nil) != tt.wantErr { + t.Errorf("AccessAPI2() error = %v, wantErr %v", err, tt.wantErr) + return + } + if !reflect.DeepEqual(gotRetVal, tt.wantRetVal) { + t.Errorf("AccessAPI2() gotRetVal = %v, want %v", gotRetVal, tt.wantRetVal) + } + }) + } +} + +func TestAPI_AccessStorePage(t *testing.T) { + type fields struct { + APICookie platformapi.APICookie + accessToken string + appKey string + appSecret string + client *http.Client + config *platformapi.APIConfig + } + type args struct { + fullURL string + bizParams map[string]interface{} + isPost bool + } + tests := []struct { + name string + fields fields + args args + wantRetVal map[string]interface{} + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + a := &API{ + APICookie: tt.fields.APICookie, + accessToken: tt.fields.accessToken, + appKey: tt.fields.appKey, + appSecret: tt.fields.appSecret, + client: tt.fields.client, + config: tt.fields.config, + } + gotRetVal, err := a.AccessStorePage(tt.args.fullURL, tt.args.bizParams, tt.args.isPost) + if (err != nil) != tt.wantErr { + t.Errorf("AccessStorePage() error = %v, wantErr %v", err, tt.wantErr) + return + } + if !reflect.DeepEqual(gotRetVal, tt.wantRetVal) { + t.Errorf("AccessStorePage() gotRetVal = %v, want %v", gotRetVal, tt.wantRetVal) + } + }) + } +} + +func TestAPI_AccessStorePage2(t *testing.T) { + type fields struct { + APICookie platformapi.APICookie + accessToken string + appKey string + appSecret string + client *http.Client + config *platformapi.APIConfig + } + type args struct { + fullURL string + bizParams map[string]interface{} + isPost bool + } + tests := []struct { + name string + fields fields + args args + wantRetVal map[string]interface{} + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + a := &API{ + APICookie: tt.fields.APICookie, + accessToken: tt.fields.accessToken, + appKey: tt.fields.appKey, + appSecret: tt.fields.appSecret, + client: tt.fields.client, + config: tt.fields.config, + } + gotRetVal, err := a.AccessStorePage2(tt.args.fullURL, tt.args.bizParams, tt.args.isPost) + if (err != nil) != tt.wantErr { + t.Errorf("AccessStorePage2() error = %v, wantErr %v", err, tt.wantErr) + return + } + if !reflect.DeepEqual(gotRetVal, tt.wantRetVal) { + t.Errorf("AccessStorePage2() gotRetVal = %v, want %v", gotRetVal, tt.wantRetVal) + } + }) + } +} + +func TestAPI_AccessStorePage3(t *testing.T) { + type fields struct { + APICookie platformapi.APICookie + accessToken string + appKey string + appSecret string + client *http.Client + config *platformapi.APIConfig + } + type args struct { + data []byte + fileName string + } + tests := []struct { + name string + fields fields + args args + wantRetVal map[string]interface{} + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + a := &API{ + APICookie: tt.fields.APICookie, + accessToken: tt.fields.accessToken, + appKey: tt.fields.appKey, + appSecret: tt.fields.appSecret, + client: tt.fields.client, + config: tt.fields.config, + } + gotRetVal, err := a.AccessStorePage3(tt.args.data, tt.args.fileName) + if (err != nil) != tt.wantErr { + t.Errorf("AccessStorePage3() error = %v, wantErr %v", err, tt.wantErr) + return + } + if !reflect.DeepEqual(gotRetVal, tt.wantRetVal) { + t.Errorf("AccessStorePage3() gotRetVal = %v, want %v", gotRetVal, tt.wantRetVal) + } + }) + } +} + +func TestAPI_AccessStorePage4(t *testing.T) { + type fields struct { + APICookie platformapi.APICookie + accessToken string + appKey string + appSecret string + client *http.Client + config *platformapi.APIConfig + } + type args struct { + fullURL string + param string + isPost bool + } + tests := []struct { + name string + fields fields + args args + wantRetVal map[string]interface{} + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + a := &API{ + APICookie: tt.fields.APICookie, + accessToken: tt.fields.accessToken, + appKey: tt.fields.appKey, + appSecret: tt.fields.appSecret, + client: tt.fields.client, + config: tt.fields.config, + } + gotRetVal, err := a.AccessStorePage4(tt.args.fullURL, tt.args.param, tt.args.isPost) + if (err != nil) != tt.wantErr { + t.Errorf("AccessStorePage4() error = %v, wantErr %v", err, tt.wantErr) + return + } + if !reflect.DeepEqual(gotRetVal, tt.wantRetVal) { + t.Errorf("AccessStorePage4() gotRetVal = %v, want %v", gotRetVal, tt.wantRetVal) + } + }) + } +} + +func TestAPI_AllOrders1(t *testing.T) { + type fields struct { + APICookie platformapi.APICookie + accessToken string + appKey string + appSecret string + client *http.Client + config *platformapi.APIConfig + } + type args struct { + allOrdersParam *AllOrdersParam + } + tests := []struct { + name string + fields fields + args args + wantAllOrdersResult *AllOrdersResult + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + a := &API{ + APICookie: tt.fields.APICookie, + accessToken: tt.fields.accessToken, + appKey: tt.fields.appKey, + appSecret: tt.fields.appSecret, + client: tt.fields.client, + config: tt.fields.config, + } + gotAllOrdersResult, err := a.AllOrders(tt.args.allOrdersParam) + if (err != nil) != tt.wantErr { + t.Errorf("AllOrders() error = %v, wantErr %v", err, tt.wantErr) + return + } + if !reflect.DeepEqual(gotAllOrdersResult, tt.wantAllOrdersResult) { + t.Errorf("AllOrders() gotAllOrdersResult = %v, want %v", gotAllOrdersResult, tt.wantAllOrdersResult) + } + }) + } +} + +func TestAPI_CreateEntityStore(t *testing.T) { + type fields struct { + APICookie platformapi.APICookie + accessToken string + appKey string + appSecret string + client *http.Client + config *platformapi.APIConfig + } + type args struct { + createEntityStoreParam *CreateEntityStoreParam + } + tests := []struct { + name string + fields fields + args args + wantVendorStoreID string + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + a := &API{ + APICookie: tt.fields.APICookie, + accessToken: tt.fields.accessToken, + appKey: tt.fields.appKey, + appSecret: tt.fields.appSecret, + client: tt.fields.client, + config: tt.fields.config, + } + gotVendorStoreID, err := a.CreateEntityStore(tt.args.createEntityStoreParam) + if (err != nil) != tt.wantErr { + t.Errorf("CreateEntityStore() error = %v, wantErr %v", err, tt.wantErr) + return + } + if gotVendorStoreID != tt.wantVendorStoreID { + t.Errorf("CreateEntityStore() gotVendorStoreID = %v, want %v", gotVendorStoreID, tt.wantVendorStoreID) + } + }) + } +} + +func TestAPI_CreateGisFence(t *testing.T) { + type fields struct { + APICookie platformapi.APICookie + accessToken string + appKey string + appSecret string + client *http.Client + config *platformapi.APIConfig + } + type args struct { + storeID int + kilometres string + } + tests := []struct { + name string + fields fields + args args + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + a := &API{ + APICookie: tt.fields.APICookie, + accessToken: tt.fields.accessToken, + appKey: tt.fields.appKey, + appSecret: tt.fields.appSecret, + client: tt.fields.client, + config: tt.fields.config, + } + if err := a.CreateGisFence(tt.args.storeID, tt.args.kilometres); (err != nil) != tt.wantErr { + t.Errorf("CreateGisFence() error = %v, wantErr %v", err, tt.wantErr) + } + }) + } +} + +func TestAPI_CreateShopCategory(t *testing.T) { + type fields struct { + APICookie platformapi.APICookie + accessToken string + appKey string + appSecret string + client *http.Client + config *platformapi.APIConfig + } + type args struct { + createShopCategoryParam []*CreateShopCategoryParam + } + tests := []struct { + name string + fields fields + args args + wantStatus int64 + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + a := &API{ + APICookie: tt.fields.APICookie, + accessToken: tt.fields.accessToken, + appKey: tt.fields.appKey, + appSecret: tt.fields.appSecret, + client: tt.fields.client, + config: tt.fields.config, + } + gotStatus, err := a.CreateShopCategory(tt.args.createShopCategoryParam) + if (err != nil) != tt.wantErr { + t.Errorf("CreateShopCategory() error = %v, wantErr %v", err, tt.wantErr) + return + } + if gotStatus != tt.wantStatus { + t.Errorf("CreateShopCategory() gotStatus = %v, want %v", gotStatus, tt.wantStatus) + } + }) + } +} + +func TestAPI_CreateWare(t *testing.T) { + type fields struct { + APICookie platformapi.APICookie + accessToken string + appKey string + appSecret string + client *http.Client + config *platformapi.APIConfig + } + type args struct { + createSkuParamWare *CreateSkuParamWare + createSkuParamSkus []*CreateSkuParamSkus + } + tests := []struct { + name string + fields fields + args args + wantCreateSkuResult *CreateSkuResult + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + a := &API{ + APICookie: tt.fields.APICookie, + accessToken: tt.fields.accessToken, + appKey: tt.fields.appKey, + appSecret: tt.fields.appSecret, + client: tt.fields.client, + config: tt.fields.config, + } + gotCreateSkuResult, err := a.CreateWare(tt.args.createSkuParamWare, tt.args.createSkuParamSkus) + if (err != nil) != tt.wantErr { + t.Errorf("CreateWare() error = %v, wantErr %v", err, tt.wantErr) + return + } + if !reflect.DeepEqual(gotCreateSkuResult, tt.wantCreateSkuResult) { + t.Errorf("CreateWare() gotCreateSkuResult = %v, want %v", gotCreateSkuResult, tt.wantCreateSkuResult) + } + }) + } +} + +func TestAPI_DeleteShopCategory(t *testing.T) { + type fields struct { + APICookie platformapi.APICookie + accessToken string + appKey string + appSecret string + client *http.Client + config *platformapi.APIConfig + } + type args struct { + cid int64 + } + tests := []struct { + name string + fields fields + args args + wantUniteResp *UniteResp + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + a := &API{ + APICookie: tt.fields.APICookie, + accessToken: tt.fields.accessToken, + appKey: tt.fields.appKey, + appSecret: tt.fields.appSecret, + client: tt.fields.client, + config: tt.fields.config, + } + gotUniteResp, err := a.DeleteShopCategory(tt.args.cid) + if (err != nil) != tt.wantErr { + t.Errorf("DeleteShopCategory() error = %v, wantErr %v", err, tt.wantErr) + return + } + if !reflect.DeepEqual(gotUniteResp, tt.wantUniteResp) { + t.Errorf("DeleteShopCategory() gotUniteResp = %v, want %v", gotUniteResp, tt.wantUniteResp) + } + }) + } +} + +func TestAPI_DeleteSku(t *testing.T) { + type fields struct { + APICookie platformapi.APICookie + accessToken string + appKey string + appSecret string + client *http.Client + config *platformapi.APIConfig + } + type args struct { + skuId int64 + } + tests := []struct { + name string + fields fields + args args + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + a := &API{ + APICookie: tt.fields.APICookie, + accessToken: tt.fields.accessToken, + appKey: tt.fields.appKey, + appSecret: tt.fields.appSecret, + client: tt.fields.client, + config: tt.fields.config, + } + if err := a.DeleteSku(tt.args.skuId); (err != nil) != tt.wantErr { + t.Errorf("DeleteSku() error = %v, wantErr %v", err, tt.wantErr) + } + }) + } +} + +func TestAPI_DeleteStoresByID(t *testing.T) { + type fields struct { + APICookie platformapi.APICookie + accessToken string + appKey string + appSecret string + client *http.Client + config *platformapi.APIConfig + } + type args struct { + storeId int64 + } + tests := []struct { + name string + fields fields + args args + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + a := &API{ + APICookie: tt.fields.APICookie, + accessToken: tt.fields.accessToken, + appKey: tt.fields.appKey, + appSecret: tt.fields.appSecret, + client: tt.fields.client, + config: tt.fields.config, + } + if err := a.DeleteStoresByID(tt.args.storeId); (err != nil) != tt.wantErr { + t.Errorf("DeleteStoresByID() error = %v, wantErr %v", err, tt.wantErr) + } + }) + } +} + +func TestAPI_DeleteWare(t *testing.T) { + type fields struct { + APICookie platformapi.APICookie + accessToken string + appKey string + appSecret string + client *http.Client + config *platformapi.APIConfig + } + type args struct { + wareId int + } + tests := []struct { + name string + fields fields + args args + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + a := &API{ + APICookie: tt.fields.APICookie, + accessToken: tt.fields.accessToken, + appKey: tt.fields.appKey, + appSecret: tt.fields.appSecret, + client: tt.fields.client, + config: tt.fields.config, + } + if err := a.DeleteWare(tt.args.wareId); (err != nil) != tt.wantErr { + t.Errorf("DeleteWare() error = %v, wantErr %v", err, tt.wantErr) + } + }) + } +} + +func TestAPI_FindAttrs(t *testing.T) { + type fields struct { + APICookie platformapi.APICookie + accessToken string + appKey string + appSecret string + client *http.Client + config *platformapi.APIConfig + } + type args struct { + cid int + } + tests := []struct { + name string + fields fields + args args + wantFindAttrsResult []*FindAttrsResult + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + a := &API{ + APICookie: tt.fields.APICookie, + accessToken: tt.fields.accessToken, + appKey: tt.fields.appKey, + appSecret: tt.fields.appSecret, + client: tt.fields.client, + config: tt.fields.config, + } + gotFindAttrsResult, err := a.FindAttrs(tt.args.cid) + if (err != nil) != tt.wantErr { + t.Errorf("FindAttrs() error = %v, wantErr %v", err, tt.wantErr) + return + } + if !reflect.DeepEqual(gotFindAttrsResult, tt.wantFindAttrsResult) { + t.Errorf("FindAttrs() gotFindAttrsResult = %v, want %v", gotFindAttrsResult, tt.wantFindAttrsResult) + } + }) + } +} + +func TestAPI_FindOpReason(t *testing.T) { + type fields struct { + APICookie platformapi.APICookie + accessToken string + appKey string + appSecret string + client *http.Client + config *platformapi.APIConfig + } + type args struct { + wareId int64 + } + tests := []struct { + name string + fields fields + args args + wantReason string + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + a := &API{ + APICookie: tt.fields.APICookie, + accessToken: tt.fields.accessToken, + appKey: tt.fields.appKey, + appSecret: tt.fields.appSecret, + client: tt.fields.client, + config: tt.fields.config, + } + gotReason, err := a.FindOpReason(tt.args.wareId) + if (err != nil) != tt.wantErr { + t.Errorf("FindOpReason() error = %v, wantErr %v", err, tt.wantErr) + return + } + if gotReason != tt.wantReason { + t.Errorf("FindOpReason() gotReason = %v, want %v", gotReason, tt.wantReason) + } + }) + } +} + +func TestAPI_FindShopCategories(t *testing.T) { + type fields struct { + APICookie platformapi.APICookie + accessToken string + appKey string + appSecret string + client *http.Client + config *platformapi.APIConfig + } + tests := []struct { + name string + fields fields + wantFindShopCategoriesResult []*FindShopCategoriesResult + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + a := &API{ + APICookie: tt.fields.APICookie, + accessToken: tt.fields.accessToken, + appKey: tt.fields.appKey, + appSecret: tt.fields.appSecret, + client: tt.fields.client, + config: tt.fields.config, + } + gotFindShopCategoriesResult, err := a.FindShopCategories() + if (err != nil) != tt.wantErr { + t.Errorf("FindShopCategories() error = %v, wantErr %v", err, tt.wantErr) + return + } + if !reflect.DeepEqual(gotFindShopCategoriesResult, tt.wantFindShopCategoriesResult) { + t.Errorf("FindShopCategories() gotFindShopCategoriesResult = %v, want %v", gotFindShopCategoriesResult, tt.wantFindShopCategoriesResult) + } + }) + } +} + +func TestAPI_FindSkuById(t *testing.T) { + type fields struct { + APICookie platformapi.APICookie + accessToken string + appKey string + appSecret string + client *http.Client + config *platformapi.APIConfig + } + type args struct { + skuId int64 + } + tests := []struct { + name string + fields fields + args args + wantFindSkuByIdParam *FindSkuByIdParam + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + a := &API{ + APICookie: tt.fields.APICookie, + accessToken: tt.fields.accessToken, + appKey: tt.fields.appKey, + appSecret: tt.fields.appSecret, + client: tt.fields.client, + config: tt.fields.config, + } + gotFindSkuByIdParam, err := a.FindSkuById(tt.args.skuId) + if (err != nil) != tt.wantErr { + t.Errorf("FindSkuById() error = %v, wantErr %v", err, tt.wantErr) + return + } + if !reflect.DeepEqual(gotFindSkuByIdParam, tt.wantFindSkuByIdParam) { + t.Errorf("FindSkuById() gotFindSkuByIdParam = %v, want %v", gotFindSkuByIdParam, tt.wantFindSkuByIdParam) + } + }) + } +} + +func TestAPI_FindSkuSiteStock(t *testing.T) { + type fields struct { + APICookie platformapi.APICookie + accessToken string + appKey string + appSecret string + client *http.Client + config *platformapi.APIConfig + } + type args struct { + siteId int + skuId int64 + } + tests := []struct { + name string + fields fields + args args + wantFindSkuSiteStockResult *FindSkuSiteStockResult + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + a := &API{ + APICookie: tt.fields.APICookie, + accessToken: tt.fields.accessToken, + appKey: tt.fields.appKey, + appSecret: tt.fields.appSecret, + client: tt.fields.client, + config: tt.fields.config, + } + gotFindSkuSiteStockResult, err := a.FindSkuSiteStock(tt.args.siteId, tt.args.skuId) + if (err != nil) != tt.wantErr { + t.Errorf("FindSkuSiteStock() error = %v, wantErr %v", err, tt.wantErr) + return + } + if !reflect.DeepEqual(gotFindSkuSiteStockResult, tt.wantFindSkuSiteStockResult) { + t.Errorf("FindSkuSiteStock() gotFindSkuSiteStockResult = %v, want %v", gotFindSkuSiteStockResult, tt.wantFindSkuSiteStockResult) + } + }) + } +} + +func TestAPI_FindSkuStock(t *testing.T) { + type fields struct { + APICookie platformapi.APICookie + accessToken string + appKey string + appSecret string + client *http.Client + config *platformapi.APIConfig + } + type args struct { + skuId int64 + } + tests := []struct { + name string + fields fields + args args + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + a := &API{ + APICookie: tt.fields.APICookie, + accessToken: tt.fields.accessToken, + appKey: tt.fields.appKey, + appSecret: tt.fields.appSecret, + client: tt.fields.client, + config: tt.fields.config, + } + if err := a.FindSkuStock(tt.args.skuId); (err != nil) != tt.wantErr { + t.Errorf("FindSkuStock() error = %v, wantErr %v", err, tt.wantErr) + } + }) + } +} + +func TestAPI_FindStoreInfoByExtStoreId(t *testing.T) { + type fields struct { + APICookie platformapi.APICookie + accessToken string + appKey string + appSecret string + client *http.Client + config *platformapi.APIConfig + } + type args struct { + storeID int + } + tests := []struct { + name string + fields fields + args args + wantQueryEntityStoreResult *QueryEntityStoreResult + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + a := &API{ + APICookie: tt.fields.APICookie, + accessToken: tt.fields.accessToken, + appKey: tt.fields.appKey, + appSecret: tt.fields.appSecret, + client: tt.fields.client, + config: tt.fields.config, + } + gotQueryEntityStoreResult, err := a.FindStoreInfoByExtStoreId(tt.args.storeID) + if (err != nil) != tt.wantErr { + t.Errorf("FindStoreInfoByExtStoreId() error = %v, wantErr %v", err, tt.wantErr) + return + } + if !reflect.DeepEqual(gotQueryEntityStoreResult, tt.wantQueryEntityStoreResult) { + t.Errorf("FindStoreInfoByExtStoreId() gotQueryEntityStoreResult = %v, want %v", gotQueryEntityStoreResult, tt.wantQueryEntityStoreResult) + } + }) + } +} + +func TestAPI_FindValuesByAttrId(t *testing.T) { + type fields struct { + APICookie platformapi.APICookie + accessToken string + appKey string + appSecret string + client *http.Client + config *platformapi.APIConfig + } + type args struct { + categoryAttrId int + } + tests := []struct { + name string + fields fields + args args + wantFindValuesByAttrIdResult []*FindValuesByAttrIdResult + wantMaxOrder int + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + a := &API{ + APICookie: tt.fields.APICookie, + accessToken: tt.fields.accessToken, + appKey: tt.fields.appKey, + appSecret: tt.fields.appSecret, + client: tt.fields.client, + config: tt.fields.config, + } + gotFindValuesByAttrIdResult, gotMaxOrder, err := a.FindValuesByAttrId(tt.args.categoryAttrId) + if (err != nil) != tt.wantErr { + t.Errorf("FindValuesByAttrId() error = %v, wantErr %v", err, tt.wantErr) + return + } + if !reflect.DeepEqual(gotFindValuesByAttrIdResult, tt.wantFindValuesByAttrIdResult) { + t.Errorf("FindValuesByAttrId() gotFindValuesByAttrIdResult = %v, want %v", gotFindValuesByAttrIdResult, tt.wantFindValuesByAttrIdResult) + } + if gotMaxOrder != tt.wantMaxOrder { + t.Errorf("FindValuesByAttrId() gotMaxOrder = %v, want %v", gotMaxOrder, tt.wantMaxOrder) + } + }) + } +} + +func TestAPI_FindVendorCategories(t *testing.T) { + type fields struct { + APICookie platformapi.APICookie + accessToken string + appKey string + appSecret string + client *http.Client + config *platformapi.APIConfig + } + tests := []struct { + name string + fields fields + wantFindVendorCategoriesResult []*FindVendorCategoriesResult + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + a := &API{ + APICookie: tt.fields.APICookie, + accessToken: tt.fields.accessToken, + appKey: tt.fields.appKey, + appSecret: tt.fields.appSecret, + client: tt.fields.client, + config: tt.fields.config, + } + gotFindVendorCategoriesResult, err := a.FindVendorCategories() + if (err != nil) != tt.wantErr { + t.Errorf("FindVendorCategories() error = %v, wantErr %v", err, tt.wantErr) + return + } + if !reflect.DeepEqual(gotFindVendorCategoriesResult, tt.wantFindVendorCategoriesResult) { + t.Errorf("FindVendorCategories() gotFindVendorCategoriesResult = %v, want %v", gotFindVendorCategoriesResult, tt.wantFindVendorCategoriesResult) + } + }) + } +} + +func TestAPI_FindWareById(t *testing.T) { + type fields struct { + APICookie platformapi.APICookie + accessToken string + appKey string + appSecret string + client *http.Client + config *platformapi.APIConfig + } + type args struct { + wareId int64 + } + tests := []struct { + name string + fields fields + args args + wantFindWareByIdResult *FindWareByIdResult + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + a := &API{ + APICookie: tt.fields.APICookie, + accessToken: tt.fields.accessToken, + appKey: tt.fields.appKey, + appSecret: tt.fields.appSecret, + client: tt.fields.client, + config: tt.fields.config, + } + gotFindWareByIdResult, err := a.FindWareById(tt.args.wareId) + if (err != nil) != tt.wantErr { + t.Errorf("FindWareById() error = %v, wantErr %v", err, tt.wantErr) + return + } + if !reflect.DeepEqual(gotFindWareByIdResult, tt.wantFindWareByIdResult) { + t.Errorf("FindWareById() gotFindWareByIdResult = %v, want %v", gotFindWareByIdResult, tt.wantFindWareByIdResult) + } + }) + } +} + +func TestAPI_GetAttrsByCategoryId(t *testing.T) { + type fields struct { + APICookie platformapi.APICookie + accessToken string + appKey string + appSecret string + client *http.Client + config *platformapi.APIConfig + } + type args struct { + currPage int + pageSize int + } + tests := []struct { + name string + fields fields + args args + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + a := &API{ + APICookie: tt.fields.APICookie, + accessToken: tt.fields.accessToken, + appKey: tt.fields.appKey, + appSecret: tt.fields.appSecret, + client: tt.fields.client, + config: tt.fields.config, + } + if err := a.GetAttrsByCategoryId(tt.args.currPage, tt.args.pageSize); (err != nil) != tt.wantErr { + t.Errorf("GetAttrsByCategoryId() error = %v, wantErr %v", err, tt.wantErr) + } + }) + } +} + +func TestAPI_GetCallbackMsg(t *testing.T) { + type fields struct { + APICookie platformapi.APICookie + accessToken string + appKey string + appSecret string + client *http.Client + config *platformapi.APIConfig + } + type args struct { + request *http.Request + } + tests := []struct { + name string + fields fields + args args + wantCall *CallBackResult + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + a := &API{ + APICookie: tt.fields.APICookie, + accessToken: tt.fields.accessToken, + appKey: tt.fields.appKey, + appSecret: tt.fields.appSecret, + client: tt.fields.client, + config: tt.fields.config, + } + gotCall, err := a.GetCallbackMsg(tt.args.request) + if (err != nil) != tt.wantErr { + t.Errorf("GetCallbackMsg() error = %v, wantErr %v", err, tt.wantErr) + return + } + if !reflect.DeepEqual(gotCall, tt.wantCall) { + t.Errorf("GetCallbackMsg() gotCall = %v, want %v", gotCall, tt.wantCall) + } + }) + } +} + +func TestAPI_GetCity(t *testing.T) { + type fields struct { + APICookie platformapi.APICookie + accessToken string + appKey string + appSecret string + client *http.Client + config *platformapi.APIConfig + } + type args struct { + parentID int + } + tests := []struct { + name string + fields fields + args args + wantGetAddressCodeResult []*GetAddressCodeResult + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + a := &API{ + APICookie: tt.fields.APICookie, + accessToken: tt.fields.accessToken, + appKey: tt.fields.appKey, + appSecret: tt.fields.appSecret, + client: tt.fields.client, + config: tt.fields.config, + } + gotGetAddressCodeResult, err := a.GetCity(tt.args.parentID) + if (err != nil) != tt.wantErr { + t.Errorf("GetCity() error = %v, wantErr %v", err, tt.wantErr) + return + } + if !reflect.DeepEqual(gotGetAddressCodeResult, tt.wantGetAddressCodeResult) { + t.Errorf("GetCity() gotGetAddressCodeResult = %v, want %v", gotGetAddressCodeResult, tt.wantGetAddressCodeResult) + } + }) + } +} + +func TestAPI_GetCounty(t *testing.T) { + type fields struct { + APICookie platformapi.APICookie + accessToken string + appKey string + appSecret string + client *http.Client + config *platformapi.APIConfig + } + type args struct { + parentID int + } + tests := []struct { + name string + fields fields + args args + wantGetAddressCodeResult []*GetAddressCodeResult + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + a := &API{ + APICookie: tt.fields.APICookie, + accessToken: tt.fields.accessToken, + appKey: tt.fields.appKey, + appSecret: tt.fields.appSecret, + client: tt.fields.client, + config: tt.fields.config, + } + gotGetAddressCodeResult, err := a.GetCounty(tt.args.parentID) + if (err != nil) != tt.wantErr { + t.Errorf("GetCounty() error = %v, wantErr %v", err, tt.wantErr) + return + } + if !reflect.DeepEqual(gotGetAddressCodeResult, tt.wantGetAddressCodeResult) { + t.Errorf("GetCounty() gotGetAddressCodeResult = %v, want %v", gotGetAddressCodeResult, tt.wantGetAddressCodeResult) + } + }) + } +} + +func TestAPI_GetDeliveryCompany(t *testing.T) { + type fields struct { + APICookie platformapi.APICookie + accessToken string + appKey string + appSecret string + client *http.Client + config *platformapi.APIConfig + } + tests := []struct { + name string + fields fields + wantResult interface{} + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + a := &API{ + APICookie: tt.fields.APICookie, + accessToken: tt.fields.accessToken, + appKey: tt.fields.appKey, + appSecret: tt.fields.appSecret, + client: tt.fields.client, + config: tt.fields.config, + } + gotResult, err := a.GetDeliveryCompany() + if (err != nil) != tt.wantErr { + t.Errorf("GetDeliveryCompany() error = %v, wantErr %v", err, tt.wantErr) + return + } + if !reflect.DeepEqual(gotResult, tt.wantResult) { + t.Errorf("GetDeliveryCompany() gotResult = %v, want %v", gotResult, tt.wantResult) + } + }) + } +} + +func TestAPI_GetFeightMb(t *testing.T) { + type fields struct { + APICookie platformapi.APICookie + accessToken string + appKey string + appSecret string + client *http.Client + config *platformapi.APIConfig + } + tests := []struct { + name string + fields fields + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + a := &API{ + APICookie: tt.fields.APICookie, + accessToken: tt.fields.accessToken, + appKey: tt.fields.appKey, + appSecret: tt.fields.appSecret, + client: tt.fields.client, + config: tt.fields.config, + } + if err := a.GetFeightMb(); (err != nil) != tt.wantErr { + t.Errorf("GetFeightMb() error = %v, wantErr %v", err, tt.wantErr) + } + }) + } +} + +func TestAPI_GetOrder(t *testing.T) { + type fields struct { + APICookie platformapi.APICookie + accessToken string + appKey string + appSecret string + client *http.Client + config *platformapi.APIConfig + } + type args struct { + orderID int64 + isStatus bool + } + tests := []struct { + name string + fields fields + args args + wantGetOrderResult *GetOrderResult + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + a := &API{ + APICookie: tt.fields.APICookie, + accessToken: tt.fields.accessToken, + appKey: tt.fields.appKey, + appSecret: tt.fields.appSecret, + client: tt.fields.client, + config: tt.fields.config, + } + gotGetOrderResult, err := a.GetOrder(tt.args.orderID, tt.args.isStatus) + if (err != nil) != tt.wantErr { + t.Errorf("GetOrder() error = %v, wantErr %v", err, tt.wantErr) + return + } + if !reflect.DeepEqual(gotGetOrderResult, tt.wantGetOrderResult) { + t.Errorf("GetOrder() gotGetOrderResult = %v, want %v", gotGetOrderResult, tt.wantGetOrderResult) + } + }) + } +} + +func TestAPI_GetOrderExtInfoByOrderId(t *testing.T) { + type fields struct { + APICookie platformapi.APICookie + accessToken string + appKey string + appSecret string + client *http.Client + config *platformapi.APIConfig + } + type args struct { + orderId string + } + tests := []struct { + name string + fields fields + args args + wantTime string + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + a := &API{ + APICookie: tt.fields.APICookie, + accessToken: tt.fields.accessToken, + appKey: tt.fields.appKey, + appSecret: tt.fields.appSecret, + client: tt.fields.client, + config: tt.fields.config, + } + gotTime, err := a.GetOrderExtInfoByOrderId(tt.args.orderId) + if (err != nil) != tt.wantErr { + t.Errorf("GetOrderExtInfoByOrderId() error = %v, wantErr %v", err, tt.wantErr) + return + } + if gotTime != tt.wantTime { + t.Errorf("GetOrderExtInfoByOrderId() gotTime = %v, want %v", gotTime, tt.wantTime) + } + }) + } +} + +func TestAPI_GetProvince(t *testing.T) { + type fields struct { + APICookie platformapi.APICookie + accessToken string + appKey string + appSecret string + client *http.Client + config *platformapi.APIConfig + } + tests := []struct { + name string + fields fields + wantGetAddressCodeResult []*GetAddressCodeResult + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + a := &API{ + APICookie: tt.fields.APICookie, + accessToken: tt.fields.accessToken, + appKey: tt.fields.appKey, + appSecret: tt.fields.appSecret, + client: tt.fields.client, + config: tt.fields.config, + } + gotGetAddressCodeResult, err := a.GetProvince() + if (err != nil) != tt.wantErr { + t.Errorf("GetProvince() error = %v, wantErr %v", err, tt.wantErr) + return + } + if !reflect.DeepEqual(gotGetAddressCodeResult, tt.wantGetAddressCodeResult) { + t.Errorf("GetProvince() gotGetAddressCodeResult = %v, want %v", gotGetAddressCodeResult, tt.wantGetAddressCodeResult) + } + }) + } +} + +func TestAPI_ImageUpdate(t *testing.T) { + type fields struct { + APICookie platformapi.APICookie + accessToken string + appKey string + appSecret string + client *http.Client + config *platformapi.APIConfig + } + type args struct { + wareId int64 + imgIndex int + imgUrl string + } + tests := []struct { + name string + fields fields + args args + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + a := &API{ + APICookie: tt.fields.APICookie, + accessToken: tt.fields.accessToken, + appKey: tt.fields.appKey, + appSecret: tt.fields.appSecret, + client: tt.fields.client, + config: tt.fields.config, + } + if err := a.ImageUpdate(tt.args.wareId, tt.args.imgIndex, tt.args.imgUrl); (err != nil) != tt.wantErr { + t.Errorf("ImageUpdate() error = %v, wantErr %v", err, tt.wantErr) + } + }) + } +} + +func TestAPI_JdSSO(t *testing.T) { + type fields struct { + APICookie platformapi.APICookie + accessToken string + appKey string + appSecret string + client *http.Client + config *platformapi.APIConfig + } + tests := []struct { + name string + fields fields + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + a := &API{ + APICookie: tt.fields.APICookie, + accessToken: tt.fields.accessToken, + appKey: tt.fields.appKey, + appSecret: tt.fields.appSecret, + client: tt.fields.client, + config: tt.fields.config, + } + if err := a.JdSSO(); (err != nil) != tt.wantErr { + t.Errorf("JdSSO() error = %v, wantErr %v", err, tt.wantErr) + } + }) + } +} + +func TestAPI_KeyGet(t *testing.T) { + type fields struct { + APICookie platformapi.APICookie + accessToken string + appKey string + appSecret string + client *http.Client + config *platformapi.APIConfig + } + tests := []struct { + name string + fields fields + wantKeyGetResult *KeyGetResult + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + a := &API{ + APICookie: tt.fields.APICookie, + accessToken: tt.fields.accessToken, + appKey: tt.fields.appKey, + appSecret: tt.fields.appSecret, + client: tt.fields.client, + config: tt.fields.config, + } + gotKeyGetResult, err := a.KeyGet() + if (err != nil) != tt.wantErr { + t.Errorf("KeyGet() error = %v, wantErr %v", err, tt.wantErr) + return + } + if !reflect.DeepEqual(gotKeyGetResult, tt.wantKeyGetResult) { + t.Errorf("KeyGet() gotKeyGetResult = %v, want %v", gotKeyGetResult, tt.wantKeyGetResult) + } + }) + } +} + +func TestAPI_NewInfoList(t *testing.T) { + type fields struct { + APICookie platformapi.APICookie + accessToken string + appKey string + appSecret string + client *http.Client + config *platformapi.APIConfig + } + type args struct { + storeID int64 + } + tests := []struct { + name string + fields fields + args args + wantNewInfoListResult *NewInfoListResult + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + a := &API{ + APICookie: tt.fields.APICookie, + accessToken: tt.fields.accessToken, + appKey: tt.fields.appKey, + appSecret: tt.fields.appSecret, + client: tt.fields.client, + config: tt.fields.config, + } + gotNewInfoListResult, err := a.NewInfoList(tt.args.storeID) + if (err != nil) != tt.wantErr { + t.Errorf("NewInfoList() error = %v, wantErr %v", err, tt.wantErr) + return + } + if !reflect.DeepEqual(gotNewInfoListResult, tt.wantNewInfoListResult) { + t.Errorf("NewInfoList() gotNewInfoListResult = %v, want %v", gotNewInfoListResult, tt.wantNewInfoListResult) + } + }) + } +} + +func TestAPI_OrderDetail(t *testing.T) { + type fields struct { + APICookie platformapi.APICookie + accessToken string + appKey string + appSecret string + client *http.Client + config *platformapi.APIConfig + } + type args struct { + orderId string + } + tests := []struct { + name string + fields fields + args args + wantOrderDetailResult *OrderDetailResult + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + a := &API{ + APICookie: tt.fields.APICookie, + accessToken: tt.fields.accessToken, + appKey: tt.fields.appKey, + appSecret: tt.fields.appSecret, + client: tt.fields.client, + config: tt.fields.config, + } + gotOrderDetailResult, err := a.OrderDetail(tt.args.orderId) + if (err != nil) != tt.wantErr { + t.Errorf("OrderDetail() error = %v, wantErr %v", err, tt.wantErr) + return + } + if !reflect.DeepEqual(gotOrderDetailResult, tt.wantOrderDetailResult) { + t.Errorf("OrderDetail() gotOrderDetailResult = %v, want %v", gotOrderDetailResult, tt.wantOrderDetailResult) + } + }) + } +} + +func TestAPI_OrderShipment(t *testing.T) { + type fields struct { + APICookie platformapi.APICookie + accessToken string + appKey string + appSecret string + client *http.Client + config *platformapi.APIConfig + } + type args struct { + orderID int64 + logiCoprId string + logiNo string + } + tests := []struct { + name string + fields fields + args args + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + a := &API{ + APICookie: tt.fields.APICookie, + accessToken: tt.fields.accessToken, + appKey: tt.fields.appKey, + appSecret: tt.fields.appSecret, + client: tt.fields.client, + config: tt.fields.config, + } + if err := a.OrderShipment(tt.args.orderID, tt.args.logiCoprId, tt.args.logiNo); (err != nil) != tt.wantErr { + t.Errorf("OrderShipment() error = %v, wantErr %v", err, tt.wantErr) + } + }) + } +} + +func TestAPI_PhoneSensltiveInfo(t *testing.T) { + type fields struct { + APICookie platformapi.APICookie + accessToken string + appKey string + appSecret string + client *http.Client + config *platformapi.APIConfig + } + type args struct { + orderId string + accessKey string + } + tests := []struct { + name string + fields fields + args args + wantFakeMobile string + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + a := &API{ + APICookie: tt.fields.APICookie, + accessToken: tt.fields.accessToken, + appKey: tt.fields.appKey, + appSecret: tt.fields.appSecret, + client: tt.fields.client, + config: tt.fields.config, + } + gotFakeMobile, err := a.PhoneSensltiveInfo(tt.args.orderId, tt.args.accessKey) + if (err != nil) != tt.wantErr { + t.Errorf("PhoneSensltiveInfo() error = %v, wantErr %v", err, tt.wantErr) + return + } + if gotFakeMobile != tt.wantFakeMobile { + t.Errorf("PhoneSensltiveInfo() gotFakeMobile = %v, want %v", gotFakeMobile, tt.wantFakeMobile) + } + }) + } +} + +func TestAPI_QueryEntityStore(t *testing.T) { + type fields struct { + APICookie platformapi.APICookie + accessToken string + appKey string + appSecret string + client *http.Client + config *platformapi.APIConfig + } + type args struct { + storeId int64 + } + tests := []struct { + name string + fields fields + args args + wantQueryEntityStoreResult *QueryEntityStoreResult + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + a := &API{ + APICookie: tt.fields.APICookie, + accessToken: tt.fields.accessToken, + appKey: tt.fields.appKey, + appSecret: tt.fields.appSecret, + client: tt.fields.client, + config: tt.fields.config, + } + gotQueryEntityStoreResult, err := a.QueryEntityStore(tt.args.storeId) + if (err != nil) != tt.wantErr { + t.Errorf("QueryEntityStore() error = %v, wantErr %v", err, tt.wantErr) + return + } + if !reflect.DeepEqual(gotQueryEntityStoreResult, tt.wantQueryEntityStoreResult) { + t.Errorf("QueryEntityStore() gotQueryEntityStoreResult = %v, want %v", gotQueryEntityStoreResult, tt.wantQueryEntityStoreResult) + } + }) + } +} + +func TestAPI_QueryPicture(t *testing.T) { + type fields struct { + APICookie platformapi.APICookie + accessToken string + appKey string + appSecret string + client *http.Client + config *platformapi.APIConfig + } + type args struct { + pictureName string + } + tests := []struct { + name string + fields fields + args args + wantQueryPictureReuslt []*QueryPictureReuslt + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + a := &API{ + APICookie: tt.fields.APICookie, + accessToken: tt.fields.accessToken, + appKey: tt.fields.appKey, + appSecret: tt.fields.appSecret, + client: tt.fields.client, + config: tt.fields.config, + } + gotQueryPictureReuslt, err := a.QueryPicture(tt.args.pictureName) + if (err != nil) != tt.wantErr { + t.Errorf("QueryPicture() error = %v, wantErr %v", err, tt.wantErr) + return + } + if !reflect.DeepEqual(gotQueryPictureReuslt, tt.wantQueryPictureReuslt) { + t.Errorf("QueryPicture() gotQueryPictureReuslt = %v, want %v", gotQueryPictureReuslt, tt.wantQueryPictureReuslt) + } + }) + } +} + +func TestAPI_SaveVenderAttrValue(t *testing.T) { + type fields struct { + APICookie platformapi.APICookie + accessToken string + appKey string + appSecret string + client *http.Client + config *platformapi.APIConfig + } + type args struct { + attValue string + attributeId int + categoryId int + indexId int + } + tests := []struct { + name string + fields fields + args args + wantCategoryAttrId int64 + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + a := &API{ + APICookie: tt.fields.APICookie, + accessToken: tt.fields.accessToken, + appKey: tt.fields.appKey, + appSecret: tt.fields.appSecret, + client: tt.fields.client, + config: tt.fields.config, + } + gotCategoryAttrId, err := a.SaveVenderAttrValue(tt.args.attValue, tt.args.attributeId, tt.args.categoryId, tt.args.indexId) + if (err != nil) != tt.wantErr { + t.Errorf("SaveVenderAttrValue() error = %v, wantErr %v", err, tt.wantErr) + return + } + if gotCategoryAttrId != tt.wantCategoryAttrId { + t.Errorf("SaveVenderAttrValue() gotCategoryAttrId = %v, want %v", gotCategoryAttrId, tt.wantCategoryAttrId) + } + }) + } +} + +func TestAPI_SearchSkuList(t *testing.T) { + type fields struct { + APICookie platformapi.APICookie + accessToken string + appKey string + appSecret string + client *http.Client + config *platformapi.APIConfig + } + type args struct { + pageNo int + pageSize int + } + tests := []struct { + name string + fields fields + args args + wantList []*SearchSkuListResult + wantTotalCount int + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + a := &API{ + APICookie: tt.fields.APICookie, + accessToken: tt.fields.accessToken, + appKey: tt.fields.appKey, + appSecret: tt.fields.appSecret, + client: tt.fields.client, + config: tt.fields.config, + } + gotList, gotTotalCount, err := a.SearchSkuList(tt.args.pageNo, tt.args.pageSize) + if (err != nil) != tt.wantErr { + t.Errorf("SearchSkuList() error = %v, wantErr %v", err, tt.wantErr) + return + } + if !reflect.DeepEqual(gotList, tt.wantList) { + t.Errorf("SearchSkuList() gotList = %v, want %v", gotList, tt.wantList) + } + if gotTotalCount != tt.wantTotalCount { + t.Errorf("SearchSkuList() gotTotalCount = %v, want %v", gotTotalCount, tt.wantTotalCount) + } + }) + } +} + +func TestAPI_SearchSkuList2(t *testing.T) { + type fields struct { + APICookie platformapi.APICookie + accessToken string + appKey string + appSecret string + client *http.Client + config *platformapi.APIConfig + } + type args struct { + wareIDs []int + } + tests := []struct { + name string + fields fields + args args + wantList []*SearchSkuListResult + wantTotalCount int + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + a := &API{ + APICookie: tt.fields.APICookie, + accessToken: tt.fields.accessToken, + appKey: tt.fields.appKey, + appSecret: tt.fields.appSecret, + client: tt.fields.client, + config: tt.fields.config, + } + gotList, gotTotalCount, err := a.SearchSkuList2(tt.args.wareIDs) + if (err != nil) != tt.wantErr { + t.Errorf("SearchSkuList2() error = %v, wantErr %v", err, tt.wantErr) + return + } + if !reflect.DeepEqual(gotList, tt.wantList) { + t.Errorf("SearchSkuList2() gotList = %v, want %v", gotList, tt.wantList) + } + if gotTotalCount != tt.wantTotalCount { + t.Errorf("SearchSkuList2() gotTotalCount = %v, want %v", gotTotalCount, tt.wantTotalCount) + } + }) + } +} + +func TestAPI_SearchWare4Valid(t *testing.T) { + type fields struct { + APICookie platformapi.APICookie + accessToken string + appKey string + appSecret string + client *http.Client + config *platformapi.APIConfig + } + type args struct { + searchKey string + pageNo int + pageSize int + } + tests := []struct { + name string + fields fields + args args + wantSearchWare4ValidResult *SearchWare4ValidResult + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + a := &API{ + APICookie: tt.fields.APICookie, + accessToken: tt.fields.accessToken, + appKey: tt.fields.appKey, + appSecret: tt.fields.appSecret, + client: tt.fields.client, + config: tt.fields.config, + } + gotSearchWare4ValidResult, err := a.SearchWare4Valid(tt.args.searchKey, tt.args.pageNo, tt.args.pageSize) + if (err != nil) != tt.wantErr { + t.Errorf("SearchWare4Valid() error = %v, wantErr %v", err, tt.wantErr) + return + } + if !reflect.DeepEqual(gotSearchWare4ValidResult, tt.wantSearchWare4ValidResult) { + t.Errorf("SearchWare4Valid() gotSearchWare4ValidResult = %v, want %v", gotSearchWare4ValidResult, tt.wantSearchWare4ValidResult) + } + }) + } +} + +func TestAPI_SetOrderStateToFinish(t *testing.T) { + type fields struct { + APICookie platformapi.APICookie + accessToken string + appKey string + appSecret string + client *http.Client + config *platformapi.APIConfig + } + type args struct { + orderId int64 + } + tests := []struct { + name string + fields fields + args args + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + a := &API{ + APICookie: tt.fields.APICookie, + accessToken: tt.fields.accessToken, + appKey: tt.fields.appKey, + appSecret: tt.fields.appSecret, + client: tt.fields.client, + config: tt.fields.config, + } + if err := a.SetOrderStateToFinish(tt.args.orderId); (err != nil) != tt.wantErr { + t.Errorf("SetOrderStateToFinish() error = %v, wantErr %v", err, tt.wantErr) + } + }) + } +} + +func TestAPI_SetOrderStateToWait(t *testing.T) { + type fields struct { + APICookie platformapi.APICookie + accessToken string + appKey string + appSecret string + client *http.Client + config *platformapi.APIConfig + } + type args struct { + orderId int64 + } + tests := []struct { + name string + fields fields + args args + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + a := &API{ + APICookie: tt.fields.APICookie, + accessToken: tt.fields.accessToken, + appKey: tt.fields.appKey, + appSecret: tt.fields.appSecret, + client: tt.fields.client, + config: tt.fields.config, + } + if err := a.SetOrderStateToWait(tt.args.orderId); (err != nil) != tt.wantErr { + t.Errorf("SetOrderStateToWait() error = %v, wantErr %v", err, tt.wantErr) + } + }) + } +} + +func TestAPI_ShopDetail(t *testing.T) { + type fields struct { + APICookie platformapi.APICookie + accessToken string + appKey string + appSecret string + client *http.Client + config *platformapi.APIConfig + } + type args struct { + storeID int + } + tests := []struct { + name string + fields fields + args args + wantShopDetailResult *ShopDetailResult + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + a := &API{ + APICookie: tt.fields.APICookie, + accessToken: tt.fields.accessToken, + appKey: tt.fields.appKey, + appSecret: tt.fields.appSecret, + client: tt.fields.client, + config: tt.fields.config, + } + gotShopDetailResult, err := a.ShopDetail(tt.args.storeID) + if (err != nil) != tt.wantErr { + t.Errorf("ShopDetail() error = %v, wantErr %v", err, tt.wantErr) + return + } + if !reflect.DeepEqual(gotShopDetailResult, tt.wantShopDetailResult) { + t.Errorf("ShopDetail() gotShopDetailResult = %v, want %v", gotShopDetailResult, tt.wantShopDetailResult) + } + }) + } +} + +func TestAPI_ShopList(t *testing.T) { + type fields struct { + APICookie platformapi.APICookie + accessToken string + appKey string + appSecret string + client *http.Client + config *platformapi.APIConfig + } + type args struct { + pageNum int + } + tests := []struct { + name string + fields fields + args args + wantShopDetailResult *ShopListResult + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + a := &API{ + APICookie: tt.fields.APICookie, + accessToken: tt.fields.accessToken, + appKey: tt.fields.appKey, + appSecret: tt.fields.appSecret, + client: tt.fields.client, + config: tt.fields.config, + } + gotShopDetailResult, err := a.ShopList(tt.args.pageNum) + if (err != nil) != tt.wantErr { + t.Errorf("ShopList() error = %v, wantErr %v", err, tt.wantErr) + return + } + if !reflect.DeepEqual(gotShopDetailResult, tt.wantShopDetailResult) { + t.Errorf("ShopList() gotShopDetailResult = %v, want %v", gotShopDetailResult, tt.wantShopDetailResult) + } + }) + } +} + +func TestAPI_StoreProductSearch(t *testing.T) { + type fields struct { + APICookie platformapi.APICookie + accessToken string + appKey string + appSecret string + client *http.Client + config *platformapi.APIConfig + } + type args struct { + pageNo int + pageSize int + vendorStoreIDs []string + } + tests := []struct { + name string + fields fields + args args + wantStoreProductSearchResult []*StoreProductSearchResult + wantTotalCount int + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + a := &API{ + APICookie: tt.fields.APICookie, + accessToken: tt.fields.accessToken, + appKey: tt.fields.appKey, + appSecret: tt.fields.appSecret, + client: tt.fields.client, + config: tt.fields.config, + } + gotStoreProductSearchResult, gotTotalCount, err := a.StoreProductSearch(tt.args.pageNo, tt.args.pageSize, tt.args.vendorStoreIDs) + if (err != nil) != tt.wantErr { + t.Errorf("StoreProductSearch() error = %v, wantErr %v", err, tt.wantErr) + return + } + if !reflect.DeepEqual(gotStoreProductSearchResult, tt.wantStoreProductSearchResult) { + t.Errorf("StoreProductSearch() gotStoreProductSearchResult = %v, want %v", gotStoreProductSearchResult, tt.wantStoreProductSearchResult) + } + if gotTotalCount != tt.wantTotalCount { + t.Errorf("StoreProductSearch() gotTotalCount = %v, want %v", gotTotalCount, tt.wantTotalCount) + } + }) + } +} + +func TestAPI_StoreSkuBindStore(t *testing.T) { + type fields struct { + APICookie platformapi.APICookie + accessToken string + appKey string + appSecret string + client *http.Client + config *platformapi.APIConfig + } + type args struct { + allStore bool + skuIds []string + vendorStoreIDs []string + } + tests := []struct { + name string + fields fields + args args + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + a := &API{ + APICookie: tt.fields.APICookie, + accessToken: tt.fields.accessToken, + appKey: tt.fields.appKey, + appSecret: tt.fields.appSecret, + client: tt.fields.client, + config: tt.fields.config, + } + if err := a.StoreSkuBindStore(tt.args.allStore, tt.args.skuIds, tt.args.vendorStoreIDs); (err != nil) != tt.wantErr { + t.Errorf("StoreSkuBindStore() error = %v, wantErr %v", err, tt.wantErr) + } + }) + } +} + +func TestAPI_StoreUpdatePrice(t *testing.T) { + type fields struct { + APICookie platformapi.APICookie + accessToken string + appKey string + appSecret string + client *http.Client + config *platformapi.APIConfig + } + type args struct { + price string + skuId int64 + vendorStoreID string + } + tests := []struct { + name string + fields fields + args args + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + a := &API{ + APICookie: tt.fields.APICookie, + accessToken: tt.fields.accessToken, + appKey: tt.fields.appKey, + appSecret: tt.fields.appSecret, + client: tt.fields.client, + config: tt.fields.config, + } + if err := a.StoreUpdatePrice(tt.args.price, tt.args.skuId, tt.args.vendorStoreID); (err != nil) != tt.wantErr { + t.Errorf("StoreUpdatePrice() error = %v, wantErr %v", err, tt.wantErr) + } + }) + } +} + +func TestAPI_StoreUpdateStock(t *testing.T) { + type fields struct { + APICookie platformapi.APICookie + accessToken string + appKey string + appSecret string + client *http.Client + config *platformapi.APIConfig + } + type args struct { + stockNum int + skuId int64 + vendorStoreID string + } + tests := []struct { + name string + fields fields + args args + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + a := &API{ + APICookie: tt.fields.APICookie, + accessToken: tt.fields.accessToken, + appKey: tt.fields.appKey, + appSecret: tt.fields.appSecret, + client: tt.fields.client, + config: tt.fields.config, + } + if err := a.StoreUpdateStock(tt.args.stockNum, tt.args.skuId, tt.args.vendorStoreID); (err != nil) != tt.wantErr { + t.Errorf("StoreUpdateStock() error = %v, wantErr %v", err, tt.wantErr) + } + }) + } +} + +func TestAPI_StoreWareDoUpdate(t *testing.T) { + type fields struct { + APICookie platformapi.APICookie + accessToken string + appKey string + appSecret string + client *http.Client + config *platformapi.APIConfig + } + type args struct { + status int + skuId int64 + vendorStoreID string + } + tests := []struct { + name string + fields fields + args args + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + a := &API{ + APICookie: tt.fields.APICookie, + accessToken: tt.fields.accessToken, + appKey: tt.fields.appKey, + appSecret: tt.fields.appSecret, + client: tt.fields.client, + config: tt.fields.config, + } + if err := a.StoreWareDoUpdate(tt.args.status, tt.args.skuId, tt.args.vendorStoreID); (err != nil) != tt.wantErr { + t.Errorf("StoreWareDoUpdate() error = %v, wantErr %v", err, tt.wantErr) + } + }) + } +} + +func TestAPI_SubmitBasic(t *testing.T) { + type fields struct { + APICookie platformapi.APICookie + accessToken string + appKey string + appSecret string + client *http.Client + config *platformapi.APIConfig + } + type args struct { + updateBasicParam *UpdateBasicParam + } + tests := []struct { + name string + fields fields + args args + wantVendorStoreID int64 + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + a := &API{ + APICookie: tt.fields.APICookie, + accessToken: tt.fields.accessToken, + appKey: tt.fields.appKey, + appSecret: tt.fields.appSecret, + client: tt.fields.client, + config: tt.fields.config, + } + gotVendorStoreID, err := a.SubmitBasic(tt.args.updateBasicParam) + if (err != nil) != tt.wantErr { + t.Errorf("SubmitBasic() error = %v, wantErr %v", err, tt.wantErr) + return + } + if gotVendorStoreID != tt.wantVendorStoreID { + t.Errorf("SubmitBasic() gotVendorStoreID = %v, want %v", gotVendorStoreID, tt.wantVendorStoreID) + } + }) + } +} + +func TestAPI_TransparentImageAdd(t *testing.T) { + type fields struct { + APICookie platformapi.APICookie + accessToken string + appKey string + appSecret string + client *http.Client + config *platformapi.APIConfig + } + type args struct { + wareId int64 + imageUrl string + } + tests := []struct { + name string + fields fields + args args + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + a := &API{ + APICookie: tt.fields.APICookie, + accessToken: tt.fields.accessToken, + appKey: tt.fields.appKey, + appSecret: tt.fields.appSecret, + client: tt.fields.client, + config: tt.fields.config, + } + if err := a.TransparentImageAdd(tt.args.wareId, tt.args.imageUrl); (err != nil) != tt.wantErr { + t.Errorf("TransparentImageAdd() error = %v, wantErr %v", err, tt.wantErr) + } + }) + } +} + +func TestAPI_TryGetCookie(t *testing.T) { + type fields struct { + APICookie platformapi.APICookie + accessToken string + appKey string + appSecret string + client *http.Client + config *platformapi.APIConfig + } + tests := []struct { + name string + fields fields + wantCookie string + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + a := &API{ + APICookie: tt.fields.APICookie, + accessToken: tt.fields.accessToken, + appKey: tt.fields.appKey, + appSecret: tt.fields.appSecret, + client: tt.fields.client, + config: tt.fields.config, + } + gotCookie, err := a.TryGetCookie() + if (err != nil) != tt.wantErr { + t.Errorf("TryGetCookie() error = %v, wantErr %v", err, tt.wantErr) + return + } + if gotCookie != tt.wantCookie { + t.Errorf("TryGetCookie() gotCookie = %v, want %v", gotCookie, tt.wantCookie) + } + }) + } +} + +func TestAPI_UpOrDown(t *testing.T) { + type fields struct { + APICookie platformapi.APICookie + accessToken string + appKey string + appSecret string + client *http.Client + config *platformapi.APIConfig + } + type args struct { + wareId int64 + opType int + } + tests := []struct { + name string + fields fields + args args + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + a := &API{ + APICookie: tt.fields.APICookie, + accessToken: tt.fields.accessToken, + appKey: tt.fields.appKey, + appSecret: tt.fields.appSecret, + client: tt.fields.client, + config: tt.fields.config, + } + if err := a.UpOrDown(tt.args.wareId, tt.args.opType); (err != nil) != tt.wantErr { + t.Errorf("UpOrDown() error = %v, wantErr %v", err, tt.wantErr) + } + }) + } +} + +func TestAPI_UpdateBasic(t *testing.T) { + type fields struct { + APICookie platformapi.APICookie + accessToken string + appKey string + appSecret string + client *http.Client + config *platformapi.APIConfig + } + type args struct { + updateBasicParam *UpdateBasicParam + } + tests := []struct { + name string + fields fields + args args + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + a := &API{ + APICookie: tt.fields.APICookie, + accessToken: tt.fields.accessToken, + appKey: tt.fields.appKey, + appSecret: tt.fields.appSecret, + client: tt.fields.client, + config: tt.fields.config, + } + if err := a.UpdateBasic(tt.args.updateBasicParam); (err != nil) != tt.wantErr { + t.Errorf("UpdateBasic() error = %v, wantErr %v", err, tt.wantErr) + } + }) + } +} + +func TestAPI_UpdateDeliveryPromise(t *testing.T) { + type fields struct { + APICookie platformapi.APICookie + accessToken string + appKey string + appSecret string + client *http.Client + config *platformapi.APIConfig + } + type args struct { + start string + end string + storeID int + } + tests := []struct { + name string + fields fields + args args + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + a := &API{ + APICookie: tt.fields.APICookie, + accessToken: tt.fields.accessToken, + appKey: tt.fields.appKey, + appSecret: tt.fields.appSecret, + client: tt.fields.client, + config: tt.fields.config, + } + if err := a.UpdateDeliveryPromise(tt.args.start, tt.args.end, tt.args.storeID); (err != nil) != tt.wantErr { + t.Errorf("UpdateDeliveryPromise() error = %v, wantErr %v", err, tt.wantErr) + } + }) + } +} + +func TestAPI_UpdateEntityStore(t *testing.T) { + type fields struct { + APICookie platformapi.APICookie + accessToken string + appKey string + appSecret string + client *http.Client + config *platformapi.APIConfig + } + type args struct { + updateEntityStoreParam *UpdateEntityStoreParam + } + tests := []struct { + name string + fields fields + args args + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + a := &API{ + APICookie: tt.fields.APICookie, + accessToken: tt.fields.accessToken, + appKey: tt.fields.appKey, + appSecret: tt.fields.appSecret, + client: tt.fields.client, + config: tt.fields.config, + } + if err := a.UpdateEntityStore(tt.args.updateEntityStoreParam); (err != nil) != tt.wantErr { + t.Errorf("UpdateEntityStore() error = %v, wantErr %v", err, tt.wantErr) + } + }) + } +} + +func TestAPI_UpdateExpand(t *testing.T) { + type fields struct { + APICookie platformapi.APICookie + accessToken string + appKey string + appSecret string + client *http.Client + config *platformapi.APIConfig + } + type args struct { + storeID int + } + tests := []struct { + name string + fields fields + args args + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + a := &API{ + APICookie: tt.fields.APICookie, + accessToken: tt.fields.accessToken, + appKey: tt.fields.appKey, + appSecret: tt.fields.appSecret, + client: tt.fields.client, + config: tt.fields.config, + } + if err := a.UpdateExpand(tt.args.storeID); (err != nil) != tt.wantErr { + t.Errorf("UpdateExpand() error = %v, wantErr %v", err, tt.wantErr) + } + }) + } +} + +func TestAPI_UpdateSkuJdPrice(t *testing.T) { + type fields struct { + APICookie platformapi.APICookie + accessToken string + appKey string + appSecret string + client *http.Client + config *platformapi.APIConfig + } + type args struct { + skuId int + jdPrice float64 + } + tests := []struct { + name string + fields fields + args args + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + a := &API{ + APICookie: tt.fields.APICookie, + accessToken: tt.fields.accessToken, + appKey: tt.fields.appKey, + appSecret: tt.fields.appSecret, + client: tt.fields.client, + config: tt.fields.config, + } + if err := a.UpdateSkuJdPrice(tt.args.skuId, tt.args.jdPrice); (err != nil) != tt.wantErr { + t.Errorf("UpdateSkuJdPrice() error = %v, wantErr %v", err, tt.wantErr) + } + }) + } +} + +func TestAPI_UpdateSkuSiteStock(t *testing.T) { + type fields struct { + APICookie platformapi.APICookie + accessToken string + appKey string + appSecret string + client *http.Client + config *platformapi.APIConfig + } + type args struct { + skuId int64 + stockNum int + siteId int + } + tests := []struct { + name string + fields fields + args args + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + a := &API{ + APICookie: tt.fields.APICookie, + accessToken: tt.fields.accessToken, + appKey: tt.fields.appKey, + appSecret: tt.fields.appSecret, + client: tt.fields.client, + config: tt.fields.config, + } + if err := a.UpdateSkuSiteStock(tt.args.skuId, tt.args.stockNum, tt.args.siteId); (err != nil) != tt.wantErr { + t.Errorf("UpdateSkuSiteStock() error = %v, wantErr %v", err, tt.wantErr) + } + }) + } +} + +func TestAPI_UpdateSkuStock(t *testing.T) { + type fields struct { + APICookie platformapi.APICookie + accessToken string + appKey string + appSecret string + client *http.Client + config *platformapi.APIConfig + } + type args struct { + skuId int + stockNum int + } + tests := []struct { + name string + fields fields + args args + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + a := &API{ + APICookie: tt.fields.APICookie, + accessToken: tt.fields.accessToken, + appKey: tt.fields.appKey, + appSecret: tt.fields.appSecret, + client: tt.fields.client, + config: tt.fields.config, + } + if err := a.UpdateSkuStock(tt.args.skuId, tt.args.stockNum); (err != nil) != tt.wantErr { + t.Errorf("UpdateSkuStock() error = %v, wantErr %v", err, tt.wantErr) + } + }) + } +} + +func TestAPI_UpdateSkus(t *testing.T) { + type fields struct { + APICookie platformapi.APICookie + accessToken string + appKey string + appSecret string + client *http.Client + config *platformapi.APIConfig + } + type args struct { + updateSkusParam *UpdateSkusParam + } + tests := []struct { + name string + fields fields + args args + wantVendorSkuID string + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + a := &API{ + APICookie: tt.fields.APICookie, + accessToken: tt.fields.accessToken, + appKey: tt.fields.appKey, + appSecret: tt.fields.appSecret, + client: tt.fields.client, + config: tt.fields.config, + } + gotVendorSkuID, err := a.UpdateSkus(tt.args.updateSkusParam) + if (err != nil) != tt.wantErr { + t.Errorf("UpdateSkus() error = %v, wantErr %v", err, tt.wantErr) + return + } + if gotVendorSkuID != tt.wantVendorSkuID { + t.Errorf("UpdateSkus() gotVendorSkuID = %v, want %v", gotVendorSkuID, tt.wantVendorSkuID) + } + }) + } +} + +func TestAPI_UpdateStatus(t *testing.T) { + type fields struct { + APICookie platformapi.APICookie + accessToken string + appKey string + appSecret string + client *http.Client + config *platformapi.APIConfig + } + type args struct { + storeID int + storeStatus int + } + tests := []struct { + name string + fields fields + args args + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + a := &API{ + APICookie: tt.fields.APICookie, + accessToken: tt.fields.accessToken, + appKey: tt.fields.appKey, + appSecret: tt.fields.appSecret, + client: tt.fields.client, + config: tt.fields.config, + } + if err := a.UpdateStatus(tt.args.storeID, tt.args.storeStatus); (err != nil) != tt.wantErr { + t.Errorf("UpdateStatus() error = %v, wantErr %v", err, tt.wantErr) + } + }) + } +} + +func TestAPI_UpdateStoreStatus(t *testing.T) { + type fields struct { + APICookie platformapi.APICookie + accessToken string + appKey string + appSecret string + client *http.Client + config *platformapi.APIConfig + } + type args struct { + storeID int + storeStatus int + } + tests := []struct { + name string + fields fields + args args + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + a := &API{ + APICookie: tt.fields.APICookie, + accessToken: tt.fields.accessToken, + appKey: tt.fields.appKey, + appSecret: tt.fields.appSecret, + client: tt.fields.client, + config: tt.fields.config, + } + if err := a.UpdateStoreStatus(tt.args.storeID, tt.args.storeStatus); (err != nil) != tt.wantErr { + t.Errorf("UpdateStoreStatus() error = %v, wantErr %v", err, tt.wantErr) + } + }) + } +} + +func TestAPI_UpdateStoreStatusAPI(t *testing.T) { + type fields struct { + APICookie platformapi.APICookie + accessToken string + appKey string + appSecret string + client *http.Client + config *platformapi.APIConfig + } + type args struct { + storeID int + status int + } + tests := []struct { + name string + fields fields + args args + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + a := &API{ + APICookie: tt.fields.APICookie, + accessToken: tt.fields.accessToken, + appKey: tt.fields.appKey, + appSecret: tt.fields.appSecret, + client: tt.fields.client, + config: tt.fields.config, + } + if err := a.UpdateStoreStatusAPI(tt.args.storeID, tt.args.status); (err != nil) != tt.wantErr { + t.Errorf("UpdateStoreStatusAPI() error = %v, wantErr %v", err, tt.wantErr) + } + }) + } +} + +func TestAPI_UpdateWare(t *testing.T) { + type fields struct { + APICookie platformapi.APICookie + accessToken string + appKey string + appSecret string + client *http.Client + config *platformapi.APIConfig + } + type args struct { + updateWareParam *UpdateWareParam + } + tests := []struct { + name string + fields fields + args args + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + a := &API{ + APICookie: tt.fields.APICookie, + accessToken: tt.fields.accessToken, + appKey: tt.fields.appKey, + appSecret: tt.fields.appSecret, + client: tt.fields.client, + config: tt.fields.config, + } + if err := a.UpdateWare(tt.args.updateWareParam); (err != nil) != tt.wantErr { + t.Errorf("UpdateWare() error = %v, wantErr %v", err, tt.wantErr) + } + }) + } +} + +func TestAPI_UpdateWareMarketPrice(t *testing.T) { + type fields struct { + APICookie platformapi.APICookie + accessToken string + appKey string + appSecret string + client *http.Client + config *platformapi.APIConfig + } + type args struct { + wareId int64 + marketPrice float64 + } + tests := []struct { + name string + fields fields + args args + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + a := &API{ + APICookie: tt.fields.APICookie, + accessToken: tt.fields.accessToken, + appKey: tt.fields.appKey, + appSecret: tt.fields.appSecret, + client: tt.fields.client, + config: tt.fields.config, + } + if err := a.UpdateWareMarketPrice(tt.args.wareId, tt.args.marketPrice); (err != nil) != tt.wantErr { + t.Errorf("UpdateWareMarketPrice() error = %v, wantErr %v", err, tt.wantErr) + } + }) + } +} + +func TestAPI_UpdateWareSaleAttrvalueAlias(t *testing.T) { + type fields struct { + APICookie platformapi.APICookie + accessToken string + appKey string + appSecret string + client *http.Client + config *platformapi.APIConfig + } + type args struct { + param *UpdateWareSaleAttrvalueAliasParam + } + tests := []struct { + name string + fields fields + args args + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + a := &API{ + APICookie: tt.fields.APICookie, + accessToken: tt.fields.accessToken, + appKey: tt.fields.appKey, + appSecret: tt.fields.appSecret, + client: tt.fields.client, + config: tt.fields.config, + } + if err := a.UpdateWareSaleAttrvalueAlias(tt.args.param); (err != nil) != tt.wantErr { + t.Errorf("UpdateWareSaleAttrvalueAlias() error = %v, wantErr %v", err, tt.wantErr) + } + }) + } +} + +func TestAPI_UpdateWaybill(t *testing.T) { + type fields struct { + APICookie platformapi.APICookie + accessToken string + appKey string + appSecret string + client *http.Client + config *platformapi.APIConfig + } + type args struct { + orderId string + logiId string + logiNo string + } + tests := []struct { + name string + fields fields + args args + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + a := &API{ + APICookie: tt.fields.APICookie, + accessToken: tt.fields.accessToken, + appKey: tt.fields.appKey, + appSecret: tt.fields.appSecret, + client: tt.fields.client, + config: tt.fields.config, + } + if err := a.UpdateWaybill(tt.args.orderId, tt.args.logiId, tt.args.logiNo); (err != nil) != tt.wantErr { + t.Errorf("UpdateWaybill() error = %v, wantErr %v", err, tt.wantErr) + } + }) + } +} + +func TestAPI_UploadImageNew(t *testing.T) { + type fields struct { + APICookie platformapi.APICookie + accessToken string + appKey string + appSecret string + client *http.Client + config *platformapi.APIConfig + } + type args struct { + data []byte + fileName string + } + tests := []struct { + name string + fields fields + args args + wantJdURL string + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + a := &API{ + APICookie: tt.fields.APICookie, + accessToken: tt.fields.accessToken, + appKey: tt.fields.appKey, + appSecret: tt.fields.appSecret, + client: tt.fields.client, + config: tt.fields.config, + } + gotJdURL, err := a.UploadImageNew(tt.args.data, tt.args.fileName) + if (err != nil) != tt.wantErr { + t.Errorf("UploadImageNew() error = %v, wantErr %v", err, tt.wantErr) + return + } + if gotJdURL != tt.wantJdURL { + t.Errorf("UploadImageNew() gotJdURL = %v, want %v", gotJdURL, tt.wantJdURL) + } + }) + } +} + +func TestAPI_UploadPicture(t *testing.T) { + type fields struct { + APICookie platformapi.APICookie + accessToken string + appKey string + appSecret string + client *http.Client + config *platformapi.APIConfig + } + type args struct { + imageData []byte + pictureCateID int + pictureName string + } + tests := []struct { + name string + fields fields + args args + wantUploadPictureResult *UploadPictureResult + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + a := &API{ + APICookie: tt.fields.APICookie, + accessToken: tt.fields.accessToken, + appKey: tt.fields.appKey, + appSecret: tt.fields.appSecret, + client: tt.fields.client, + config: tt.fields.config, + } + gotUploadPictureResult, err := a.UploadPicture(tt.args.imageData, tt.args.pictureCateID, tt.args.pictureName) + if (err != nil) != tt.wantErr { + t.Errorf("UploadPicture() error = %v, wantErr %v", err, tt.wantErr) + return + } + if !reflect.DeepEqual(gotUploadPictureResult, tt.wantUploadPictureResult) { + t.Errorf("UploadPicture() gotUploadPictureResult = %v, want %v", gotUploadPictureResult, tt.wantUploadPictureResult) + } + }) + } +} + +func TestAPI_VoucherInfoGet(t *testing.T) { + type fields struct { + APICookie platformapi.APICookie + accessToken string + appKey string + appSecret string + client *http.Client + config *platformapi.APIConfig + } + tests := []struct { + name string + fields fields + wantVoucherInfoGetResult *VoucherInfoGetResult + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + a := &API{ + APICookie: tt.fields.APICookie, + accessToken: tt.fields.accessToken, + appKey: tt.fields.appKey, + appSecret: tt.fields.appSecret, + client: tt.fields.client, + config: tt.fields.config, + } + gotVoucherInfoGetResult, err := a.VoucherInfoGet() + if (err != nil) != tt.wantErr { + t.Errorf("VoucherInfoGet() error = %v, wantErr %v", err, tt.wantErr) + return + } + if !reflect.DeepEqual(gotVoucherInfoGetResult, tt.wantVoucherInfoGetResult) { + t.Errorf("VoucherInfoGet() gotVoucherInfoGetResult = %v, want %v", gotVoucherInfoGetResult, tt.wantVoucherInfoGetResult) + } + }) + } +} + +func TestAPI_WareDoUpdate(t *testing.T) { + type fields struct { + APICookie platformapi.APICookie + accessToken string + appKey string + appSecret string + client *http.Client + config *platformapi.APIConfig + } + type args struct { + op string + updateWareIds string + } + tests := []struct { + name string + fields fields + args args + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + a := &API{ + APICookie: tt.fields.APICookie, + accessToken: tt.fields.accessToken, + appKey: tt.fields.appKey, + appSecret: tt.fields.appSecret, + client: tt.fields.client, + config: tt.fields.config, + } + if err := a.WareDoUpdate(tt.args.op, tt.args.updateWareIds); (err != nil) != tt.wantErr { + t.Errorf("WareDoUpdate() error = %v, wantErr %v", err, tt.wantErr) + } + }) + } +} + +func TestAPI_WareSave(t *testing.T) { + type fields struct { + APICookie platformapi.APICookie + accessToken string + appKey string + appSecret string + client *http.Client + config *platformapi.APIConfig + } + type args struct { + wareSaveParam *WareSaveParam + } + tests := []struct { + name string + fields fields + args args + wantWareSaveResult []*WareSaveResult + wantErr bool + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + a := &API{ + APICookie: tt.fields.APICookie, + accessToken: tt.fields.accessToken, + appKey: tt.fields.appKey, + appSecret: tt.fields.appSecret, + client: tt.fields.client, + config: tt.fields.config, + } + gotWareSaveResult, err := a.WareSave(tt.args.wareSaveParam) + if (err != nil) != tt.wantErr { + t.Errorf("WareSave() error = %v, wantErr %v", err, tt.wantErr) + return + } + if !reflect.DeepEqual(gotWareSaveResult, tt.wantWareSaveResult) { + t.Errorf("WareSave() gotWareSaveResult = %v, want %v", gotWareSaveResult, tt.wantWareSaveResult) + } + }) + } +} + +func TestAPI_signParam(t *testing.T) { + type fields struct { + APICookie platformapi.APICookie + accessToken string + appKey string + appSecret string + client *http.Client + config *platformapi.APIConfig + } + type args struct { + params map[string]interface{} + } + tests := []struct { + name string + fields fields + args args + wantSig string + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + a := &API{ + APICookie: tt.fields.APICookie, + accessToken: tt.fields.accessToken, + appKey: tt.fields.appKey, + appSecret: tt.fields.appSecret, + client: tt.fields.client, + config: tt.fields.config, + } + if gotSig := a.signParam(tt.args.params); gotSig != tt.wantSig { + t.Errorf("signParam() = %v, want %v", gotSig, tt.wantSig) + } + }) + } +} + +func TestNew(t *testing.T) { + type args struct { + accessToken string + appKey string + appSecret string + config []*platformapi.APIConfig + } + tests := []struct { + name string + args args + want *API + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + if got := New(tt.args.accessToken, tt.args.appKey, tt.args.appSecret, tt.args.config...); !reflect.DeepEqual(got, tt.want) { + t.Errorf("New() = %v, want %v", got, tt.want) + } + }) + } +} + +func TestRandStringBytes(t *testing.T) { + type args struct { + n int + } + tests := []struct { + name string + args args + want string + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + if got := RandStringBytes(tt.args.n); got != tt.want { + t.Errorf("RandStringBytes() = %v, want %v", got, tt.want) + } + }) + } +} + +func Test_getBoundary(t *testing.T) { + tests := []struct { + name string + wantBoundary string + }{ + // TODO: Add test cases. + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + if gotBoundary := getBoundary(); gotBoundary != tt.wantBoundary { + t.Errorf("getBoundary() = %v, want %v", gotBoundary, tt.wantBoundary) + } + }) + } +}