This commit is contained in:
邹宗楠
2025-04-28 10:06:44 +08:00
parent 1a5a3ffc29
commit 31e4cc29bf
5 changed files with 109 additions and 85 deletions

View File

@@ -8,7 +8,7 @@ import (
)
// 京西速食(蔬菜)
var token1 = `{"access_token":"inj8cpkpri1j7t4nq1hehos0000yhugi-11","expires_in":1742841858,"scope":"SCOPE","shop_id":57939570,"shop_name":"京西菜市","refresh_token":"u4qcjoscrj1j7t4nq1hehos0000yhugi-12","authority_id":""}`
var token1 = `{"access_token":"ntx7g036841j7t4nq1hehos0000yhugi-11","expires_in":1745854497,"scope":"SCOPE","shop_id":57939570,"shop_name":"京西菜市","refresh_token":"u2d0v1sjz11j7t4nq1hehos0000yhugi-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":""}`

View File

@@ -1,20 +1,13 @@
package tiktok_api
import (
"fmt"
"git.rosy.net.cn/jx-callback/globals"
"strings"
"testing"
)
func TestN2ame(t *testing.T) {
polay := make(map[string]interface{}, 0)
polay["a"] = ""
polay["b"] = "1"
fmt.Println(polay["a"].(string))
fmt.Println(polay["b"].(string))
fmt.Println(polay["c"].(string))
a.GetProductUpdateRule(32241)
}
func TestGetRecommendCategory(t *testing.T) {

View File

@@ -82,27 +82,82 @@ func TestEiduPrice(t *testing.T) {
// s上架1
func TestEditStoreCommodity(t *testing.T) {
err := a.EditStoreCommodity(&product_editV2_request.ProductEditV2Param{
CategoryLeafId: 22428,
Name: "净芹菜约350g/份(净菜芹菜摘叶洗净,保鲜膜包装)",
Pic: "https://p3-aio.ecombdimg.com/obj/ecom-shop-material/PTWpUjYg_m_78dbc86c51be55406cd2f51bc863b2e0_sx_32178_www800-800",
Description: "https://p3-aio.ecombdimg.com/obj/ecom-shop-material/PTWpUjYg_m_4fdaab3dd1df6ed4aa8d0990b0e99ee7_sx_456574_www750-3527",
PayType: 1,
ReduceType: 2,
Weight: 350,
WeightUnit: 1,
DeliveryDelayDay: 9999,
Mobile: "18048531223",
Commit: true,
Specs: "重量|350g",
SpecPrices: "[{\"spec_detail_name1\":\"350g\",\"spec_detail_name2\":\"\",\"spec_detail_name3\":\"\",\"stock_num\":9999,\"price\":850,\"code\":\"23010\",\"step_stock_num\":0,\"supplier_id\":\"\",\"outer_sku_id\":\"23010\",\"sku_type\":1,\"stock_num_map\":{\"79226307\":9999},\"delivery_infos\":[{\"info_type\":\"weight\",\"info_value\":\"350\",\"info_unit\":\"g\"}]}]",
ProductFormatNew: "{\n\t\"1687\": [\n\t\t{\n\t\t\t\"diy_type\": 0,\n\t\t\t\"name\": \"品牌\",\n\t\t\t\"value\": 789194134\n\t\t}\n\t]\n}",
StandardBrandId: 789194134,
NeedCheckOut: false,
ForceUseQualityList: false,
NeedRechargeMode: false})
ProductId: 3605562143317059130,
ProductType: 0,
CategoryLeafId: 32241,
ProductFormat: "",
Name: "三线肉约500g/份【同城配送】",
RecommendRemark: "",
Pic: "https://p3-aio.ecombdimg.com/obj/ecom-shop-material/VqGYBUaL_m_4bf295c4d3b6466138c5650a4d433935_sx_504060_www800-800",
Description: "https://p3-aio.ecombdimg.com/obj/ecom-shop-material/VqGYBUaL_m_2e3b9a6bbf7649895bff131393b42b4c_sx_463917_www750-3527",
PayType: 1,
DeliveryMethod: 0,
CdfCategory: "",
ReduceType: 2,
AssocIds: "",
FreightId: 0,
Weight: 500,
WeightUnit: 1,
DeliveryDelayDay: 9999,
PresellType: 0,
PresellDelay: 0,
PresellEndTime: "",
Supply7dayReturn: 0,
Mobile: "18598908808",
Commit: true,
BrandId: 0,
Remark: "",
OutProductId: 0,
QualityList: nil,
SpecName: "",
Specs: "重量|500g",
SpecPrices: "[{\"spec_detail_name1\":\"500g\",\"spec_detail_name2\":\"\",\"spec_detail_name3\":\"\",\"stock_num\":999999,\"price\":3500,\"code\":\"22700\",\"step_stock_num\":0,\"supplier_id\":\"\",\"outer_sku_id\":\"22700\",\"sku_type\":1,\"stock_num_map\":{\"173965249\":999999},\"delivery_infos\":[{\"info_type\":\"weight\",\"info_value\":\"500\",\"info_unit\":\"g\"}]}]",
SpecPic: "",
MaximumPerOrder: 0,
LimitPerBuyer: 0,
MinimumPerOrder: 0,
ProductFormatNew: "{\n\t\"1687\": [\n\t\t{\n\t\t\t\"diy_type\": 0,\n\t\t\t\"name\": \"品牌\",\n\t\t\t\"value\": 596120136\n\t\t}\n\t],\n\t\"1758\": [\n\t\t{\n\t\t\t\"diy_type\": 1,\n\t\t\t\"name\": \"包装方式\",\n\t\t\t\"value\": 8197\n\t\t}\n\t],\n\t\"1880\": [\n\t\t{\n\t\t\t\"diy_type\": 0,\n\t\t\t\"name\": \"产地\",\n\t\t\t\"value\": 13850\n\t\t}\n\t],\n\t\"2130\": [\n\t\t{\n\t\t\t\"diy_type\": 0,\n\t\t\t\"name\": \"生鲜储存温度\",\n\t\t\t\"value\": 2808\n\t\t}\n\t]\n}",
SpuId: 0,
AppointDeliveryDay: 0,
ThirdUrl: "",
Extra: "",
Src: "",
OuterProductId: "",
StandardBrandId: 596120136,
NeedCheckOut: false,
PoiResource: nil,
ForceUseQualityList: false,
CarVinCode: "",
PresellConfigLevel: 0,
NeedRechargeMode: false,
PresellDeliveryType: 0,
WhiteBackGroundPicUrl: "https://p3-aio.ecombdimg.com/obj/ecom-shop-material/VqGYBUaL_m_4bf295c4d3b6466138c5650a4d433935_sx_504060_www800-800",
LongPicUrl: "",
AfterSaleService: map[string]string{
"supply_day_return_selector": "7",
},
SellChannel: []int64{0},
DelayRule: nil,
MaterialVideoId: "",
PickupMethod: "0",
SizeInfoTemplateId: 0,
SubstituteGoodsUrl: "",
SaleChannelType: "",
NamePrefix: "",
StoreId: 0,
MainProductId: 0,
SaleLimitId: 0,
})
t.Fatal(err)
}
func TestStoreName(t *testing.T) {
address := `闵庄南路京泉馨苑便民市场卖菜的第二家`
subStr := "海淀区"
index := strings.LastIndex(address, subStr)
fmt.Println(address[index+len(subStr):])
}
// 上架2
func TestEditStoreCommodity2(t *testing.T) {
a.EditStoreCommodityCommit(&product_editV2_commit_request.ProductEditV2Param2{