diff --git a/platformapi/ali_logistics_query/api.go b/platformapi/ali_logistics_query/api.go index cded7d2c..52ec1308 100644 --- a/platformapi/ali_logistics_query/api.go +++ b/platformapi/ali_logistics_query/api.go @@ -10,6 +10,7 @@ import ( ) const ( + //BastUrl = "https://express3.market.alicloudapi.com" // 基础访问路由 BastUrl = "http://express3.market.alicloudapi.com" // 基础访问路由 GetOrderDetailApi = "express3" // 获取物流订单详情 ) diff --git a/platformapi/ali_logistics_query/logistics_query.go b/platformapi/ali_logistics_query/logistics_query.go index 5f4d6b54..93f57fc7 100644 --- a/platformapi/ali_logistics_query/logistics_query.go +++ b/platformapi/ali_logistics_query/logistics_query.go @@ -6,6 +6,7 @@ import ( "net/http" ) +// GetLogisticsInfo 阿里云免费案例用完了,未充值续费 func (a *API) GetLogisticsInfo(logisticsNumber string) (*OrderDetail, error) { if len(logisticsNumber) == 0 { return nil, errors.New("参数不能为空") diff --git a/platformapi/ali_logistics_query/logistics_test.go b/platformapi/ali_logistics_query/logistics_test.go index 84f8c55c..5d9d1fec 100644 --- a/platformapi/ali_logistics_query/logistics_test.go +++ b/platformapi/ali_logistics_query/logistics_test.go @@ -5,6 +5,7 @@ import ( "git.rosy.net.cn/baseapi/utils" "git.rosy.net.cn/jx-callback/globals" "testing" + "time" ) var ( @@ -15,11 +16,11 @@ var ( func Test(t *testing.T) { api := New(appKey, appSecret, appCode) - result, err := api.GetLogisticsInfo("78652277511810") + result, err := api.GetLogisticsInfo("88509825167028") globals.SugarLogger.Debugf("result======== %s", utils.Format4Output(result, false)) globals.SugarLogger.Debugf("err======== %s", utils.Format4Output(err, false)) } func TestSkuStatus(t *testing.T) { - fmt.Println(2&(4|2|1) != 0) + fmt.Println(time.Since(utils.Str2Time("2026-03-18 00:00:00")) >= 3*24*time.Hour) } diff --git a/platformapi/ebaiapi/common_test.go b/platformapi/ebaiapi/common_test.go index 5c731986..3b81f6f7 100644 --- a/platformapi/ebaiapi/common_test.go +++ b/platformapi/ebaiapi/common_test.go @@ -1,7 +1,9 @@ package ebaiapi import ( + "fmt" "testing" + "time" "git.rosy.net.cn/baseapi/utils" ) @@ -58,3 +60,10 @@ func TestCommonBusinessCategories(t *testing.T) { t.Log(utils.Format4Output(result, false)) } } + +func TestUpdateName(t *testing.T) { + t1 := utils.Str2Time("2026-02-07 15:38:34") + t2 := utils.Str2Time("2024-11-27 11:02:55") + fmt.Println(t2.Sub(t1) > 30*24*time.Hour) + fmt.Println(t1.Sub(t2) > 30*24*time.Hour) +} diff --git a/platformapi/ebaiapi/shop_test.go b/platformapi/ebaiapi/shop_test.go index d6fd4180..37ec7de0 100644 --- a/platformapi/ebaiapi/shop_test.go +++ b/platformapi/ebaiapi/shop_test.go @@ -217,6 +217,11 @@ func TestShopClose(t *testing.T) { } +func TestAbc(t *testing.T) { + a := "88492098261735" + fmt.Println(a[len(a)-4:]) +} + func TestShopOffline(t *testing.T) { err := api.ShopOffline("", testShopBaiduID) if err != nil { diff --git a/platformapi/mtwmapi/mtwmapi_test.go b/platformapi/mtwmapi/mtwmapi_test.go index 113d8712..6cb2da72 100644 --- a/platformapi/mtwmapi/mtwmapi_test.go +++ b/platformapi/mtwmapi/mtwmapi_test.go @@ -25,7 +25,7 @@ func init() { //api = New("4123", "df2c88338b85f830cebce2a9eab56628", "", "") //商超 - api = New("5873", "41c479790a76f86326f89e8048964739", "", "token_kG4zfLsdUoDljUH6ds1PzQ") + api = New("5873", "41c479790a76f86326f89e8048964739", "", "token_uBpkcyJpxPsNSNMdpf1JhQ") //cookieStr := ` // acctId=57396785; token=0bWbK5VbK50E2BmIhIH2zHB-am_y7mB37yXHm6RLZWx4*; wmPoiId=-1; //` diff --git a/platformapi/mtwmapi/order_test.go b/platformapi/mtwmapi/order_test.go index db4e9965..bc494d87 100644 --- a/platformapi/mtwmapi/order_test.go +++ b/platformapi/mtwmapi/order_test.go @@ -31,7 +31,7 @@ func getTimeFromTimestamp(timeStamp int64) time.Time { } func TestOrderGetOrderDetail(t *testing.T) { - result, err := api.OrderGetOrderDetail(5301969382988477903, false) + result, err := api.OrderGetOrderDetail(3802032442031470827, false) if err != nil { t.Fatal(err) } diff --git a/platformapi/mtwmapi/retail_test.go b/platformapi/mtwmapi/retail_test.go index 4f18a80f..184e3d2a 100644 --- a/platformapi/mtwmapi/retail_test.go +++ b/platformapi/mtwmapi/retail_test.go @@ -293,11 +293,17 @@ func TestRetailInitData(t *testing.T) { i := 0 for { // 同步商品 - fromFoodList, err1 := api.RetailListAll("31897630", i) + fromFoodList, err1 := api.RetailListAll("21494359", i) if len(fromFoodList) == 0 || fromFoodList == nil { fmt.Println(fmt.Errorf("fromFoodList 为空 %s ,i:= %d", utils.Format4Output(err1, false), i)) return } + + for _, v := range fromFoodList { + + fmt.Println(fmt.Sprintf("%s:%s", v.Name, strings.ReplaceAll(v.Picture, " ", ""))) + } + if len(fromFoodList) < 100 { fmt.Println(len(fromFoodList)) break diff --git a/platformapi/tiktok_shop/sdk-golang/api/brand_list/request/brand_list_request.go b/platformapi/tiktok_shop/sdk-golang/api/brand_list/request/brand_list_request.go index a586ce5e..36c61dce 100644 --- a/platformapi/tiktok_shop/sdk-golang/api/brand_list/request/brand_list_request.go +++ b/platformapi/tiktok_shop/sdk-golang/api/brand_list/request/brand_list_request.go @@ -48,17 +48,19 @@ type BrandListParam struct { // (已停止使用)类目列表 Categories []int64 `json:"categories"` // (已停止使用)起始位 - Offset int64 `json:"offset"` + Offset *int64 `json:"offset"` // (已停止使用)单次最大条数 - Size int64 `json:"size"` + Size *int64 `json:"size"` // (已停止使用)排序顺序,默认为倒排 0:降序, 1:升序 - Sort int32 `json:"sort"` + Sort *int32 `json:"sort"` // (已停止使用)品牌状态 1:审核中, 2:审核通过, 3:审核拒绝 - Status int32 `json:"status"` + Status *int32 `json:"status"` // (已停止使用)是否返回完全的品牌信息 - FullBrandInfo bool `json:"full_brand_info"` + FullBrandInfo *bool `json:"full_brand_info"` // (推荐使用,必填)类目id - CategoryId int64 `json:"category_id"` + CategoryId *int64 `json:"category_id"` // 品牌前缀(中文或者英文),适用于不需要品牌资质的场景,根据前缀搜索品牌 - Query string `json:"query"` + Query *string `json:"query"` + // (选填)品牌ids,传了品牌ids默认直接拿品牌id搜索并返回结果(放在brand_list里),不会使用其他入参 + BrandIds []int64 `json:"brand_ids"` } diff --git a/platformapi/tiktok_shop/sdk-golang/api/brand_list/response/brand_list_response.go b/platformapi/tiktok_shop/sdk-golang/api/brand_list/response/brand_list_response.go index 985594fa..38a0b66a 100644 --- a/platformapi/tiktok_shop/sdk-golang/api/brand_list/response/brand_list_response.go +++ b/platformapi/tiktok_shop/sdk-golang/api/brand_list/response/brand_list_response.go @@ -6,6 +6,14 @@ type BrandListResponse struct { doudian_sdk.BaseDoudianOpApiResponse Data *BrandListData `json:"data"` } +type BrandListItem struct { + // 品牌id + BrandId int64 `json:"brand_id"` + // 中文名 + NameCn string `json:"name_cn"` + // 英文名 + NameEn string `json:"name_en"` +} type BrandListData struct { // (已停止使用)品牌id列表 BrandIds []int64 `json:"brand_ids"` @@ -54,11 +62,3 @@ type AuthBrandListItem struct { // 英文名 NameEn string `json:"name_en"` } -type BrandListItem struct { - // 品牌id - BrandId int64 `json:"brand_id"` - // 中文名 - NameCn string `json:"name_cn"` - // 英文名 - NameEn string `json:"name_en"` -} diff --git a/platformapi/tiktok_shop/sdk-golang/api/product_GetRecommendCategory/request/product_GetRecommendCategory_request.go b/platformapi/tiktok_shop/sdk-golang/api/product_GetRecommendCategory/request/product_GetRecommendCategory_request.go index bdc91a3d..46bdd047 100644 --- a/platformapi/tiktok_shop/sdk-golang/api/product_GetRecommendCategory/request/product_GetRecommendCategory_request.go +++ b/platformapi/tiktok_shop/sdk-golang/api/product_GetRecommendCategory/request/product_GetRecommendCategory_request.go @@ -67,4 +67,6 @@ type ProductGetRecommendCategoryParam struct { ProductFormatNew map[int64]ProductFormatNewItem `json:"product_format_new"` // 品牌id StandardBrandId int64 `json:"standard_brand_id"` + // 深度思考异步任务ID,命中深度思考时返回,用于轮询深度思考结果 + AsyncTaskId *string `json:"async_task_id"` } diff --git a/platformapi/tiktok_shop/sdk-golang/api/product_GetRecommendCategory/response/product_GetRecommendCategory_response.go b/platformapi/tiktok_shop/sdk-golang/api/product_GetRecommendCategory/response/product_GetRecommendCategory_response.go index 5692109d..b93d6592 100644 --- a/platformapi/tiktok_shop/sdk-golang/api/product_GetRecommendCategory/response/product_GetRecommendCategory_response.go +++ b/platformapi/tiktok_shop/sdk-golang/api/product_GetRecommendCategory/response/product_GetRecommendCategory_response.go @@ -33,4 +33,14 @@ type CategoryDetailsItem struct { type ProductGetRecommendCategoryData struct { // 推荐类目结果 CategoryDetails []CategoryDetailsItem `json:"categoryDetails"` + // 类目预测记录id + RecommendId string `json:"recommend_id"` + // 深度思考异步任务ID,命中深度思考时返回,用于轮询深度思考结果 + AsyncTaskId string `json:"async_task_id"` + // 深度思考任务状态,命中深度思考时返回。0-init 1-running 2-success 3-failed + AsyncTaskStatus int64 `json:"async_task_status"` + // 深度思考超时时间,单位:ms,命中深度思考时返回,用于轮询深度思考结果 + Timeout int64 `json:"timeout"` + // 深度思考轮询间隔,单位:ms,命中深度思考时返回,用于轮询深度思考结果 + Interval int64 `json:"interval"` } diff --git a/platformapi/tiktok_shop/sdk-golang/api/product_addV2/request/product_addV2_request.go b/platformapi/tiktok_shop/sdk-golang/api/product_addV2/request/product_addV2_request.go index 7642c6b1..9219cb85 100644 --- a/platformapi/tiktok_shop/sdk-golang/api/product_addV2/request/product_addV2_request.go +++ b/platformapi/tiktok_shop/sdk-golang/api/product_addV2/request/product_addV2_request.go @@ -44,202 +44,521 @@ func (c *ProductAddV2Request) GetParams() *ProductAddV2Param { return c.Param } -type QualityAttachmentsItem struct { - // 1-图片,2-pdf - MediaType int64 `json:"media_type"` - // 凭证url - Url string `json:"url"` +type PropertyDetailItem struct { + // 定制属性名称 + Name *string `json:"name"` + // 定制属性扩展信息 + ExtraInfo *ExtraInfo `json:"extra_info"` } -type QualityListItem struct { - // 资质key - QualityKey string `json:"quality_key"` - // 资质名称 - QualityName string `json:"quality_name"` - // 资质 - QualityAttachments []QualityAttachmentsItem `json:"quality_attachments"` -} -type PoiResource struct { - // 有效时间段,从领取日开始计算,优先级高于ValidStart-ValidEnd - ValidDays int64 `json:"valid_days"` - // 卡券有效开始时间,秒单位时间戳 - ValidStart int64 `json:"valid_start"` - // 卡券有效截止时间,秒单位时间戳 - ValidEnd int64 `json:"valid_end"` - // 客服电话 - ServiceNum string `json:"service_num"` - // 领取须知 - Notification string `json:"notification"` - // 平台产生券码: 1 ; 合作方api实时传入的券码: 4 - CodeType int64 `json:"code_type"` - // 券码总量,0/-1表示不限制,平台券时须\u003e0 - Count int64 `json:"count"` - // 0-不支持二次兑换,1-支持二次兑换 - CouponSecondExchange int64 `json:"couponSecondExchange"` - // 可核销总次数 - TotalCanUseCount int32 `json:"total_can_use_count"` - // 兑换链接 - Link string `json:"link"` - // 券码使用条件 - Condition string `json:"condition"` - // 数组当前只支持一个元素且只可为 1或2,其中 1 表示随时退+过期自动退,2 表示不支持退 - CouponReturnMethods []int64 `json:"coupon_return_methods"` +type DefaultProcessTime struct { + // 商品默认处理时长,单位秒 + Value *int64 `json:"value"` } type DelayRule struct { - // 是否开启特殊日期延迟发货 - Enable bool `json:"enable"` // 1 时间点;2 时间范围 ConfigType int32 `json:"config_type"` // 特殊日期延迟发货时间最晚发货时间,时间戳,单位秒:当config_type=1时,传时间戳,代表最晚x发货;当config_type=2时,传天数,代表延迟x天发货 ConfigValue int64 `json:"config_value"` - // 特殊日期延迟发货时间下单开始时间,时间戳,单位秒 - StartTime int64 `json:"start_time"` // 特殊日期延迟发货时间下单结束时间,时间戳,单位秒 EndTime int64 `json:"end_time"` + // 是否开启特殊日期延迟发货 + Enable bool `json:"enable"` + // 特殊日期延迟发货时间下单开始时间,时间戳,单位秒 + StartTime int64 `json:"start_time"` } -type RecruitInfo struct { - // 线索ID - RecruitFollowId string `json:"recruit_follow_id"` - // 招商类型 - RecruitType string `json:"recruit_type"` +type QualityInspectionInfo struct { + // 质检证书编码 + CertificateCode *string `json:"certificate_code"` + // 机构编码,请通过/inspection/QueryBtasAgencyList接口获取 + Agency *string `json:"agency"` + // 1: 单库存模式,只允许售卖一个sku;2: 多库存模式,不限售卖次数 + Mode *int32 `json:"mode"` + // 是否支持前置质检 + Supported *bool `json:"supported"` +} +type MultiTimeStocksItem struct { + // 时效 + TimeType *int64 `json:"time_type"` + // 时效描述 + TimeDesc *string `json:"time_desc"` + // 时效库存数 + StockNum *int64 `json:"stock_num"` +} +type TaxExemptionSkuInfo struct { + // 是否套装(0 否 1 是) + IsSuit *int32 `json:"is_suit"` + // 净含量 + Volume *int64 `json:"volume"` + // 套装数量 + SuitNum *int64 `json:"suit_num"` +} +type GovSubsidyCargo struct { + // 国补自营货品ID + CargoId *int64 `json:"cargo_id"` +} +type DeliveryInfosItem struct { + // 信息类型 + InfoType *string `json:"info_type"` + // 信息计量单位 + InfoUnit *string `json:"info_unit"` + // 信息值 + InfoValue *string `json:"info_value"` +} +type SpecPricesV2Item struct { + // 外部skuid + OuterSkuId *string `json:"outer_sku_id"` + // 时效库存,一个sku可以配置0到多个时效库存 + MultiTimeStocks []MultiTimeStocksItem `json:"multi_time_stocks"` + // 阶梯库存数量 + StepStockNum *int64 `json:"step_stock_num"` + // 外部skuid + OutSkuId *int64 `json:"out_sku_id"` + // 海南免税:Sku 额外信息 + TaxExemptionSkuInfo *TaxExemptionSkuInfo `json:"tax_exemption_sku_info"` + // 批次库存 + BatchStocks []BatchStocksItem `json:"batch_stocks"` + // 组套包信息 + PackageSku []PackageSkuItem `json:"package_sku"` + // 商品规格值id:懂车帝场景传递 + SpecValueLibId *int64 `json:"spec_value_lib_id"` + // sku分类信息,对应枚举值"main_sale_single_product" - 主售款(单品)"main_sale_multi_product" - "主售款(多件装)""main_sale_combination" - 主售款(组合品)"non_main_sale" - 非主售款"information_description" - 信息说明/防拍 + SkuClassificationType *string `json:"sku_classification_type"` + // 预售天数 + PresellDelay *int64 `json:"presell_delay"` + // 规格信息 + SellProperties []SellPropertiesItem `json:"sell_properties"` + // 仓ID -> 库存数量。跨境业务大部分都是必传,格式为:Map<商家仓ID, 库存数量> + StockNumMap *map[string]int64 `json:"stock_num_map"` + // 黄金加工费,单位:分,nil代表不修改 + GoldProcessCharge *int64 `json:"gold_process_charge"` + // 规格型号编码-国补场景下国补商品型号 + SpecModelCode []string `json:"spec_model_code"` + // 库存数量。跨境必须走区域库存,stock_num设置0。 + StockNum *int64 `json:"stock_num"` + // 供应商编码 + SupplierId *string `json:"supplier_id"` + // 货品信息,如果传0 0 表示解绑) + Cargo *Cargo `json:"cargo"` + // 国补自营货品相关 + GovSubsidyCargo *GovSubsidyCargo `json:"gov_subsidy_cargo"` + // 商家编码 + Code *string `json:"code"` + // 库存类型 0-普通库存,1-区域库存,10-阶梯库存 + SkuType *int64 `json:"sku_type"` + // 海关申报要素 + CustomsReportInfo *CustomsReportInfo `json:"customs_report_info"` + // 条形码 + Barcodes []string `json:"barcodes"` + // 价格 + Price *int64 `json:"price"` + // true:表示sku上架 false:表示sku下架 + SkuStatus *bool `json:"sku_status"` + // SKU运输信息 + DeliveryInfos []DeliveryInfosItem `json:"delivery_infos"` + // 供货价,单位:分,nil代表不修改,0代表清空 + SupplyPrice *int64 `json:"supply_price"` +} +type OpenLogisticsInfo struct { + // 商家仓id + CrossWarehouseId *string `json:"cross_warehouse_id"` + // 原产国id + OriginCountryId *int64 `json:"origin_country_id"` + // 税金承担方(一般都填0,走商家承担):0商家承担,1用户承担 + TaxPayer *int64 `json:"tax_payer"` + // 货源国id + SourceCountryId *int64 `json:"source_country_id"` + // 品牌所在地id + BrandCountryId *int64 `json:"brand_country_id"` + // 商品净重 + NetWeightQty *float64 `json:"net_weight_qty"` + // 通关模式,1:BBC 2:BC 3:CC邮关 + CustomsClearType *int64 `json:"customs_clear_type"` +} +type QualityAttachmentsItem struct { + // 凭证url + Url string `json:"url"` + // 1-图片 + MediaType int64 `json:"media_type"` +} +type BatchStockItemsItem struct { + // 批次库存类型: 1为唯一码 + BatchType *int64 `json:"batch_type"` + // 批次库存值 + StockNum *int64 `json:"stock_num"` + // 唯一码 + UniqueId *string `json:"unique_id"` +} +type CustomProperty struct { + // 定制属性组信息,如:加工服务 + CustomPropertyGroups []CustomPropertyGroupsItem `json:"customPropertyGroups"` +} +type CategoryPropertyPicsItem struct { + // 属性图图片链接 + Urls []string `json:"urls"` +} +type QualityListItem struct { + // 资质名称 + QualityName string `json:"quality_name"` + // 资质名 + QualityContentName *string `json:"quality_content_name"` + // 资质id + QualityId *int64 `json:"quality_id"` + // 资质 + QualityAttachments []QualityAttachmentsItem `json:"quality_attachments"` + // 资质key + QualityKey string `json:"quality_key"` +} +type ValuesItem_4 struct { + // 度量衡结构化信息 + MeasureInfo *MeasureInfo `json:"measure_info"` + // 规格值导航路径 + CpvPath []CpvPathItem `json:"cpv_path"` + // 备注 + Remark *string `json:"remark"` + // 规格值名称 + ValueName string `json:"value_name"` + // 规格值标准属性值id + ValueId *int64 `json:"value_id"` +} +type Cargo struct { + // 货品类型,跨境的货品类型传3 + SourceType *int64 `json:"source_type"` + // 货品id + CargoId *string `json:"cargo_id"` +} +type PoiResource struct { + // 有效时间段,从领取日开始计算,优先级高于ValidStart-ValidEnd + ValidDays *int64 `json:"valid_days"` + // 卡券有效开始时间,秒单位时间戳 + ValidStart *int64 `json:"valid_start"` + // 客服电话 + ServiceNum *string `json:"service_num"` + // 平台产生券码: 1 ; 合作方api实时传入的券码: 4 + CodeType *int64 `json:"code_type"` + // 门店库id + PoiLibId *int64 `json:"poi_lib_id"` + // 券码总量,0/-1表示不限制,平台券时须\u003e0 + Count *int64 `json:"count"` + // 领取须知 + Notification *string `json:"notification"` + // 兑换链接 + Link *string `json:"link"` + // 0-不支持二次兑换,1-支持二次兑换 + CouponSecondExchange *int64 `json:"couponSecondExchange"` + // 数组当前只支持一个元素且只可为 1或2,其中 1 表示随时退+过期自动退,2 表示不支持退 + CouponReturnMethods []int64 `json:"coupon_return_methods"` + // 券码使用条件 + Condition *string `json:"condition"` + // 可核销总次数 + TotalCanUseCount *int32 `json:"total_can_use_count"` + // 卡券有效截止时间,秒单位时间戳 + ValidEnd *int64 `json:"valid_end"` +} +type ValuesItem struct { + // 度量衡单位id + UnitId *int64 `json:"unit_id"` + // 度量衡值 + Value *string `json:"value"` + // 模块id + ModuleId *int64 `json:"module_id"` + // 度量衡值前缀 + Prefix *string `json:"prefix"` + // 度量衡单位名称 + UnitName *string `json:"unit_name"` + // 度量衡后缀 + Suffix *string `json:"suffix"` +} +type CpvPathItem struct { + // 属性id + Cpid int64 `json:"cpid"` + // 属性值id + Cpvid int64 `json:"cpvid"` +} +type BatchStocksItem struct { + // 批次库存项 + BatchStockItems []BatchStockItemsItem `json:"batch_stock_items"` + // 外部仓id,区域库存模式填写 + OutWarehouseId *string `json:"out_warehouse_id"` +} +type ExtraInfo struct { + // 属性处理时长,单位秒 + ProcessTime *int64 `json:"process_time"` +} +type UnitPriceInfo struct { + // 1表示投资金2表示首饰金 + PriceRuleType int32 `json:"price_rule_type"` + // 如果传了unit_price_info字段,请请写死传0。内部不会消费,只是用于标识 + ProcessCharge int64 `json:"process_charge"` +} +type SpecValuesItem struct { + // 规格项标准属性id + PropertyId *int64 `json:"property_id"` + // 颜色 + PropertyName string `json:"property_name"` + // 规格值 + Values []ValuesItem_4 `json:"values"` +} +type SellPropertiesItem struct { + // 规格项名称 + PropertyName *string `json:"property_name"` + // 规格值名称 + ValueName *string `json:"value_name"` +} +type CustomPropertyGroupsItem struct { + // 定制属性组名称 + Name *string `json:"name"` + // 定制属性信息,如:宰杀,不宰杀 + PropertyDetail []PropertyDetailItem `json:"propertyDetail"` } type ProductAddV2Param struct { - // 推荐使用,外部商家编码,支持字符串 - OuterProductId string `json:"outer_product_id"` + // 推荐使用,外部商家编码,支持字符串。超市小时达场景不推荐使用。out_product_id 、outer_product_id 都传了的话,要求相等。 + OuterProductId *string `json:"outer_product_id"` // 0-普通,3-虚拟,6玉石闪购,7云闪购 ProductType int64 `json:"product_type"` // 叶子类目ID通过/shop/getShopCategory接口获取 CategoryLeafId int64 `json:"category_leaf_id"` - // (已废弃,用新字段product_format_new)属性名称|属性值 之间用|分隔, 多组之间用^分开 - ProductFormat string `json:"product_format"` - // 商品名称,最多60个字符(30个汉字),不能含emoj表情 + // 商品名称,至少8个字符(4个汉字),最多60个字符(30个汉字),不能含emoj表情 Name string `json:"name"` // 商家推荐语,不能含emoj表情 - RecommendRemark string `json:"recommend_remark"` - // 商品轮播图,多张图片用 \"|\" 分开,第一张图为主图,最多5张,至少600x600,大小不超过1M。 + RecommendRemark *string `json:"recommend_remark"` + // 商品轮播图,多张图片用 \"|\" 分开,第一张图为主图,最多5张,至少600x600,大小不超过5M。 Pic string `json:"pic"` - // 商品描述,目前只支持图片。多张图片用 \"|\" 分开。不能用其他网站的文本粘贴,这样会出现css样式不兼容。 + // 商品描述,目前只支持图片。多张图片用 \"|\" 分开。不能用其他网站的文本粘贴,这样会出现css样式不兼容。总图片数量不得超过50张。 Description string `json:"description"` // 支付方式,0货到付款 1在线支付,2,货到付款+在线支付 - PayType int64 `json:"pay_type"` + PayType *int64 `json:"pay_type"` // 海南免税生效。 0:离岛免税、1:邮寄、2:离岛自提+邮寄 - DeliveryMethod int32 `json:"delivery_method"` + DeliveryMethod *int32 `json:"delivery_method"` // 海南免税:海关限购分类编码 - CdfCategory string `json:"cdf_category"` + CdfCategory *string `json:"cdf_category"` // 1 减库存类型:1-拍下减库存 2-付款减库存 ReduceType int64 `json:"reduce_type"` // 同店商品推荐:为空表示使用系统推荐;多个product_id使用“|”分开 - AssocIds string `json:"assoc_ids"` + AssocIds *string `json:"assoc_ids"` // 运费模板id,传0表示包邮,通过/freightTemplate/list接口获取 FreightId int64 `json:"freight_id"` // 重量 - Weight float64 `json:"weight"` + Weight *float64 `json:"weight"` // 重量单位,0-kg, 1-g - WeightUnit int64 `json:"weight_unit"` + WeightUnit *int64 `json:"weight_unit"` // delivery_delay_day: 承诺发货时间,单位是天,不传则默认为2天。现货发货(presell_type=0)和阶梯发货模式(presell_type=2)时必填,支持传入9999 、1、 2 (分别表示当日发、次日发、48小时发),具体支持传入的参数范围/product/getProductUpdateRule - DeliveryDelayDay int64 `json:"delivery_delay_day"` + DeliveryDelayDay *int64 `json:"delivery_delay_day"` // 发货模式,0-现货发货,1-预售发货,2-阶梯发货,默认0 - PresellType int64 `json:"presell_type"` + PresellType *int64 `json:"presell_type"` // 全款预售模式时的发货时间/阶梯模式下阶梯发货时间,具体支持传入的参数范围/product/getProductUpdateRule。 - PresellDelay int64 `json:"presell_delay"` + PresellDelay *int64 `json:"presell_delay"` // 预售结束时间,格式2020-02-21 18:54:27,最多支持设置距离当前30天 - PresellEndTime string `json:"presell_end_time"` - // 是否支持7天无理由,0不支持,1支持,2支持(拆封后不支持) - Supply7dayReturn int64 `json:"supply_7day_return"` + PresellEndTime *string `json:"presell_end_time"` + // 【该字段将在2023年4月30日下线,请开发使用最新的after_sale_service字段传值;】是否支持7天无理由,0不支持,1支持,2支持(拆封后不支持) + Supply7dayReturn *int64 `json:"supply_7day_return"` // 客服电话号码 Mobile string `json:"mobile"` // false仅保存,true保存+提审 Commit bool `json:"commit"` - // (brand_id已废弃,用新字段standard_brand_id)品牌id (请求店铺授权品牌接口获取) (效果即为商品详情页面中的品牌字段) - BrandId int64 `json:"brand_id"` // 商家可见备注 - Remark string `json:"remark"` - // 外部product_id - OutProductId int64 `json:"out_product_id"` + Remark *string `json:"remark"` + // 外部product_id。超市小时达场景不推荐使用。out_product_id 、outer_product_id 都传了的话,要求相等。 + OutProductId *int64 `json:"out_product_id"` // 资质,可通过/product/qualificationConfig获取 QualityList []QualityListItem `json:"quality_list"` // 如果不填,则规格名为各级规格名用 \"-\" 自动生成 - SpecName string `json:"spec_name"` + SpecName *string `json:"spec_name"` // 店铺通用规格,能被同类商品通用。多规格用^分隔,规格与规格值用|分隔,多个规格值用,分隔。如果创建或编辑现货+预售商品或新预售商品时,须包含发货时效,如:颜色|黑色,白色,黄色^尺码|S,M,L^发货时效|5天内发货,15天内发货 - Specs string `json:"specs"` - // sku详情,数量应该等于规格1规格2规格3,sku数量和规格组合数必须一致 sku不可售时,库存可设置为0。 delivery_infos为SKU物流信息,info_value为字符串类型(示例:"12"),info_type填weight,info_unit支持mg,g,kg,超市小时达场景主品用普通库存,子品用区域库存("sku_type": 1 // 区域库存,"stock_num_map": {"123": 99999 // 门店ID:库存数量}) - SpecPrices string `json:"spec_prices"` + Specs *string `json:"specs"` + // sku详情,数量应该等于规格1规格2规格3,sku数量和规格组合数必须一致 sku不可售时,库存可设置为0。price单位为分。 delivery_infos为SKU物流信息,info_value为字符串类型(示例:"12"),info_type填weight,info_unit支持mg,g,kg,超市小时达场景主品用普通库存,子品用区域库存("sku_type": 1 // 区域库存,"stock_num_map": {"123": 99999 // 门店ID:库存数量}); “gold_process_charge”为黄金加工费,只有计价金类目可填并且必填。sell_properties为sku规格信息,代替spec_detail_name1、spec_detail_name2、spec_detail_name3,支持填写超过三级规格,样式:[{"property_id":123,"property_name":"颜色","value_id":456,"value_name":"红色","remark":"偏深"},{"property_id":789,"property_name":"净含量","value_id":891,"value_name":"30ml","remark":null,"measurement":{"measure_unit":"ml","measure_unit_id":4,"value":"30"}}] 其中property_id规格项属性id,自定义时传0,property_name为规格项名称,value_id为规格值属性id自定义时传0,value_name为规格值名称,remark为规格值备注(选填),measurement为度量衡信息,当规格值为度量衡属性自定义值时传递。 + SpecPrices *string `json:"spec_prices"` // 如颜色-尺寸, 颜色就是主规格, 颜色如黑,白,黄,它们图片url以逗号分隔 注:\"pic\"、\"description\"、\"spec_pic\"这三个字段里的传入的图片数量总和,不得超过50张。 - SpecPic string `json:"spec_pic"` + SpecPic *string `json:"spec_pic"` // 每个用户每次下单限购件数 - MaximumPerOrder int64 `json:"maximum_per_order"` + MaximumPerOrder *int64 `json:"maximum_per_order"` // 每个用户累计限购件数 - LimitPerBuyer int64 `json:"limit_per_buyer"` + LimitPerBuyer *int64 `json:"limit_per_buyer"` // 每个用户每次下单至少购买的件数 - MinimumPerOrder int64 `json:"minimum_per_order"` + MinimumPerOrder *int64 `json:"minimum_per_order"` // 属性,通过/product/getCatePropertyV2获取 格式:{"property_id":[{"value":value,"name":"property_name","diy_type":0}]} name的类型是string,value和diy_type的类型是number - ProductFormatNew string `json:"product_format_new"` + ProductFormatNew *string `json:"product_format_new"` // spu_id - SpuId int64 `json:"spu_id"` + SpuId *int64 `json:"spu_id"` // 可预约发货天数 - AppointDeliveryDay int64 `json:"appoint_delivery_day"` + AppointDeliveryDay *int64 `json:"appoint_delivery_day"` // third_url - ThirdUrl string `json:"third_url"` + ThirdUrl *string `json:"third_url"` // extra - Extra string `json:"extra"` + Extra *string `json:"extra"` // src - Src string `json:"src"` + Src *string `json:"src"` // 品牌id,通过/brand/list获取,无品牌id则传596120136 - StandardBrandId int64 `json:"standard_brand_id"` + StandardBrandId *int64 `json:"standard_brand_id"` // 卡券类型需要传true - NeedCheckOut bool `json:"need_check_out"` + NeedCheckOut *bool `json:"need_check_out"` // 卡券信息 PoiResource *PoiResource `json:"poi_resource"` // 汽车vin码 - CarVinCode string `json:"car_vin_code"` + CarVinCode *string `json:"car_vin_code"` // 0:全款预售,1:sku预售,2:现货+预售 ,3:新预售 - PresellConfigLevel int64 `json:"presell_config_level"` + PresellConfigLevel *int64 `json:"presell_config_level"` // 充值模式 - NeedRechargeMode bool `json:"need_recharge_mode"` + NeedRechargeMode *bool `json:"need_recharge_mode"` // 账号模板id - // AccountTemplateId string `json:"account_template_id"` + AccountTemplateId *string `json:"account_template_id"` // 全款预售和sku预售时传递,其他不传: 0 预售结束后发货 1支付完成后发货 - PresellDeliveryType int64 `json:"presell_delivery_type"` - // 白底图url(仅素材中心url有效) - WhiteBackGroundPicUrl string `json:"white_back_ground_pic_url"` + PresellDeliveryType *int64 `json:"presell_delivery_type"` + // 白底图url(仅素材中心url有效),白底图比例要求1:1 + WhiteBackGroundPicUrl *string `json:"white_back_ground_pic_url"` // 3:4长图url(仅素材中心url有效) - LongPicUrl string `json:"long_pic_url"` + LongPicUrl *string `json:"long_pic_url"` // 推荐传入,售后服务参数,key:value格式。supply_day_return_selector(7天无理由选项):N天-政策代号,N只支持7和15,政策代号枚举https://bytedance.feishu.cn/docs/doccnF946oh1c98e7mo9DlYZtig 。 supply_red_ass_return(红屁屁无忧):0不支持,1支持。supply_allergy_return(过敏无忧,仅跨境可选):0不支持,1支持。 damaged_order_return(坏损包退):0不支持,1支持。 support_allergy_returnV2(过敏包退,境内可选):0不支持,1支持 - AfterSaleService map[string]string `json:"after_sale_service"` + AfterSaleService *map[string]string `json:"after_sale_service"` // 售卖方式;0:全渠道手售卖,1:仅指定直播间售卖 SellChannel []int64 `json:"sell_channel"` // 审核通过后上架售卖时间配置:0-立即上架售卖 1-放入仓库 - StartSaleType int64 `json:"start_sale_type"` + StartSaleType *int64 `json:"start_sale_type"` // 特殊日期延迟发货规则 DelayRule *DelayRule `json:"delay_rule"` // 主图视频ID,可以先通过https://op.jinritemai.com/docs/api-docs/69/1617接口上传视频,获取审核通过的视频素材ID进行传入 任务需要验证 - MaterialVideoId string `json:"material_video_id"` + MaterialVideoId *string `json:"material_video_id"` // 提取方式新字段,推荐使用。"0": 普通商品-使用物流发货, "1": 虚拟商品-无需物流与电子交易凭证, "2": 虚拟商品-使用电子交易凭证, "3": 虚拟商品-充值直连 - PickupMethod string `json:"pickup_method"` + PickupMethod *string `json:"pickup_method"` // 尺码模板ID - SizeInfoTemplateId int64 `json:"size_info_template_id"` + SizeInfoTemplateId *int64 `json:"size_info_template_id"` // 外部商品url - SubstituteGoodsUrl string `json:"substitute_goods_url"` + SubstituteGoodsUrl *string `json:"substitute_goods_url"` // 销售渠道类型,可选onlineOnly(纯电商,仅在线上售卖)或sameAsOffline(专柜同款,线上线下都有售卖),云零售商家(https://fxg.jinritemai.com/ffa/merchant-growth/cloud-retail)可以设置 - SaleChannelType string `json:"sale_channel_type"` + SaleChannelType *string `json:"sale_channel_type"` // 招商信息 RecruitInfo *RecruitInfo `json:"recruit_info"` // 门店ID - StoreId int64 `json:"store_id"` + StoreId *int64 `json:"store_id"` // 主商品ID - MainProductId int64 `json:"main_product_id"` + MainProductId *int64 `json:"main_product_id"` // 限售模板ID - SaleLimitId int64 `json:"sale_limit_id"` + SaleLimitId *int64 `json:"sale_limit_id"` // 通过/product/getRecommendName接口推荐的商品标题前缀(注意系统根据类目属性生成前缀字符串时,末尾有一个空格) - NamePrefix string `json:"name_prefix"` - // 小时达专用 + NamePrefix *string `json:"name_prefix"` + // 参考价,单位分,需大于商品价格并小于商品价格的10倍 + ReferencePrice *int64 `json:"reference_price"` + // 参考价凭证信息 + ReferencePriceCertificate *ReferencePriceCertificate `json:"reference_price_certificate"` + // 商品主图3:4,多张图片用 \"|\" 分开,最多5张,大小不超过5M。 + MainImageThreeToFour *string `json:"main_image_three_to_four"` + // 商品价格规则信息 + UnitPriceInfo *UnitPriceInfo `json:"unit_price_info"` + // 前置质检相关(特定二手商家、特定二手类目使用) + QualityInspectionInfo *QualityInspectionInfo `json:"quality_inspection_info"` + // 是否支持c2b小程序(特定c2b定制商家使用,请使用/product/getProductUpdateRule接口获取是否支持) + IsC2bSwitchOn *bool `json:"is_c2b_switch_on"` + // 支持c2b定制时的小程序id(特定c2b定制商家使用,请使用/product/getProductUpdateRule接口获取是否支持) + MicroAppId *string `json:"micro_app_id"` + // 是否是自动充值商品 + IsAutoCharge *bool `json:"is_auto_charge"` + // 导购短标题,短标题可用于物流打单及商品搜索场景,若未填写,则系统将智能生成最优短标题在商详购买页面展示,说明详见:https://school.jinritemai.com/doudian/web/article/aHUW2MCvHqF3?from=shop_article + ShortProductName *string `json:"short_product_name"` // 售后服务新结构(老的after_sale_service中的字段后续会慢慢迁移到这里) AfterSaleServiceV2 *AfterSaleServiceV2 `json:"after_sale_service_v2"` + // 规格详细信息,代替specs和spec_name + SpecInfo *SpecInfo `json:"spec_info"` + // 新sku参数,代替spec_prices + SpecPricesV2 []SpecPricesV2Item `json:"spec_prices_v2"` + // true:主动设置库存类型(仅对区域库存生效,普通库存、阶梯库存不受此字段影响) + WithSkuType *bool `json:"with_sku_type"` + // 通过/product/getRecommendName接口推荐的商品标题后缀(注意系统根据类目属性生成后缀字符串时,前面可能有一个空格) + NameSuffix *string `json:"name_suffix"` + // 是否勾选使用品牌名, 注意勾选时需要接入/product/getRecommendName接口 + UseBrandName *bool `json:"use_brand_name"` + // 跨境物流信息 + OpenLogisticsInfo *OpenLogisticsInfo `json:"open_logistics_info"` + // 商品价格是否含税,跨境必需填1。 1:商品价格含税 2:商品价格不含税 + PriceHasTax *string `json:"price_has_tax"` + // 商品是否跨境、教育等(跨境/海南商品填写2)) + BizKind *int64 `json:"biz_kind"` + // 商品定制属性填写,(即时零售,外卖业务填写) + CustomProperty *CustomProperty `json:"custom_property"` + // 测评短视频开关 + IsEvaluateOpened *bool `json:"is_evaluate_opened"` + // 商品默认处理时长 + DefaultProcessTime *DefaultProcessTime `json:"default_process_time"` + // 管理单元ID + CompanyId *int64 `json:"company_id"` + // 是否二手数码(成色机) + IsSecondHandDigital *bool `json:"is_second_hand_digital"` + // 预测记录id,类目预测记录key=category_recommend_id + RecommendIds *map[string]string `json:"recommend_ids"` + // 虚拟商品设置是否订单展示核销去使用 + ShowCheckoutEntry *bool `json:"show_checkout_entry"` + // 自提备货时长(单位天);自提商品且不管理门店库存时必填 + PickupPrepareTime *int64 `json:"pickup_prepare_time"` + // 上门安装模版,传递为空不处理,传递0代表C模式,传递>0代表A/B模式 + HomeInstallServiceTemplateId *int64 `json:"home_install_service_template_id"` + // 属性图,key=属性id + CategoryPropertyPics *map[int64]CategoryPropertyPicsItem `json:"category_property_pics"` +} +type ReferencePriceCertificate struct { + // 图片url需要使用商品素材中心的url并且只能有一张 + CertificateUrls []string `json:"certificate_urls"` + // 通过/product/getProductUpdateRule获取可选的参考价格类型 + CertificateType *int64 `json:"certificate_type"` } - type AfterSaleServiceV2 struct { - ThreeGuarantees struct { - Duration int64 `json:"duration"` // 售后天数 - ServiceType int64 `json:"service_type"` // 服务类型 1-寄修 2-延保 - } - IsLargeProduct int64 `json:"is_large_product"` // 当前商品是否是大件商品 + // 当前商品是否是大件商品 + IsLargeProduct *int64 `json:"is_large_product"` + // 三包服务配置 + ThreeGuarantees *ThreeGuarantees `json:"three_guarantees"` +} +type RecruitInfo struct { + // 招商类型 + RecruitType string `json:"recruit_type"` + // 发品源 + RecruitSource *string `json:"recruit_source"` + // 线索ID + RecruitFollowId string `json:"recruit_follow_id"` +} +type ThreeGuarantees struct { + // 售后天数 + Duration *int64 `json:"duration"` + // 服务类型 1-寄修 2-延保 + ServiceType *int64 `json:"service_type"` +} +type PackageSkuItem struct { + // 组套子品skuid + SubSkuId *int64 `json:"sub_sku_id"` + // 组套名称 + ShortName *string `json:"short_name"` + // 组合数量 + ComboNum *int64 `json:"combo_num"` + // 组套子品id + SubProductId *int64 `json:"sub_product_id"` +} +type MeasureInfo struct { + // 模块内容 + Values []ValuesItem `json:"values"` + // 模版id + TemplateId *int64 `json:"template_id"` +} +type SpecInfo struct { + // 规格内容 + SpecValues []SpecValuesItem `json:"spec_values"` +} +type CustomsReportInfo struct { + // 法定第一计量单位 + FirstMeasureUnit *string `json:"first_measure_unit"` + // 品牌 + ReportBrandName *string `json:"report_brand_name"` + // 条形码 + BarCode *string `json:"bar_code"` + // 法定第二计量数量 + SecondMeasureQty *float64 `json:"second_measure_qty"` + // 品名 + ReportName *string `json:"report_name"` + // 法定第一计量数量 + FirstMeasureQty *float64 `json:"first_measure_qty"` + // 规格型号 + GModel *string `json:"g_model"` + // 海关代码 + HsCode *string `json:"hs_code"` + // 用途 + Usage *string `json:"usage"` + // 法定第二计量单位 + SecondMeasureUnit *string `json:"second_measure_unit"` + // 售卖单位 + Unit *string `json:"unit"` } diff --git a/platformapi/tiktok_shop/sdk-golang/api/product_addV2/response/product_addV2_response.go b/platformapi/tiktok_shop/sdk-golang/api/product_addV2/response/product_addV2_response.go index 554f2341..e6bdae34 100644 --- a/platformapi/tiktok_shop/sdk-golang/api/product_addV2/response/product_addV2_response.go +++ b/platformapi/tiktok_shop/sdk-golang/api/product_addV2/response/product_addV2_response.go @@ -21,6 +21,8 @@ type SkuItem struct { SpecDetailId2 int64 `json:"spec_detail_id2"` // 子规格id SpecDetailId3 int64 `json:"spec_detail_id3"` + // 所有的规格值id,代替spec_detail_id123 + SpecDetailIds []int64 `json:"spec_detail_ids"` } type ProductAddV2Data struct { // product_id diff --git a/platformapi/tiktok_shop/sdk-golang/api/product_batchGetChannelCategoryMapping/request/product_batchGetChannelCategoryMapping_request.go b/platformapi/tiktok_shop/sdk-golang/api/product_batchGetChannelCategoryMapping/request/product_batchGetChannelCategoryMapping_request.go new file mode 100644 index 00000000..ce6995f0 --- /dev/null +++ b/platformapi/tiktok_shop/sdk-golang/api/product_batchGetChannelCategoryMapping/request/product_batchGetChannelCategoryMapping_request.go @@ -0,0 +1,54 @@ +package product_batchGetChannelCategoryMapping_request + +import ( + "encoding/json" + product_batchGetChannelCategoryMapping_response "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/product_batchGetChannelCategoryMapping/response" + doudian_sdk "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/core" +) + +type ProductBatchGetChannelCategoryMappingRequest struct { + doudian_sdk.BaseDoudianOpApiRequest + Param *ProductBatchGetChannelCategoryMappingParam +} + +func (c *ProductBatchGetChannelCategoryMappingRequest) GetUrlPath() string { + return "/product/batchGetChannelCategoryMapping" +} + +func New() *ProductBatchGetChannelCategoryMappingRequest { + request := &ProductBatchGetChannelCategoryMappingRequest{ + Param: &ProductBatchGetChannelCategoryMappingParam{}, + } + request.SetConfig(doudian_sdk.GlobalConfig) + request.SetClient(doudian_sdk.DefaultDoudianOpApiClient) + return request + +} + +func (c *ProductBatchGetChannelCategoryMappingRequest) Execute(accessToken *doudian_sdk.AccessToken) (*product_batchGetChannelCategoryMapping_response.ProductBatchGetChannelCategoryMappingResponse, error) { + responseJson, err := c.GetClient().Request(c, accessToken) + if err != nil { + return nil, err + } + response := &product_batchGetChannelCategoryMapping_response.ProductBatchGetChannelCategoryMappingResponse{} + _ = json.Unmarshal([]byte(responseJson), response) + return response, nil + +} + +func (c *ProductBatchGetChannelCategoryMappingRequest) GetParamObject() interface{} { + return c.Param +} + +func (c *ProductBatchGetChannelCategoryMappingRequest) GetParams() *ProductBatchGetChannelCategoryMappingParam { + return c.Param +} + +type ReqItemsItem struct { + // 类目ID + CategoryId *int64 `json:"category_id"` +} +type ProductBatchGetChannelCategoryMappingParam struct { + // 一次查询最多50个 + ReqItems []ReqItemsItem `json:"req_items"` +} diff --git a/platformapi/tiktok_shop/sdk-golang/api/product_batchGetChannelCategoryMapping/response/product_batchGetChannelCategoryMapping_response.go b/platformapi/tiktok_shop/sdk-golang/api/product_batchGetChannelCategoryMapping/response/product_batchGetChannelCategoryMapping_response.go new file mode 100644 index 00000000..e7048c6a --- /dev/null +++ b/platformapi/tiktok_shop/sdk-golang/api/product_batchGetChannelCategoryMapping/response/product_batchGetChannelCategoryMapping_response.go @@ -0,0 +1,30 @@ +package product_batchGetChannelCategoryMapping_response + +import ( + doudian_sdk "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/core" +) + +type ProductBatchGetChannelCategoryMappingResponse struct { + doudian_sdk.BaseDoudianOpApiResponse + Data *ProductBatchGetChannelCategoryMappingData `json:"data"` +} +type CategoryMappingsItem struct { + // 状态:1有效;2无效 + Valid int64 `json:"valid"` + // 映射类型:0门捷列夫类目到标准类目;1标准类目到门捷列夫类目 + MappingType int32 `json:"mapping_type"` + // 映射关系类型:0一对一;1一对多;2多对一;3多对多 + RelationType int32 `json:"relation_type"` + // 映射类目id + MappingCategoryId int64 `json:"mapping_category_id"` +} +type RespItemsItem struct { + // 映射列表 + CategoryMappings []CategoryMappingsItem `json:"category_mappings"` + // 入参类目ID + SourceCategoryId int64 `json:"source_category_id"` +} +type ProductBatchGetChannelCategoryMappingData struct { + // 映射关系返回结果列表 + RespItems []RespItemsItem `json:"resp_items"` +} diff --git a/platformapi/tiktok_shop/sdk-golang/api/product_editV2/request/product_editV2_request.go b/platformapi/tiktok_shop/sdk-golang/api/product_editV2/request/product_editV2_request.go index ed7d782c..8c596994 100644 --- a/platformapi/tiktok_shop/sdk-golang/api/product_editV2/request/product_editV2_request.go +++ b/platformapi/tiktok_shop/sdk-golang/api/product_editV2/request/product_editV2_request.go @@ -44,193 +44,481 @@ func (c *ProductEditV2Request) GetParams() *ProductEditV2Param { return c.Param } -type QualityAttachmentsItem struct { - // 1-图片,2-pdf - MediaType int64 `json:"media_type"` - // 凭证url - Url string `json:"url"` +type CpvPathItem struct { + // 如具体白色系的销售属性值id + Cpvid int64 `json:"cpvid"` + // 如色系的销售属性id + Cpid int64 `json:"cpid"` } -type QualityListItem struct { - // 资质key - QualityKey string `json:"quality_key"` - // 资质名称 - QualityName string `json:"quality_name"` - // 资质 - QualityAttachments []QualityAttachmentsItem `json:"quality_attachments"` +type ValuesItem struct { + // 单位id + UnitId *int64 `json:"unit_id"` + // 模块id + ModuleId *int64 `json:"module_id"` + // 值内容,如13 + Value *string `json:"value"` + // 后缀,如- + Suffix *string `json:"suffix"` + // 前缀,示例中为空 + Prefix *string `json:"prefix"` + // 单位名称,如g + UnitName *string `json:"unit_name"` } -type PoiResource struct { - // 有效时间段,从领取日开始计算,优先级高于ValidStart-ValidEnd - ValidDays int64 `json:"valid_days"` - // 卡券有效开始时间,秒单位时间戳 - ValidStart int64 `json:"valid_start"` - // 卡券有效截止时间,秒单位时间戳 - ValidEnd int64 `json:"valid_end"` - // 客服电话 - ServiceNum string `json:"service_num"` - // 领取须知 - Notification string `json:"notification"` - // 平台产生券码: 1 ; 合作方api实时传入的券码: 4 - CodeType int64 `json:"code_type"` - // 券码总量,0/-1表示不限制,平台券时须\u003e0 - Count int64 `json:"count"` - // 0-不支持二次兑换,1-支持二次兑换 - CouponSecondExchange int64 `json:"couponSecondExchange"` - // 可核销总次数 - TotalCanUseCount int32 `json:"total_can_use_count"` - // 兑换链接 - Link string `json:"link"` - // 券码使用条件 - Condition string `json:"condition"` - // 数组当前只支持一个元素且只可为 1或2,其中 1 表示随时退+过期自动退,2 表示不支持退 - CouponReturnMethods []int64 `json:"coupon_return_methods"` +type MeasureInfo struct { + // 度量衡模版id,根据/getProductUpdateRule中回填 + TemplateId *int64 `json:"template_id"` + // 度量衡模块信息,如示例中13克为一个模块 + Values []ValuesItem `json:"values"` +} +type ValuesItem_4 struct { + // 规格值的导航样式路径信息,如色系->色值 + CpvPath []CpvPathItem `json:"cpv_path"` + // 规格值名称 + ValueName string `json:"value_name"` + // 度量衡结构化信息,如单果规格的规格值10-13g,包含两个模块:{ "measure_info": { "template_id": 50, "values": [ { "module_id": 44, "prefix": "", "suffix": "-", "value": "10" }, { "module_id": 45, "prefix": "", "suffix": "", "value": "13", "unit_id": 2, "unit_name": "g" } ] } + MeasureInfo *MeasureInfo `json:"measure_info"` + // 标准销售属性值id + ValueId *int64 `json:"value_id"` + // 规格值备注信息,如偏大 + Remark *string `json:"remark"` +} +type SpecValuesItem struct { + // 规格项名称,如颜色 + PropertyName string `json:"property_name"` + // 标准销售属性id + PropertyId *int64 `json:"property_id"` + // 规格值 + Values []ValuesItem_4 `json:"values"` +} +type PropertyDetailItem struct { + // 商品定制属性明细名称 + Name *string `json:"name"` + // 属性扩展信息 + ExtraInfo *ExtraInfo `json:"extra_info"` +} +type SellPropertiesItem struct { + // 规格值名称 + ValueName *string `json:"value_name"` + // 规格名称 + PropertyName *string `json:"property_name"` +} +type Cargo struct { + // 货品id + CargoId *string `json:"cargo_id"` + // 货品类型 + SourceType *int64 `json:"source_type"` +} +type UnitPriceInfo struct { + // 废弃字段,请写死传0 + ProcessCharge int64 `json:"process_charge"` + // 价格规则类型:1表示投资金2表示首饰金 + PriceRuleType int32 `json:"price_rule_type"` +} +type MultiTimeStocksItem struct { + // 库存数 + StockNum *int64 `json:"stock_num"` + // 时效值 + TimeType *int64 `json:"time_type"` + // 时效描述 + TimeDesc *string `json:"time_desc"` +} +type CustomsReportInfo struct { + // 法定第一计量单位 + FirstMeasureUnit *string `json:"first_measure_unit"` + // 法定第二计量单位 + SecondMeasureUnit *string `json:"second_measure_unit"` + // 法定第二计量数量 + SecondMeasureQty *float64 `json:"second_measure_qty"` + // 法定第一计量数量 + FirstMeasureQty *float64 `json:"first_measure_qty"` + // 品名 + ReportName *string `json:"report_name"` + // 规格型号 + GModel *string `json:"g_model"` + // 条形码 + BarCode *string `json:"bar_code"` + // 海关代码 + HsCode *string `json:"hs_code"` + // 品牌 + ReportBrandName *string `json:"report_brand_name"` + // 售卖单位 + Unit *string `json:"unit"` + // 用途 + Usage *string `json:"usage"` +} +type DeliveryInfosItem struct { + // 信息计量单位 + InfoUnit *string `json:"info_unit"` + // 信息类型 + InfoType *string `json:"info_type"` + // 信息值 + InfoValue *string `json:"info_value"` +} +type CustomPropertyGroupsItem struct { + // 商品定制属性组名称 + Name *string `json:"name"` + // 商品定制属性明细 + PropertyDetail []PropertyDetailItem `json:"propertyDetail"` +} +type CategoryPropertyPicsItem struct { + // 属性图url + Urls []string `json:"urls"` +} +type DefaultProcessTime struct { + // 商品维度默认处理时长,单位:秒,不能超过24小时。 + Value *int64 `json:"value"` +} +type QualityInspectionInfo struct { + // 质检证书编码 + CertificateCode *string `json:"certificate_code"` + // 机构编码,请通过/inspection/QueryBtasAgencyList接口获取 + Agency *string `json:"agency"` + // 1: 单库存模式,只允许售卖一个sku;2: 多库存模式,不限售卖次数 + Mode *int32 `json:"mode"` + // 是否支持前置质检 + Supported *bool `json:"supported"` +} +type OpenLogisticsInfo struct { + // 税金承担方(一般都填0,走商家承担):0商家承担,1用户承担 + TaxPayer *int64 `json:"tax_payer"` + // 品牌所在地id + BrandCountryId *int64 `json:"brand_country_id"` + // 商品净重 + NetWeightQty *float64 `json:"net_weight_qty"` + // 原产国id + OriginCountryId *int64 `json:"origin_country_id"` + // 货源国id + SourceCountryId *int64 `json:"source_country_id"` + // 通关模式,1:BBC 2:BC 3:CC邮关 + CustomsClearType *int64 `json:"customs_clear_type"` + // 商家仓id + CrossWarehouseId *string `json:"cross_warehouse_id"` +} +type ExtraInfo struct { + // 属性维度的处理时长,单位:秒,不能超过24小时。 + ProcessTime *int64 `json:"process_time"` } type DelayRule struct { - // 是否开启特殊日期延迟发货 - Enable bool `json:"enable"` - // 1 时间点;2 时间范围 - ConfigType int32 `json:"config_type"` - // 特殊日期延迟发货时间最晚发货时间,时间戳,单位秒:当config_type=1时,传时间戳,代表最晚x发货;当config_type=2时,传天数,代表延迟x天发货 - ConfigValue int64 `json:"config_value"` // 特殊日期延迟发货时间下单开始时间,时间戳,单位秒 StartTime int64 `json:"start_time"` // 特殊日期延迟发货时间下单结束时间,时间戳,单位秒 EndTime int64 `json:"end_time"` + // 1 时间点;2 时间范围 + ConfigType int32 `json:"config_type"` + // 是否开启特殊日期延迟发货 + Enable bool `json:"enable"` + // 特殊日期延迟发货时间最晚发货时间,时间戳,单位秒:当config_type=1时,传时间戳,代表最晚x发货;当config_type=2时,传天数,代表延迟x天发货 + ConfigValue int64 `json:"config_value"` +} +type ReferencePriceCertificate struct { + // 参考价凭证类型,通过/product/getProductUpdateRule获取可选类型 + CertificateType *int64 `json:"certificate_type"` + // 凭证图片,必须是商品素材中心URL,最多允许一张图片 + CertificateUrls []string `json:"certificate_urls"` +} +type ThreeGuarantees struct { + // 售后天数 + Duration *int64 `json:"duration"` + // 服务类型 1-寄修 2-延保 + ServiceType *int64 `json:"service_type"` +} +type TaxExemptionSkuInfo struct { + // 是否套装(0 否 1 是) + IsSuit *int32 `json:"is_suit"` + // 套装数量 + SuitNum *int64 `json:"suit_num"` + // 净含量 + Volume *int64 `json:"volume"` +} +type SpecPricesV2Item struct { + // sku规格信息:规格项规格值 + SellProperties []SellPropertiesItem `json:"sell_properties"` + // 供货价,单位:分,nil代表不修改,0代表清空 + SupplyPrice *int64 `json:"supply_price"` + // skuId,支持基于skuId修改sku信息 + SkuId *int64 `json:"sku_id"` + // 时效库存 + MultiTimeStocks []MultiTimeStocksItem `json:"multi_time_stocks"` + // 货品信息,如果传0 0 表示解绑) + Cargo *Cargo `json:"cargo"` + // 海南免税:Sku 额外信息 + TaxExemptionSkuInfo *TaxExemptionSkuInfo `json:"tax_exemption_sku_info"` + // 阶梯库存数 + StepStockNum *int64 `json:"step_stock_num"` + // 海关申报要素 + CustomsReportInfo *CustomsReportInfo `json:"customs_report_info"` + // 价格 + Price *int64 `json:"price"` + // 组套包信息 + PackageSku []PackageSkuItem `json:"package_sku"` + // 库存类型 0-普通库存,1-区域库存,10-阶梯库存 + SkuType *int64 `json:"sku_type"` + // SKU维度预售发货延迟时间 + PresellDelay *int64 `json:"presell_delay"` + // 商品规格值id:懂车帝场景传递 + SpecValueLibId *int64 `json:"spec_value_lib_id"` + // 商家编码 + Code *string `json:"code"` + // SKU运输信息 + DeliveryInfos []DeliveryInfosItem `json:"delivery_infos"` + // 库存数量 + StockNum *int64 `json:"stock_num"` + // 供应商编码 + SupplierId *string `json:"supplier_id"` + // 仓ID -> 库存数量 + StockNumMap *map[string]int64 `json:"stock_num_map"` + // 外部sku_id-string + OuterSkuId *string `json:"outer_sku_id"` + // sku分类信息,对应枚举值"main_sale_single_product" - 主售款(单品)"main_sale_multi_product" - "主售款(多件装)""main_sale_combination" - 主售款(组合品)"non_main_sale" - 非主售款"information_description" - 信息说明/防拍 + SkuClassificationType *string `json:"sku_classification_type"` + // 条码信息 + Barcodes []string `json:"barcodes"` + // 规格型号编码-国补场景下国补商品型号 + SpecModelCode []string `json:"spec_model_code"` + // 黄金加工费,单位:分,nil代表不修改 + GoldProcessCharge *int64 `json:"gold_process_charge"` + // true:表示sku上架 false:表示sku下架 + SkuStatus *bool `json:"sku_status"` +} +type SpecInfo struct { + // 规格项,如颜色、尺码 + SpecValues []SpecValuesItem `json:"spec_values"` +} +type QualityAttachmentsItem struct { + // 凭证url + Url string `json:"url"` + // 1-图片 + MediaType int64 `json:"media_type"` +} +type QualityListItem struct { + // 资质名称 + QualityName string `json:"quality_name"` + // 资质key + QualityKey string `json:"quality_key"` + // 资质 + QualityAttachments []QualityAttachmentsItem `json:"quality_attachments"` +} +type AfterSaleServiceV2 struct { + // 三包服务配置 + ThreeGuarantees *ThreeGuarantees `json:"three_guarantees"` + // 当前商品是否是大件商品 + IsLargeProduct *int64 `json:"is_large_product"` +} +type PackageSkuItem struct { + // 组套包子品商品id + SubProductId *int64 `json:"sub_product_id"` + // 组套名称 + ShortName *string `json:"short_name"` + // 组套包子品skuId + SubSkuId *int64 `json:"sub_sku_id"` + // 组套包子品数量 + ComboNum *int64 `json:"combo_num"` +} +type PoiResource struct { + // 门店库id + PoiLibId *int64 `json:"poi_lib_id"` + // 券码总量,0/-1表示不限制,平台券时须\u003e0 + Count *int64 `json:"count"` + // 领取须知 + Notification *string `json:"notification"` + // 券码使用条件 + Condition *string `json:"condition"` + // 数组当前只支持一个元素且只可为 1或2,其中 1 表示随时退+过期自动退,2 表示不支持退 + CouponReturnMethods []int64 `json:"coupon_return_methods"` + // 有效时间段,从领取日开始计算,优先级高于ValidStart-ValidEnd + ValidDays *int64 `json:"valid_days"` + // 卡券有效开始时间,秒单位时间戳 + ValidStart *int64 `json:"valid_start"` + // 0-不支持二次兑换,1-支持二次兑换 + CouponSecondExchange *int64 `json:"couponSecondExchange"` + // 可核销总次数 + TotalCanUseCount *int32 `json:"total_can_use_count"` + // 平台产生券码: 1 ; 合作方api实时传入的券码: 4 + CodeType *int64 `json:"code_type"` + // 卡券有效截止时间,秒单位时间戳 + ValidEnd *int64 `json:"valid_end"` + // 兑换链接 + Link *string `json:"link"` + // 客服电话 + ServiceNum *string `json:"service_num"` +} +type CustomProperty struct { + // 商品定制属性组 + CustomPropertyGroups []CustomPropertyGroupsItem `json:"customPropertyGroups"` } - type ProductEditV2Param struct { // 商品ID ProductId int64 `json:"product_id"` // 0-普通,3-虚拟,6玉石闪购,7云闪购 - ProductType int64 `json:"product_type"` + ProductType *int64 `json:"product_type"` // 叶子类目ID通过/shop/getShopCategory接口获取 - CategoryLeafId int64 `json:"category_leaf_id"` - // 属性名称|属性值 之间用|分隔, 多组之间用^分开 - ProductFormat string `json:"product_format"` - // 商品名称,最多60个字符(30个汉字),不能含emoj表情 - Name string `json:"name"` + CategoryLeafId *int64 `json:"category_leaf_id"` + // 商品名称,至少8个字符(4个汉字),最多60个字符(30个汉字),不能含emoj表情 + Name *string `json:"name"` // 商家推荐语,不能含emoj表情 - RecommendRemark string `json:"recommend_remark"` - // 商品轮播图,多张图片用 \"|\" 分开,第一张图为主图,最多5张,至少600x600,大小不超过1M 注:\"pic\"、\"description\"、\"spec_pic\"这三个字段里的传入的图片数量总和,不得超过50张。 - Pic string `json:"pic"` - // 商品轮播图,多张图片用 \"|\" 分开,第一张图为主图,最多5张,至少600x600,大小不超过1M 注:\"pic\"、\"description\"、\"spec_pic\"这三个字段里的传入的图片数量总和,不得超过50张。 - Description string `json:"description"` + RecommendRemark *string `json:"recommend_remark"` + // 商品轮播图,多张图片用 \"|\" 分开,第一张图为主图,最多5张,至少600x600,大小不超过5M + Pic *string `json:"pic"` + // 商详图片,多张图片用 | 分开。图片数量总和,不得超过50张。 + Description *string `json:"description"` // 已废弃,支付方式,0货到付款 1在线支付,2,货到付款+在线支付 - PayType int64 `json:"pay_type"` + PayType *int64 `json:"pay_type"` // 海南免税生效。 0:离岛免税、1:邮寄、2:离岛自提+邮寄 - DeliveryMethod int32 `json:"delivery_method"` + DeliveryMethod *int32 `json:"delivery_method"` // 海南免税:海关限购分类编码 - CdfCategory string `json:"cdf_category"` + CdfCategory *string `json:"cdf_category"` // 1 减库存类型:1-拍下减库存 2-付款减库存 - ReduceType int64 `json:"reduce_type"` - // 同店商品推荐:为空表示使用系统推荐;多个product_id使用“|”分开 - AssocIds string `json:"assoc_ids"` + ReduceType *int64 `json:"reduce_type"` + // 【已废弃】同店商品推荐:为空表示使用系统推荐;多个product_id使用“|”分开 + AssocIds *string `json:"assoc_ids"` // 运费模板id,传0表示包邮,通过/freightTemplate/list接口获取 - FreightId int64 `json:"freight_id"` - // 重量 - Weight float64 `json:"weight"` + FreightId *int64 `json:"freight_id"` + // 重量。数据范围需要小于10000,如果超过,请更换的weight_unit + Weight *float64 `json:"weight"` // 重量单位,0-kg, 1-g - WeightUnit int64 `json:"weight_unit"` + WeightUnit *int64 `json:"weight_unit"` // delivery_delay_day: 承诺发货时间,单位是天,不传则默认为2天。现货发货(presell_type=0)和阶梯发货模式(presell_type=2)时必填,支持传入9999 、1、 2 (分别表示当日发、次日发、48小时发),具体支持传入的参数范围/product/getProductUpdateRule - DeliveryDelayDay int64 `json:"delivery_delay_day"` + DeliveryDelayDay *int64 `json:"delivery_delay_day"` // 发货模式,0-现货发货,1-预售发货,2-阶梯发货,默认0 - PresellType int64 `json:"presell_type"` + PresellType *int64 `json:"presell_type"` // 全款预售模式时的发货时间/阶梯模式下阶梯发货时间,具体支持传入的参数范围/product/getProductUpdateRule - PresellDelay int64 `json:"presell_delay"` + PresellDelay *int64 `json:"presell_delay"` // 预售结束时间,格式2020-02-21 18:54:27,最多支持设置距离当前30天 - PresellEndTime string `json:"presell_end_time"` - // 是否支持7天无理由,0不支持,1支持,2支持(拆封后不支持) - Supply7dayReturn int64 `json:"supply_7day_return"` + PresellEndTime *string `json:"presell_end_time"` + // 【该字段将在2023年4月30日下线,请开发使用最新的after_sale_service字段传值;】是否支持7天无理由,0不支持,1支持,2支持(拆封后不支持) + Supply7dayReturn *int64 `json:"supply_7day_return"` // 客服电话号码 - Mobile string `json:"mobile"` + Mobile *string `json:"mobile"` // false仅保存,true保存+提审 Commit bool `json:"commit"` - // 品牌id (请求店铺授权品牌接口获取) (效果即为商品详情页面中的品牌字段) - BrandId int64 `json:"brand_id"` // 商家可见备注 - Remark string `json:"remark"` - // 外部product_id - //OutProductId int64 `json:"out_product_id"` - // 外部product id - //OuterProductId string `json:"outer_product_id"` // 资质信息,可通过/product/qualificationConfig获取 + Remark *string `json:"remark"` + // 外部product_id。超市小时达场景不推荐使用 + OutProductId *int64 `json:"out_product_id"` + // 资质信息,可通过/product/qualificationConfig获取 QualityList []QualityListItem `json:"quality_list"` - // 如果不填,则规格名为各级规格名用 \"-\" 自动生成 - SpecName string `json:"spec_name"` - // 店铺通用规格,能被同类商品通用。多规格用^分隔,规格与规格值用|分隔,多个规格值用,分隔。如果创建或编辑现货+预售商品或新预售商品时,须包含发货时效,如:颜色|黑色,白色,黄色^尺码|S,M,L^发货时效|5天内发货,15天内发货 - Specs string `json:"specs"` - // sku详情,数量应该等于规格1规格2规格3,sku数量和规格组合数必须一致 sku不可售时,库存可设置为0。 delivery_infos为SKU物流信息,info_value为字符串类型(示例:"12"),info_type填weight,info_unit支持mg,g,kg - SpecPrices string `json:"spec_prices"` + // 【废弃不再使用,请使用spec_info参数】如果不填,则规格名为各级规格名用 \"-\" 自动生成 + SpecName *string `json:"spec_name"` + // 【废弃不再使用,请使用spec_info参数】店铺通用规格,能被同类商品通用。多规格用^分隔,规格与规格值用|分隔,多个规格值用,分隔。如果创建或编辑现货+预售商品或新预售商品时,须包含发货时效,如:颜色|黑色,白色,黄色^尺码|S,M,L^发货时效|5天内发货,15天内发货 + Specs *string `json:"specs"` + // 【字段废弃,请使用spec_prices_v2】sku详情,数量应该等于规格1规格2规格3,sku数量和规格组合数必须一致 sku不可售时,库存可设置为0。price单位为分。 delivery_infos为SKU物流信息,info_value为字符串类型(示例:"12"),info_type填weight,info_unit支持mg,g,kg,超市小时达场景主品用普通库存,子品用区域库存("sku_type": 1 // 区域库存,"stock_num_map": {"123": 99999 // 门店ID:库存数量})。gold_process_charge表示商品加工费,只有计价金类目可填并必填。sell_properties为sku规格信息,代替spec_detail_name1、spec_detail_name2、spec_detail_name3,支持填写超过三级规格,样式:[{"property_id":123,"property_name":"颜色","value_id":456,"value_name":"红色","remark":"偏深"},{"property_id":789,"property_name":"净含量","value_id":891,"value_name":"30ml","remark":null,"measurement":{"measure_unit":"ml","measure_unit_id":4,"value":"30"}}] 其中property_id规格项属性id,自定义时传0,property_name为规格项名称,value_id为规格值属性id自定义时传0,value_name为规格值名称,remark为规格值备注(选填),measurement为度量衡信息,当规格值为度量衡属性自定义值时传递。 + SpecPrices *string `json:"spec_prices"` // 如颜色-尺寸, 颜色就是主规格, 颜色如黑,白,黄,它们图片url以逗号分隔 注:\"pic\"、\"description\"、\"spec_pic\"这三个字段里的传入的图片数量总和,不得超过50张。 - SpecPic string `json:"spec_pic"` + SpecPic *string `json:"spec_pic"` // 每个用户每次下单限购件数 - MaximumPerOrder int64 `json:"maximum_per_order"` + MaximumPerOrder *int64 `json:"maximum_per_order"` // 每个用户累计限购件数 - LimitPerBuyer int64 `json:"limit_per_buyer"` + LimitPerBuyer *int64 `json:"limit_per_buyer"` // 每个用户每次下单至少购买的件数 - MinimumPerOrder int64 `json:"minimum_per_order"` - // 通过/product/getCatePropertyV2获取 格式:{"property_id":[{"value":value,"name":"property_name","diy_type":0}]}, name的类型是string,value和diy_type的类型是number - ProductFormatNew string `json:"product_format_new"` + MinimumPerOrder *int64 `json:"minimum_per_order"` + // 通过/product/getCatePropertyV2获取 格式:{"property_id":[{"value":value,"name":"property_name","diy_type":0}]}, name的类型是string,value和diy_type的类型是number 度量衡参照open度量衡对接文档填写 + ProductFormatNew *string `json:"product_format_new"` // spu id - SpuId int64 `json:"spu_id"` + SpuId *int64 `json:"spu_id"` // 可预约发货天数 - AppointDeliveryDay int64 `json:"appoint_delivery_day"` + AppointDeliveryDay *int64 `json:"appoint_delivery_day"` // third_url - ThirdUrl string `json:"third_url"` + ThirdUrl *string `json:"third_url"` // extra - Extra string `json:"extra"` + Extra *string `json:"extra"` // src - Src string `json:"src"` + Src *string `json:"src"` + // 外部product id。超市小时达场景不推荐使用 + OuterProductId *string `json:"outer_product_id"` // standard_brand_id,通过/brand/list获取,无品牌id则传596120136 - StandardBrandId int64 `json:"standard_brand_id"` + StandardBrandId *int64 `json:"standard_brand_id"` // 卡券类型需要传true - NeedCheckOut bool `json:"need_check_out"` + NeedCheckOut *bool `json:"need_check_out"` // 卡券信息 PoiResource *PoiResource `json:"poi_resource"` // 使用qualityList覆盖当前商品资质,qualityList传空代表清空 - ForceUseQualityList bool `json:"force_use_quality_list"` + ForceUseQualityList *bool `json:"force_use_quality_list"` // 汽车Vin码 - CarVinCode string `json:"car_vin_code"` + CarVinCode *string `json:"car_vin_code"` // 0:全款预售,1:sku预售,2:现货+预售 ,3:新预售 - PresellConfigLevel int64 `json:"presell_config_level"` + PresellConfigLevel *int64 `json:"presell_config_level"` // 充值模式 - NeedRechargeMode bool `json:"need_recharge_mode"` + NeedRechargeMode *bool `json:"need_recharge_mode"` // 多账号模板 - //AccountTemplateId string `json:"account_template_id"` + AccountTemplateId *string `json:"account_template_id"` // 全款预售和sku预售时传递,其他不传: 0 预售结束后发货 1支付完成后发货 - PresellDeliveryType int64 `json:"presell_delivery_type"` + PresellDeliveryType *int64 `json:"presell_delivery_type"` // 白底图url(仅素材中心url有效) - WhiteBackGroundPicUrl string `json:"white_back_ground_pic_url"` + WhiteBackGroundPicUrl *string `json:"white_back_ground_pic_url"` // 3:4长图url(仅素材中心url有效) - LongPicUrl string `json:"long_pic_url"` + LongPicUrl *string `json:"long_pic_url"` // 售后服务参数,key:value格式 supply_day_return_selector(7天无理由选项):N天-政策代号,N只支持7和15 supply_red_ass_return(红屁屁无忧):0不支持,1支持 supply_allergy_return(过敏无忧,仅跨境可选):0不支持,1支持 damaged_order_return(坏损包退):0不支持,1支持 support_allergy_returnV2(过敏包退,境内可选):0不支持,1支持 - AfterSaleService map[string]string `json:"after_sale_service"` + AfterSaleService *map[string]string `json:"after_sale_service"` // 售卖方式;0:全渠道手售卖,1:仅指定直播间售卖 SellChannel []int64 `json:"sell_channel"` // 审核通过后上架售卖时间配置:0-立即上架售卖 1-放入仓库 - StartSaleType int64 `json:"start_sale_type"` + StartSaleType *int64 `json:"start_sale_type"` // 特殊日期延迟发货规则 DelayRule *DelayRule `json:"delay_rule"` // 主图视频ID,可以先通过https://op.jinritemai.com/docs/api-docs/69/1617接口上传视频,获取审核通过的视频素材ID进行传入 - MaterialVideoId string `json:"material_video_id"` + MaterialVideoId *string `json:"material_video_id"` // 提取方式新字段,推荐使用。"0": 普通商品-使用物流发货, "1": 虚拟商品-无需物流与电子交易凭证, "2": 虚拟商品-使用电子交易凭证, "3": 虚拟商品-充值直连 - PickupMethod string `json:"pickup_method"` + PickupMethod *string `json:"pickup_method"` // 尺码模板ID - SizeInfoTemplateId int64 `json:"size_info_template_id"` + SizeInfoTemplateId *int64 `json:"size_info_template_id"` // 外部商品url - SubstituteGoodsUrl string `json:"substitute_goods_url"` + SubstituteGoodsUrl *string `json:"substitute_goods_url"` // 销售渠道类型,可选onlineOnly(纯电商,仅在线上售卖)或sameAsOffline(专柜同款,线上线下都有售卖),云零售商家(https://fxg.jinritemai.com/ffa/merchant-growth/cloud-retail)可以设置 - SaleChannelType string `json:"sale_channel_type"` + SaleChannelType *string `json:"sale_channel_type"` // 通过/product/getRecommendName接口推荐的商品标题前缀(注意系统根据类目属性生成前缀字符串时,末尾有一个空格) - NamePrefix string `json:"name_prefix"` + NamePrefix *string `json:"name_prefix"` // 门店ID - StoreId int64 `json:"store_id"` + StoreId *int64 `json:"store_id"` // 主商品ID - MainProductId int64 `json:"main_product_id"` + MainProductId *int64 `json:"main_product_id"` // 限售模板ID - SaleLimitId int64 `json:"sale_limit_id"` -} - -type ProductEditV2Param2 struct { - // 商品ID - ProductId int64 `json:"product_id"` - Commit bool `json:"commit"` + SaleLimitId *int64 `json:"sale_limit_id"` + // 商品参考价 + ReferencePrice *int64 `json:"reference_price"` + // 参考价凭证相关信息 + ReferencePriceCertificate *ReferencePriceCertificate `json:"reference_price_certificate"` + // 商品主图3:4,多张图片用 \"|\" 分开,最多5张,大小不超过5M。 + MainImageThreeToFour *string `json:"main_image_three_to_four"` + // 价格规则信息 + UnitPriceInfo *UnitPriceInfo `json:"unit_price_info"` + // 前置质检相关(特定二手商家、特定二手类目使用) + QualityInspectionInfo *QualityInspectionInfo `json:"quality_inspection_info"` + // 是否支持c2b小程序(特定c2b定制商家使用,请使用/product/getProductUpdateRule接口获取是否支持) + IsC2bSwitchOn *bool `json:"is_c2b_switch_on"` + // 支持c2b定制时的小程序id(特定c2b定制商家使用,请使用/product/getProductUpdateRule接口获取是否支持) + MicroAppId *string `json:"micro_app_id"` + // 是否修改为自动充值商品 + IsAutoCharge *bool `json:"is_auto_charge"` + // 导购短标题,短标题可用于物流打单及商品搜索场景,说明详见:https://school.jinritemai.com/doudian/web/article/aHUW2MCvHqF3?from=shop_article + ShortProductName *string `json:"short_product_name"` + // 售后服务新结构(老的after_sale_service中的字段后续会慢慢迁移到这里) + AfterSaleServiceV2 *AfterSaleServiceV2 `json:"after_sale_service_v2"` + // sku新参数,建议切到新参数,后续老参数spec_prices废弃 + SpecPricesV2 []SpecPricesV2Item `json:"spec_prices_v2"` + // 规格模版详细信息 + SpecInfo *SpecInfo `json:"spec_info"` + // true:主动设置库存类型(仅对区域库存生效,普通库存、阶梯库存不受此字段影响) + WithSkuType *bool `json:"with_sku_type"` + // 通过/product/getRecommendName接口推荐的商品标题后缀(注意系统根据类目属性生成后缀字符串时,前面可能有一个空格) + NameSuffix *string `json:"name_suffix"` + // 是否勾选使用品牌名, 注意勾选时需要接入/product/getRecommendName接口 + UseBrandName *bool `json:"use_brand_name"` + // 跨境物流信息 + OpenLogisticsInfo *OpenLogisticsInfo `json:"open_logistics_info"` + // 商品定制属性。适用于到家商品场景 + CustomProperty *CustomProperty `json:"custom_property"` + // 测评模块是否打开 + IsEvaluateOpened *bool `json:"is_evaluate_opened"` + // 商品维度默认处理时长 + DefaultProcessTime *DefaultProcessTime `json:"default_process_time"` + // 预测记录id,类目预测记录key=category_recommend_id + RecommendIds *map[string]string `json:"recommend_ids"` + // 虚拟商品设置是否订单展示核销去使用 + ShowCheckoutEntry *bool `json:"show_checkout_entry"` + // 自提备货时长(单位天) + PickupPrepareTime *int64 `json:"pickup_prepare_time"` + // 上门安装模版,传递为空不处理,传递0代表绑定C模式,传递>0代表绑定/换绑 + HomeInstallServiceTemplateId *int64 `json:"home_install_service_template_id"` + // 属性图,如水洗标等,key=属性id + CategoryPropertyPics *map[int64]CategoryPropertyPicsItem `json:"category_property_pics"` } diff --git a/platformapi/tiktok_shop/sdk-golang/api/product_getCatePropertyV2/response/product_getCatePropertyV2_response.go b/platformapi/tiktok_shop/sdk-golang/api/product_getCatePropertyV2/response/product_getCatePropertyV2_response.go index 52490b8f..9b209784 100644 --- a/platformapi/tiktok_shop/sdk-golang/api/product_getCatePropertyV2/response/product_getCatePropertyV2_response.go +++ b/platformapi/tiktok_shop/sdk-golang/api/product_getCatePropertyV2/response/product_getCatePropertyV2_response.go @@ -6,6 +6,20 @@ type ProductGetCatePropertyV2Response struct { doudian_sdk.BaseDoudianOpApiResponse Data *ProductGetCatePropertyV2Data `json:"data"` } +type PropertyPicRule struct { + // 是否支持上传属性图 + Available bool `json:"available"` + // 属性图是否必填 + Required bool `json:"required"` +} +type RuleCondition struct { + // 预期值 + Value string `json:"value"` + // 运算符 + Operator string `json:"operator"` + // 度量衡模块id + ModuleId int64 `json:"module_id"` +} type OptionsItem struct { // 可选值名称 Name string `json:"name"` @@ -16,8 +30,80 @@ type OptionsItem struct { // 属性值顺序 Sequence int64 `json:"sequence"` } +type ProductGetCatePropertyV2Data struct { + // 返回参数列表 + Data []DataItem `json:"data"` + // 模板类型,SPU为1,结构化为2,默认为0(无特殊需求忽略该字段即可) + TplType int64 `json:"tpl_type"` +} +type GlobalCheckRulesItem struct { + // 报错文案 + ErrMsg string `json:"err_msg"` + // 运算符 + Operator string `json:"operator"` + // 预期值 + TargetValue string `json:"target_value"` + // 度量衡模块id + ModuleId int64 `json:"module_id"` + // 模板id + TemplateId int64 `json:"template_id"` +} +type ValidateRule struct { + // 不同单位下的值约束 + UnitRules []UnitRulesItem `json:"unit_rules"` + // date_type = date 时,有值,如YYYY-MM-DD + TimeFormat string `json:"time_format"` + // 最大值 + Max float64 `json:"max"` + // 最小值 + Min float64 `json:"min"` + // 小数位数,当data_type为float时有值 + Precision int64 `json:"precision"` + // 填写值的数据格式:integer, float, date + DataType string `json:"data_type"` +} +type ValuesItem struct { + // 值名称 + ValueName string `json:"value_name"` +} +type ValueModulesItem struct { + // 模块是否必填,为false时表示这个模块可以不填 + ValueRequired bool `json:"value_required"` + // 填写规则 + ValidateRule *ValidateRule `json:"validate_rule"` + // 可选单位,可为空 + Units []UnitsItem `json:"units"` + // 值的可选项,如材质属性可能会有:棉、麻等选项 + Values []ValuesItem `json:"values"` + // 输入类型: 枚举、输入、枚举可输入: enum, input, enum_diy + InputType string `json:"input_type"` + // 后缀 + Suffix string `json:"suffix"` + // 前缀 + Prefix string `json:"prefix"` + // 模块id + ModuleId int64 `json:"module_id"` +} +type MeasureTemplatesItem struct { + // 材质度量衡填写规则 + InputRule *InputRule `json:"input_rule"` + // 模版名称 + DisplayName string `json:"display_name"` + // 度量衡模版下的模块,可为多个,一般情况为一个,一般情况一个模块就是一个值+单位形式 + ValueModules []ValueModulesItem `json:"value_modules"` + // 度量衡模版id + TemplateId int64 `json:"template_id"` +} type DataItem struct { - // 老类目id + // 属性图规则 + PropertyPicRule *PropertyPicRule `json:"property_pic_rule"` + // 属性feature类型列表 + FeatureTypeList []int64 `json:"feature_type_list"` + // 度量衡模版,可为多个,一般情况为一个 + MeasureTemplates []MeasureTemplatesItem `json:"measure_templates"` + // 是否有下级级联属性 + HasSubProperty bool `json:"has_sub_property"` + // 【已废弃】老类目id,请使用category_id字段 Cid int64 `json:"cid"` // 属性名称 PropertyName string `json:"property_name"` @@ -41,14 +127,48 @@ type DataItem struct { Sequence int64 `json:"sequence"` // 关系id,SPU类目使用,表示自己的上一个关键属性ID RelationId int64 `json:"relation_id"` - // 是否支持枚举可输入,0表示不支持,1表示支持,支持枚举可输入的属性,在发布/编辑接口的类目属性参数中可以传入自定义的属性值,自定义属性值value为0,diy_type为1 + // 商品属性是否有支持商家自定义,1=支持自定义,0=不支持自定义。 使用场景:当开发者传入自定义的属性值时需在创建或更新商品接口的属性时,需把【product_format_new】字段中传入diy_type=1并且value=0; DiyType int64 `json:"diy_type"` // 0:非重要属性,1:重要属性 ImportantType int64 `json:"important_type"` } -type ProductGetCatePropertyV2Data struct { - // 返回参数列表 - Data []DataItem `json:"data"` - // 模板类型,SPU为1,结构化为2,默认为0(无特殊需求忽略该字段即可) - TplType int64 `json:"tpl_type"` +type UnitRulesItem struct { + // 最大值 + Max float64 `json:"max"` + // 最小值 + Min float64 `json:"min"` + // 单位id + UnitId int64 `json:"unit_id"` +} +type UnitsItem struct { + // 单位名称 + UnitName string `json:"unit_name"` + // 单位id + UnitId int64 `json:"unit_id"` +} +type RuleConstraint struct { + // 报错文案 + ErrMsg string `json:"err_msg"` + // 预期值 + Value string `json:"value"` + // 分组函数 + GroupFunc string `json:"group_func"` + // 运算符 + Operator string `json:"operator"` + // 度量衡模版id + ModuleId int64 `json:"module_id"` +} +type DependencyCheckRulesItem struct { + // 验证规则 + RuleConstraint *RuleConstraint `json:"rule_constraint"` + // 触发条件 + RuleCondition *RuleCondition `json:"rule_condition"` + // 度量衡模版id + TemplateId int64 `json:"template_id"` +} +type InputRule struct { + // 度量衡间校验规则 + DependencyCheckRules []DependencyCheckRulesItem `json:"dependency_check_rules"` + // 全局校验规则 + GlobalCheckRules []GlobalCheckRulesItem `json:"global_check_rules"` } diff --git a/platformapi/tiktok_shop/sdk-golang/api/product_getProductUpdateRule/response/product_getProductUpdateRule_response.go b/platformapi/tiktok_shop/sdk-golang/api/product_getProductUpdateRule/response/product_getProductUpdateRule_response.go index 2ccb0abe..a68417a2 100644 --- a/platformapi/tiktok_shop/sdk-golang/api/product_getProductUpdateRule/response/product_getProductUpdateRule_response.go +++ b/platformapi/tiktok_shop/sdk-golang/api/product_getProductUpdateRule/response/product_getProductUpdateRule_response.go @@ -8,91 +8,97 @@ type ProductGetProductUpdateRuleResponse struct { doudian_sdk.BaseDoudianOpApiResponse Data *ProductGetProductUpdateRuleData `json:"data"` } -type SpuControlRule struct { - // 是否支持spu发品 - SupportSpuProduct bool `json:"support_spu_product"` - // 0不管控 1弱管控 2强管控 - ControlType int64 `json:"control_type"` - // 是否支持新建spu - SupportCreateSpu bool `json:"support_create_spu"` - // 是否支持spu纠错 - SupportRectifySpu bool `json:"support_rectify_spu"` - // 是否支持spu举报 - SupportReportSpu bool `json:"support_report_spu"` - // 是否spu免审 - NoNeedAuditSpu bool `json:"no_need_audit_spu"` +type AfterSaleRule struct { + // 三包服务承诺配置规则 + ThreeGuarantees *ThreeGuarantees `json:"three_guarantees"` + // 过敏包退规则 + AllergyReturnV2Rule *AllergyReturnV2Rule `json:"allergy_return_v2_rule"` + // 大件商品规则 + LargeProductRule *LargeProductRule `json:"large_product_rule"` + // 无理由退货规则 + SupplyDayReturnRule *SupplyDayReturnRule `json:"supply_day_return_rule"` } -type StepRule struct { - // 是否支持 - Support bool `json:"support"` - // 阶梯现货部分延迟返货时间范围 +type UnitsItem struct { + // 度量衡单位id + UnitId int64 `json:"unit_id"` + // 度量衡单位名称 + UnitName string `json:"unit_name"` +} +type NormalRule_5_5 struct { + // 描述信息 + Description string `json:"description"` + // 可用的延迟发货天数 DelayOptions []int64 `json:"delay_options"` - // 是特殊时间延迟发货,可忽略 - IsSpecialDelayOption bool `json:"is_special_delay_option"` - // 阶梯发货阶梯部分发货时间最小值 - StepMinDelay int64 `json:"step_min_delay"` - // 阶梯发货阶梯部分发货时间最大值 - StepMaxDelay int64 `json:"step_max_delay"` -} -type SkuPresellRule struct { + // 不可用信息 + DenyDescription string `json:"deny_description"` + // 是否可见 + Display string `json:"display"` // 是否支持 - Support bool `json:"support"` - // 预售门槛价 - MinPresellPrice int64 `json:"min_presell_price"` - // 是否支持支付结束后发货 - SupportDeliveryAfterPay bool `json:"support_delivery_after_pay"` - // 是否支持预售结束后发货 - SupportDeliveryAfterPresell bool `json:"support_delivery_after_presell"` - // 支付结束后规则 - DeliveryAfterPayConfig *DeliveryAfterPayConfig `json:"delivery_after_pay_config"` - // 预售结束后规则 - DeliveryAfterPresellConfig *DeliveryAfterPresellConfig `json:"delivery_after_presell_config"` + Support string `json:"support"` } -type TimeSkuSpecDetialItem struct { - // 规格值 - SpecValue string `json:"spec_value"` - // 是否预售时效 - IsPresellSpec bool `json:"is_presell_spec"` - // product_time_spec_same_day 当日发 product_time_spec_next_day 次日发 product_time_spec_48h 48小时内发货 product_time_spec_5d 5天内发货 product_time_spec_15d 15天内发货 product_time_spec_45d 45天内发货 - SpecCode string `json:"spec_code"` +type SelectedFulfillmentRule struct { + // 支持c2b定制时可用的发货规则 + NormalRule *NormalRule_5_5 `json:"normal_rule"` } -type RecommendNameRule struct { - // 当前类目id是否命中前缀推荐规则 - SatisfyPrefix bool `json:"satisfy_prefix"` - // 命中规则的属性id详情 - PropertyIds []int64 `json:"property_ids"` +type UnitRulesItem struct { + // 度量衡单位id + UnitId int64 `json:"unit_id"` + // 最小值 + Min float64 `json:"min"` + // 最大值 + Max float64 `json:"max"` } -type TimeSkuSpecDetialItem_4_4 struct { - // 规格值 - SpecValue string `json:"spec_value"` - // 是否预售时效 - IsPresellSpec bool `json:"is_presell_spec"` +type PropertyEffectItem struct { + // 类目属性名称是否需要被覆写成label_name(目前只有资质证号有这个逻辑) + LabelName string `json:"label_name"` + // 类目属性是否必填(目前只有生产企业名称和资质证号): 0-必填, 1-非必填 + IsRequired int64 `json:"is_required"` } -type TimeSkuPurePresellRule struct { +type DeliveryAfterPresellConfig struct { + // 延迟发货时间最小值 + MinDeliveryDays int64 `json:"min_delivery_days"` + // 延迟发货时间最大值 + MaxDeliveryDays int64 `json:"max_delivery_days"` + // 最长预售结束时间 + MaxPresellEndDays int64 `json:"max_presell_end_days"` + // 是否需要人审,可忽略 + NeedAudit bool `json:"need_audit"` +} +type AppListItem struct { + // 小程序名称 + Name string `json:"name"` + // 小程序id + Value string `json:"value"` +} +type SupportAutoChargeRule struct { + // 是否支持自动充值 + Value bool `json:"value"` + // 1 + Disabled bool `json:"disabled"` +} +type MultiTimesItem struct { + // 时效描述 + TimeDesc string `json:"time_desc"` + // 时效 + TimeType int64 `json:"time_type"` +} +type TimeSkuPresellWithNormalRule struct { // 是否支持 Support bool `json:"support"` // 发货时效规格名称 TimeSkuSpecName string `json:"time_sku_spec_name"` // 发货时效规格选项 - TimeSkuSpecDetial []TimeSkuSpecDetialItem_4_4 `json:"time_sku_spec_detial"` + TimeSkuSpecDetial []TimeSkuSpecDetialItem `json:"time_sku_spec_detial"` // 预售门槛价,单位分 MinPresellPrice int64 `json:"min_presell_price"` } -type AfterSaleRule struct { - // 无理由退货规则 - SupplyDayReturnRule *SupplyDayReturnRule `json:"supply_day_return_rule"` -} -type ProductSpecRule struct { - // totally_use_given_spec:完全使用系统下发规格;partly_use_given_spec部分使用系统下发规格;not_use_given_spec:不管控规格 - SpecRuleCode string `json:"spec_rule_code"` - // 商品规格列表 - RequiredSpecDetails []RequiredSpecDetailsItem `json:"required_spec_details"` -} -type ComponentTemplateRule struct { - // 是否展示尺码信息 - IsShow bool `json:"is_show"` - // 尺码信息是否必填 - MustInput bool `json:"must_input"` +type RuleClauseItem struct { + // 1 - 相等,2 - 不相等, 3 - 包含, 4 - 不包含 + Operand int64 `json:"operand"` + // 操作(值枚举:"等于"、"不等于") + OperandStr string `json:"operand_str"` + // 属性值ID列表 + PropertyValues []int64 `json:"property_values"` } type ProductGetProductUpdateRuleData struct { // 履约规则 @@ -109,18 +115,24 @@ type ProductGetProductUpdateRuleData struct { ProductSpecRule *ProductSpecRule `json:"product_spec_rule"` // 商品尺码模板配置规则 ComponentTemplateRule *ComponentTemplateRule `json:"component_template_rule"` -} -type DeliveryAfterPayConfig struct { - // 延迟发货时间最小值 - MinDeliveryDays int64 `json:"min_delivery_days"` - // 延迟发货时间最大值 - MaxDeliveryDays int64 `json:"max_delivery_days"` - // 最长预售结束时间 - MaxPresellEndDays int64 `json:"max_presell_end_days"` - // 是否需要人审,可忽略 - NeedAudit bool `json:"need_audit"` + // 商品主图3:4配置规则 + MainImageThreeToFourRule *MainImageThreeToFourRule `json:"main_image_three_to_four_rule"` + // 金价信息,计价金类目下sku价格可以按照公式进行计算(价格=克重*每克价格+加工费),本字段提供相关信息 + GoldPriceRule *GoldPriceRule `json:"gold_price_rule"` + // 其他规则 + ExtraRule *ExtraRule `json:"extra_rule"` + // 交易相关的规则 + TradeRule *TradeRule `json:"trade_rule"` + // sku规则 + SkuRule *SkuRule_2_2 `json:"sku_rule"` + // 资质规则,类目属性影响资质必填和资质属性必填 + QualificationRule []QualificationRuleItem `json:"qualification_rule"` + // 提取方式规则 + PickUpMethodRule *PickUpMethodRule `json:"pick_up_method_rule"` } type FulfillmentRule struct { + // 特殊时间延迟发货规则 + DelayRule *DelayRule `json:"delay_rule"` // 现货发货模式规则 NormalRule *NormalRule `json:"normal_rule"` // 阶梯发货模式规则 @@ -134,11 +146,91 @@ type FulfillmentRule struct { // 新预售发货模式规则 TimeSkuPurePresellRule *TimeSkuPurePresellRule `json:"time_sku_pure_presell_rule"` } +type TitleLimitRule struct { + // 标题最长长度 + MaxLength string `json:"max_length"` + // 标题最短长度 + MinLength string `json:"min_length"` +} +type OptionsItem struct { + // 选项值 + Value string `json:"value"` + // 选项名称 + Name string `json:"name"` +} +type SpuControlRule struct { + // 是否支持spu发品 + SupportSpuProduct bool `json:"support_spu_product"` + // 0不管控 1弱管控 2强管控 + ControlType int64 `json:"control_type"` + // 是否支持新建spu + SupportCreateSpu bool `json:"support_create_spu"` + // 是否支持spu纠错 + SupportRectifySpu bool `json:"support_rectify_spu"` + // 是否支持spu举报 + SupportReportSpu bool `json:"support_report_spu"` + // 是否spu免审 + NoNeedAuditSpu bool `json:"no_need_audit_spu"` +} +type ValuePic struct { + // 规格值图片内容 + PicValue string `json:"pic_value"` + // 规格值图片类型rgb和url + PicType string `json:"pic_type"` +} +type VirtualGoodsRule struct { + // 是否可能设置订单页展示核销入口;当该字段为 true且提取方式为「使用电子凭证」或「充值直连」时,可以设置 + SupportShowCheckoutEntry bool `json:"support_show_checkout_entry"` +} +type NormalRule struct { + // sku发货时效规则 + SkuRule *SkuRule `json:"sku_rule"` + // 特殊时间延迟发货规则 + DelayRule *DelayRule_4_4 `json:"delay_rule"` + // 是否支持 + Support bool `json:"support"` + // 发货时效选项,如当日发、次日发、48小时 + DelayOptions []int64 `json:"delay_options"` + // 是否是特殊的时间发货,可忽略 + IsSpecialDelayOption bool `json:"is_special_delay_option"` +} +type SkuPresellRule struct { + // 是否支持 + Support bool `json:"support"` + // 预售门槛价 + MinPresellPrice int64 `json:"min_presell_price"` + // 是否支持支付结束后发货 + SupportDeliveryAfterPay bool `json:"support_delivery_after_pay"` + // 是否支持预售结束后发货 + SupportDeliveryAfterPresell bool `json:"support_delivery_after_presell"` + // 支付结束后规则 + DeliveryAfterPayConfig *DeliveryAfterPayConfig `json:"delivery_after_pay_config"` + // 预售结束后规则 + DeliveryAfterPresellConfig *DeliveryAfterPresellConfig `json:"delivery_after_presell_config"` +} +type OptionsItem_4 struct { + // 售后天数选项列表 + Options []OptionsItem `json:"options"` + // 三包服务类型名称 + Name string `json:"name"` + // 三包服务类型值 + Value string `json:"value"` +} +type OptionsItem_4_4 struct { + // sku分类对应举例 + Example string `json:"example"` + // sku分类对应介绍 + Description string `json:"description"` + // sku分类枚举信息 + Value string `json:"value"` + // sku分类信息中文名称 + Name string `json:"name"` +} type SupplyDayReturnRule struct { // true 支持七天无理由,false 不支持七天无理由 Enable bool `json:"enable"` // 可选的无理由退货选项列表 - Options []OptionsItem `json:"options"` + Options []OptionsItem_4_4 `json:"options"` } type ReferencePriceRule struct { // true表示可填写参考价,false表示不可填写参考价 @@ -150,47 +242,151 @@ type ReferencePriceRule struct { // 参考价最高高于最低SKU价格的倍数,比如最低SKU价格为1,此值为10,则参考价不可高于10 LowerSkuPriceTimes int64 `json:"lower_sku_price_times"` } -type OptionsItem struct { - // 天无理由退货文案描述 - Name string `json:"name"` - // 无理由退货的类型 - Value string `json:"value"` +type PriceRulesItem struct { + // 是否可选,true表示可选,false表示不可选,如果不可选则表示商家没有设置过基础金价,需要前往抖店后台设置 + CanSelect bool `json:"can_select"` + // 金价描述 + Desc string `json:"desc"` + // 每克重黄金对应的价格,单位:分 + Value int64 `json:"value"` + // 价格规则枚举:1是投资金2是首饰金 + Type int64 `json:"type"` } -type PropertyValuesItem struct { - // 规格值id - SellPropertyValueId int64 `json:"sell_property_value_id"` - // 规格值名称 - SellPropertyValueName string `json:"sell_property_value_name"` +type GoldPriceRule struct { + // 价格规则信息,内有黄金的不同的单位价格以及枚举 + PriceRules []PriceRulesItem `json:"price_rules"` + // 销售属性(规格)id,价格基于这个规格填写的数值按照公式进行计算 + SellPropertyId string `json:"sell_property_id"` + // 是否必填,true表示必填,false表示非必填 + IsRequired bool `json:"is_required"` + // 是否需要展示(可填),true表示需要展示(可填),false表示无需展示(不可填) + IsShow bool `json:"is_show"` } -type RequiredSpecDetailsItem struct { - // 规格项名称 - SellPropertyName string `json:"sell_property_name"` - // 规格项id - SellPropertyId int64 `json:"sell_property_id"` - // 规格值选项 - PropertyValues []PropertyValuesItem `json:"property_values"` - // 是否支持备注 - SupportRemark bool `json:"support_remark"` - // 是否可以自定义规格值 - SupportDiy bool `json:"support_diy"` +type HomeInstallServiceRule struct { + // 上门安装可选模式 + Options []OptionsItem_4 `json:"options"` + // 是否必选 + MustSelect bool `json:"must_select"` } -type NormalRule struct { +type SkuClassificationRule struct { + // sku分类信息扩展项 + Options []OptionsItem_4_4 `json:"options"` + // sku分类信息是否必填 + MustSelect bool `json:"must_select"` + // 是否允许填写sku分类信息 + Enable bool `json:"enable"` +} +type SkuRule_2_2 struct { + // 是否支持国补商品型号 + SupportSpecModelCode bool `json:"support_spec_model_code"` + // 是否支持填写条形码 + SupportBarcode bool `json:"support_barcode"` + // sku分类信息填写规则 + SkuClassificationRule *SkuClassificationRule `json:"sku_classification_rule"` +} +type MatchableRuleItem struct { + // 资质规则生效的触发条件结构:属性id -> 属性值clause作用:当命中ruleClause中给出的全部属性对时,刷新相关资质的「必填/非必填」配置 + RuleClause map[int64]RuleClauseItem `json:"rule_clause"` + // 资质规则触发时,受影响的类目属性结构:属性id -> 属性effect(包含属性是否必填,属性名是否需要被覆写)作用:当命中ruleClause中给出的全部属性对时,刷新相关资质的「必填/非必填」配置 + PropertyEffect map[int64]PropertyEffectItem `json:"property_effect"` +} +type ValueModulesItem struct { + // 模块id + ModuleId int64 `json:"module_id"` + // 前缀 + Prefix string `json:"prefix"` + // 后缀 + Suffix string `json:"suffix"` + // 输入类型:枚举 enum, 输入 input, enum_diy 枚举可输入 + InputType string `json:"input_type"` + // 度量衡值选项 + Values []ValuesItem `json:"values"` + // 度量衡单位 + Units []UnitsItem `json:"units"` + // 度量衡规则 + ValidateRule *ValidateRule `json:"validate_rule"` +} +type NavigationPropertiesItem struct { + // 导航属性id + PropertyId int64 `json:"property_id"` + // 导航属性名称 + PropertyName string `json:"property_name"` +} +type SizeDimensionRangeItem struct { + // 最小范围 + Max int64 `json:"max"` + // 最大范围 + Min int64 `json:"min"` +} +type PickUpMethodRule struct { + // 虚拟商品提货方式规则 + VirtualGoodsRule *VirtualGoodsRule `json:"virtual_goods_rule"` +} +type DelayRule_4_4 struct { + // 配置类型 + ConfigType int32 `json:"config_type"` + // 配置值 + ConfigValue int64 `json:"config_value"` + // 商家配置的开始时间 + StartTime int64 `json:"start_time"` + // 商家配置的结束时间 + EndTime int64 `json:"end_time"` +} +type TitleIllegalKeywordRuleItem struct { + // 规则提示 + Tip string `json:"tip"` + // 不允许出现的后缀关键词 + KeywordsInSuffix []string `json:"keywords_in_suffix"` + // 不允许出现的前缀关键词 + KeywordsInPrefix []string `json:"keywords_in_prefix"` + // 不允许出现的全局关键词 + Keywords []string `json:"keywords"` +} +type ThreeGuarantees struct { + // 三包服务类型,1-寄修,2-延保 + Options []OptionsItem_4 `json:"options"` + // 是否必填 + MustSelect bool `json:"must_select"` + // 是否支持三包服务 + Enable bool `json:"enable"` +} +type LargeProductRule struct { + // 是否可选大件商品 + Enable bool `json:"enable"` + // 是否必须大件商品 + MustSelect bool `json:"must_select"` + // 可选项 + Options []OptionsItem_4_4 `json:"options"` +} +type StepRule struct { + // 支持的时效列表 + MultiTimes []MultiTimesItem `json:"multi_times"` // 是否支持 Support bool `json:"support"` - // 发货时效选项,如当日发、次日发、48小时 + // 阶梯现货部分延迟返货时间范围 DelayOptions []int64 `json:"delay_options"` - // 是否特殊时间延迟发货,可忽略 + // 是特殊时间延迟发货,可忽略 IsSpecialDelayOption bool `json:"is_special_delay_option"` + // 阶梯发货阶梯部分发货时间最小值 + StepMinDelay int64 `json:"step_min_delay"` + // 阶梯发货阶梯部分发货时间最大值 + StepMaxDelay int64 `json:"step_max_delay"` + // 延迟发货规则 + DelayRule *DelayRule_4_4 `json:"delay_rule"` } -type DeliveryAfterPresellConfig struct { - // 延迟发货时间最小值 - MinDeliveryDays int64 `json:"min_delivery_days"` - // 延迟发货时间最大值 - MaxDeliveryDays int64 `json:"max_delivery_days"` - // 最长预售结束时间 - MaxPresellEndDays int64 `json:"max_presell_end_days"` - // 是否需要人审,可忽略 - NeedAudit bool `json:"need_audit"` +type C2bCustomizeRule struct { + // 支持c2b定制时可用的履约规则 + SelectedFulfillmentRule *SelectedFulfillmentRule `json:"selected_fulfillment_rule"` + // 可选小程序 + AppList []AppListItem `json:"app_list"` + // 支持c2b定制时可用的7天无理由 + SupplyDayReturnSelector []SupplyDayReturnSelectorItem `json:"supply_day_return_selector"` + // 是否支持c2b定制 + Enable bool `json:"enable"` +} +type TradeRule struct { + // 自动充值相关的规则 + SupportAutoChargeRule *SupportAutoChargeRule `json:"support_auto_charge_rule"` } type ProductPresellRule struct { // 是否支持全款预售 @@ -206,7 +402,83 @@ type ProductPresellRule struct { // 预售结束后规则 DeliveryAfterPresellConfig *DeliveryAfterPresellConfig `json:"delivery_after_presell_config"` } -type TimeSkuPresellWithNormalRule struct { +type SupplyDayReturnSelectorItem struct { + // 7天无理由选项名称 + Name string `json:"name"` + // 7天无理由选项值 + Value string `json:"value"` +} +type SkuRule struct { + // 最大绝对发货时间,秒级标准Unix时间戳 + AbsoluteMaxDate string `json:"absolute_max_date"` + // 最小绝对发货时间,秒级标准Unix时间戳 + AbsoluteMinDate string `json:"absolute_min_date"` + // 最大相对发货时间 + RelativeMaxDelay string `json:"relative_max_delay"` + // sku发货时效是否支持范围输入 + SupportRangeOption bool `json:"support_range_option"` + // 最小相对发货时间 + RelativeMinDelay string `json:"relative_min_delay"` + // 是否支持sku发货时效 + Support bool `json:"support"` +} +type TimeSkuSpecDetialItem struct { + // 规格值 + SpecValue string `json:"spec_value"` + // 是否预售时效 + IsPresellSpec bool `json:"is_presell_spec"` + // product_time_spec_same_day 当日发/次日发 product_time_spec_next_day 次日发 product_time_spec_48h 48小时内发货 product_time_spec_5d 5天内发货 product_time_spec_15d 15天内发货 product_time_spec_45d 45天内发货 + SpecCode string `json:"spec_code"` +} +type PropertyValuesItem struct { + // 规格值id + SellPropertyValueId int64 `json:"sell_property_value_id"` + // 规格值名称 + SellPropertyValueName string `json:"sell_property_value_name"` + // 规格值图片 + ValuePic *ValuePic `json:"value_pic"` +} +type ValuesItem struct { + // 度量衡值 + ValueName string `json:"value_name"` +} +type RequiredSpecDetailsItem struct { + // 规格项名称 + SellPropertyName string `json:"sell_property_name"` + // 规格项id + SellPropertyId int64 `json:"sell_property_id"` + // 规格值选项 + PropertyValues []PropertyValuesItem `json:"property_values"` + // 是否支持备注 + SupportRemark bool `json:"support_remark"` + // 是否可以自定义规格值 + SupportDiy bool `json:"support_diy"` + // 是否必填 + IsRequired bool `json:"is_required"` + // 规格样式,cascader是为导航样式 + ValueDisplayStyle string `json:"value_display_style"` + // 度量衡模版,可能有多个 + MeasureTemplates []MeasureTemplatesItem `json:"measure_templates"` + // 是否需要二次查询规格值 + NeedPagingQueryValue bool `json:"need_paging_query_value"` + // 导航属性 + NavigationProperties []NavigationPropertiesItem `json:"navigation_properties"` + // 1 + PropertyDefaultDisplay bool `json:"property_default_display"` +} +type SizeDimensions struct { + // 有用列 + UsefulDimensions []string `json:"useful_dimensions"` + // 其他可用列 + OtherDimensions []string `json:"other_dimensions"` +} +type ExtraRule struct { + // 上门安装服务规则 + HomeInstallServiceRule *HomeInstallServiceRule `json:"home_install_service_rule"` + // c2b定制相关规则 + C2bCustomizeRule *C2bCustomizeRule `json:"c2b_customize_rule"` +} +type TimeSkuPurePresellRule struct { // 是否支持 Support bool `json:"support"` // 发货时效规格名称 @@ -216,3 +488,117 @@ type TimeSkuPresellWithNormalRule struct { // 预售门槛价,单位分 MinPresellPrice int64 `json:"min_presell_price"` } +type RecommendNameRule struct { + // 商品标题非法关键词规则 + TitleIllegalKeywordRule []TitleIllegalKeywordRuleItem `json:"title_illegal_keyword_rule"` + // 品牌没有权限是否可以勾选 + PrefixBrandUnauthCanSel bool `json:"prefix_brand_unauth_can_sel"` + // 前缀规则是否包含品牌 + PrefixPropHasBrand bool `json:"prefix_prop_has_brand"` + // 标题长度规则 + TitleLimitRule *TitleLimitRule `json:"title_limit_rule"` + // 当前类目id是否命中前缀推荐规则 + SatisfyPrefix bool `json:"satisfy_prefix"` + // 命中规则的属性id详情 + PropertyIds []int64 `json:"property_ids"` +} +type ValidateRule struct { + // 数据类型,integer、float + DataType string `json:"data_type"` + // 小数位数,data_type为float时有值 + Precision int64 `json:"precision"` + // 最小值 + Min float64 `json:"min"` + // 最大值 + Max float64 `json:"max"` + // 单位规则明细 + UnitRules []UnitRulesItem `json:"unit_rules"` +} +type ProductSpecRule struct { + // 为true时,规格图要么全不填,要么全填 + AllSpecPicRequired bool `json:"all_spec_pic_required"` + // 是否支持规格项顺序调整,true表示支持 + SupportPropertySequenceVariable bool `json:"support_property_sequence_variable"` + // 【废弃字段,请勿依赖】totally_use_given_spec:完全使用系统下发规格;partly_use_given_spec部分使用系统下发规格;not_use_given_spec:不管控规格;"":为空时表示不管控规格 + SpecRuleCode string `json:"spec_rule_code"` + // 商品规格列表 + RequiredSpecDetails []RequiredSpecDetailsItem `json:"required_spec_details"` + // 最大可支持的规格层级数量 + MaxSpecNumLimit int64 `json:"max_spec_num_limit"` + // sku组合数量上限 + SpecCombinationLimit int64 `json:"spec_combination_limit"` + // 单个规格的规格值数量上限 + SpecSingleLimit int64 `json:"spec_single_limit"` + // 是否支持规格项自定义 + SupportPropertyDiy bool `json:"support_property_diy"` +} +type ComponentTemplateRule struct { + // 尺码列配置 + SizeDimensions *SizeDimensions `json:"size_dimensions"` + // 区间符号 + IntervalSizeSymbol []string `json:"interval_size_symbol"` + // 维度下尺码范围 + SizeDimensionRange map[string]SizeDimensionRangeItem `json:"size_dimension_range"` + // 当前类目支持的尺码模版子类型 + SupportTemplateSubType string `json:"support_template_sub_type"` + // 是否展示尺码信息 + IsShow bool `json:"is_show"` + // 尺码信息是否必填 + MustInput bool `json:"must_input"` +} +type MainImageThreeToFourRule struct { + // 是否展示主图3:4信息 + IsShow bool `json:"is_show"` + // 主图3:4信息是否必填 + MustInput bool `json:"must_input"` +} +type QualificationRuleItem struct { + // 是否千川收取资质 + IsQianchuanNeed bool `json:"is_qianchuan_need"` + // 是否必填 + IsRequired bool `json:"is_required"` + // 资质要求描述文字 + TextList []string `json:"text_list"` + // 资质名称 + Name string `json:"name"` + // 资质ID + Key string `json:"key"` + // 资质规则和规则的效果 + MatchableRule []MatchableRuleItem `json:"matchable_rule"` +} +type DelayRule struct { + // 支持的配置类型1:代表时间点,此时对应的config_value的值为支持的最晚发货的秒级时间戳2:代表相对时间,此时对应的config_value的值表示支付后几天发货;比如config_value=3表示支付后三天发货 + ConfigType int64 `json:"config_type"` + // 与规则配置类型对应的配置值 + ConfigValue int64 `json:"config_value"` + // 规则开始时间 + StartTime int64 `json:"start_time"` + // 规则结束时间 + EndTime int64 `json:"end_time"` +} +type DeliveryAfterPayConfig struct { + // 延迟发货时间最小值 + MinDeliveryDays int64 `json:"min_delivery_days"` + // 延迟发货时间最大值 + MaxDeliveryDays int64 `json:"max_delivery_days"` + // 最长预售结束时间 + MaxPresellEndDays int64 `json:"max_presell_end_days"` + // 是否需要人审,可忽略 + NeedAudit bool `json:"need_audit"` +} +type MeasureTemplatesItem struct { + // 模版名称 + DisplayName string `json:"display_name"` + // 度量衡模版id + TemplateId int64 `json:"template_id"` + // 度量衡模版模块内容,一个模版多个模块 + ValueModules []ValueModulesItem `json:"value_modules"` +} +type AllergyReturnV2Rule struct { + // 是否可选过敏包退 + Enable string `json:"enable"` + // 是否必选过敏包退 + MustSelect string `json:"must_select"` + // 可选项 + Options []OptionsItem_4_4 `json:"options"` +} diff --git a/platformapi/tiktok_shop/sdk-golang/api/shop_getShopCategory/request/shop_getShopCategory_request.go b/platformapi/tiktok_shop/sdk-golang/api/shop_getShopCategory/request/shop_getShopCategory_request.go index 50f1533c..18062c54 100644 --- a/platformapi/tiktok_shop/sdk-golang/api/shop_getShopCategory/request/shop_getShopCategory_request.go +++ b/platformapi/tiktok_shop/sdk-golang/api/shop_getShopCategory/request/shop_getShopCategory_request.go @@ -47,4 +47,6 @@ func (c *ShopGetShopCategoryRequest) GetParams() *ShopGetShopCategoryParam { type ShopGetShopCategoryParam struct { // 父类目id,根据父id可以获取子类目。首次请求传值为0 可以获取所有一级类目。循环调用接口获取最小层级类目id,根据响应参数判断is_leaf=true或false。is_leaf=true表示是叶子节点,获取最小层级类目id,is_leaf=false表示不是子节点,请求参数cid=上一次响应参数id,直到获取最小层级类目id。 Cid int64 `json:"cid"` + // 类目渠道,0:门捷列夫类目,1:标准类目;若不传入,当cid=0时,由类目服务内部自行开关控制:0:默认查询门捷列夫类目;1:获取商家灰度标,跟随大盘灰度节奏切换;2:默认查询标准类目 + Channel *int32 `json:"channel"` } diff --git a/platformapi/tiktok_shop/sdk-golang/api/shop_getShopCategory/response/shop_getShopCategory_response.go b/platformapi/tiktok_shop/sdk-golang/api/shop_getShopCategory/response/shop_getShopCategory_response.go index 481d8c4b..7c3e55a9 100644 --- a/platformapi/tiktok_shop/sdk-golang/api/shop_getShopCategory/response/shop_getShopCategory_response.go +++ b/platformapi/tiktok_shop/sdk-golang/api/shop_getShopCategory/response/shop_getShopCategory_response.go @@ -24,4 +24,6 @@ type DataItem struct { IsLeaf bool `json:"is_leaf"` // 类目使用有效;enable=true有效,如果enable=false表示该类目已经失效,请勿使用 Enable bool `json:"enable"` + // 类目渠道,0:门捷列夫类目,1:标准类目 + Channel int32 `json:"channel"` } diff --git a/platformapi/tiktok_shop/tiktok_api/afs_test.go b/platformapi/tiktok_shop/tiktok_api/afs_test.go index 80660134..8e4e56d1 100644 --- a/platformapi/tiktok_shop/tiktok_api/afs_test.go +++ b/platformapi/tiktok_shop/tiktok_api/afs_test.go @@ -8,17 +8,37 @@ import ( "time" ) -// 京西速食(蔬菜) -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":"81qzlgabmw1j7t4nq1hehos0000yhugi-11","expires_in":1774781291,"scope":"SCOPE","shop_id":57939570,"shop_name":"京西菜市","refresh_token":"s0a144yh8m1j7t4nq1hehos0000yhugi-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":""}` +//(抖)美好菜市 授权已被关闭,请重新打开授权开关 +//var token1 = `{"access_token":"45f191d2-3917-4f49-a538-da83733c1d70","expires_in":1723882502,"scope":"SCOPE","shop_id":68032645,"shop_name":"京西果园","refresh_token":"a372e76b-6470-4d9f-a375-3cb53e6e32ab","authority_id":""}` -// 京西到家 -//var token1 = `{"access_token":"j9cjqyruu01j7t4nq1hehos00014hzcz-11","expires_in":1739587252,"scope":"SCOPE","shop_id":68023619,"shop_name":"京西到家","refresh_token":"pi0v58amo61j7t4nq1hehos00014hzcz-12","authority_id":""}` +//(抖)蕾丝袜 授权已被关闭,请重新打开授权开关 +//var token1 = `{"access_token":"h57u8famv01j7t4nq1hehos0000i4uwm-11","expires_in":1738376382,"scope":"SCOPE","shop_id":30459766,"shop_name":"蕾丝袜","refresh_token":"lrp6tl651c1j7t4nq1hehos0000i4uwm-12","authority_id":""}` + +//(抖)京西到家 // 授权已被关闭,请重新打开授权开关 +//var token1 = `{"access_token":"vyj6q0cyg91j7t4nq1hehos00014hzcz-11","expires_in":1770518421,"scope":"SCOPE","shop_id":68023619,"shop_name":"京西到家","refresh_token":"pdxa2609jm1j7t4nq1hehos00014hzcz-12","authority_id":""}` + +//(抖)易购生鲜超市 access_token不存在,请使用最新的access_token访问 +//var token1 = `{"access_token":"c78874c8-0862-403c-8ddb-c25385221632","expires_in":1711559144,"scope":"SCOPE","shop_id":114868220,"shop_name":"易购生鲜超市","refresh_token":"3604ac64-384b-4ed7-a511-8d4794ff56e7","authority_id":""}` + +//(抖)京西同城配送 app_key和access_token不匹配,请仔细检查 +//var token1 = `{"access_token":"fb41e4d5-c92f-4b07-956f-46c63d0547be","expires_in":1692275028,"scope":"SCOPE","shop_id":92037439,"shop_name":"京西花园","refresh_token":"5fa3efc3-d3c4-410a-baaa-0fb23d408ccf","authority_id":""}` + +// 测试门店 +var token1 = `{"access_token":"syriovzwwq1j7t4nq1hehos0004b2xdw-11","expires_in":1774425349,"scope":"SCOPE","shop_id":260477060,"shop_name":"开放平台测试专用店4","refresh_token":"8u762h27341j7t4nq1hehos0004b2xdw-12","authority_id":""}` var a = New("7267745202649957900", "51998fcf-d521-4553-8c0c-fa662c8dbd6e", token1) +func TestCategory(t *testing.T) { + data, err := a.GetShopCategory(0) + for _, v := range data { + fmt.Println(v.Id, "---", v.Name, "---", v.IsLeaf, "---", v.Level) + } + fmt.Println("data====", err) +} + // 查询售后单详情 func TestAfsOrder(t *testing.T) { data, err := a.QueryAfsOrderDetail("146453779045950796", false) diff --git a/platformapi/tiktok_shop/tiktok_api/sku.go b/platformapi/tiktok_shop/tiktok_api/sku.go index e7f284c7..f7605f13 100644 --- a/platformapi/tiktok_shop/tiktok_api/sku.go +++ b/platformapi/tiktok_shop/tiktok_api/sku.go @@ -11,6 +11,7 @@ import ( product_addV2_response "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/product_addV2/response" product_auditList_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/product_auditList/request" product_auditList_response "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/product_auditList/response" + product_batchGetChannelCategoryMapping_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/product_batchGetChannelCategoryMapping/request" product_del_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/product_del/request" product_detail_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/product_detail/request" product_detail_response "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/product_detail/response" @@ -66,9 +67,11 @@ func (a *API) UpdateSkuStock(param *sku_syncStock_request.SkuSyncStockParam) err // 3、循环获取最小层级类目id方式:再判断is_leaf=true或false。is_leaf=true表示是叶子节点,最小层级类目id。is_leaf=false表示不是子节点,请求参数cid=上一次响应参数id,直到获取最小层级类目id。 func (a *API) GetShopCategory(cid int64) ([]*RetailCategoryInfo, error) { // 如果cid为0,则获取所有的分类,如果cid不为0,则获取该分类下面的所有子分类 + channel := int32(1) // 0获取老的分类ID 1获取最新的分类id request := shop_getShopCategory_request.New() param := request.GetParams() param.Cid = cid + param.Channel = &channel result, err := request.Execute(a.accessTokenObj) if err != nil { return nil, err @@ -117,18 +120,43 @@ func (a *API) GetCatePropertyV2(categoryLeftId int64) (*product_getCatePropertyV return result, nil } +// BatchGetChannelCategoryMapping 根据旧的抖音分类获取新的分类 +func (a *API) BatchGetChannelCategoryMapping(categoryIds []int64) (map[int64]int64, error) { + request := product_batchGetChannelCategoryMapping_request.New() + param := request.GetParams() + categoryList := make([]product_batchGetChannelCategoryMapping_request.ReqItemsItem, 0, len(categoryIds)) + for _, v := range categoryIds { + categoryList = append(categoryList, product_batchGetChannelCategoryMapping_request.ReqItemsItem{ + CategoryId: utils.Int64ToPointer(v), + }) + } + param.ReqItems = categoryList + + result, err := request.Execute(a.accessTokenObj) + if err != nil { + return nil, err + } + if result.Code != RequestSuccessCode { + return nil, errors.New(result.SubMsg + ":" + result.LogId) + } + + mappingData := make(map[int64]int64, 0) + for _, v := range result.Data.RespItems { + mappingData[v.SourceCategoryId] = v.CategoryMappings[0].MappingCategoryId + } + + return mappingData, nil +} + // CreateStoreCommodity (新增总部商品) func (a *API) CreateStoreCommodity(skuParam *product_addV2_request.ProductAddV2Param) (*product_addV2_response.ProductAddV2Data, error) { - skuParam.AfterSaleServiceV2 = &product_addV2_request.AfterSaleServiceV2{ - ThreeGuarantees: struct { - Duration int64 `json:"duration"` - ServiceType int64 `json:"service_type"` - }{ - Duration: 7, - ServiceType: 1, - }, - IsLargeProduct: 0, - } + //skuParam.AfterSaleServiceV2 = &product_addV2_request.AfterSaleServiceV2{ + // IsLargeProduct: utils.Int64ToPointer(0), + // ThreeGuarantees: &product_addV2_request.ThreeGuarantees{ + // Duration: utils.Int64ToPointer(7), + // ServiceType: utils.Int64ToPointer(1), + // }, + //} qualityList := make([]product_addV2_request.QualityListItem, 0, 0) switch a.accessTokenObj.ShopId { case TiktokFloderKeyVegetableKey: // 京西速食 @@ -164,8 +192,19 @@ func (a *API) CreateStoreCommodity(skuParam *product_addV2_request.ProductAddV2P }, }, }) + case 260477060: + qualityList = append(qualityList, product_addV2_request.QualityListItem{ + QualityKey: "6966228537426575660", + QualityName: "包装标签图", + QualityAttachments: []product_addV2_request.QualityAttachmentsItem{ + product_addV2_request.QualityAttachmentsItem{ + MediaType: 1, + Url: "https://p3-aio.ecombdimg.com/obj/ecom-shop-material/jpeg_m_94ab77cb6e8b8812abac65f89640e6b9_sx_466038_www1000-1000", + }, + }, + }) default: - return nil, errors.New("创建商品是,资质获取异常") + //return nil, errors.New("创建商品是,资质获取异常") } skuParam.QualityList = qualityList request := product_addV2_request.New() @@ -180,6 +219,7 @@ func (a *API) CreateStoreCommodity(skuParam *product_addV2_request.ProductAddV2P return result.Data, nil } +// QualityList 商品资质查询 func (a *API) QualityList(categoryId int64) ([]*product_qualificationConfig_response.ConfigListItem, error) { if categoryId <= 0 { return nil, errors.New("categoryId 不能为0") @@ -253,7 +293,8 @@ func (a *API) EditStoreCommodityCommit(sku *product_editV2_commit_request.Produc func (a *API) DeleteStoreCommodity(productId int64) error { request := product_del_request.New() param := request.GetParams() - param.ProductId = productId + //param.ProductId = productId + param.OutProductId = 6119735 param.DeleteForever = true result, err := request.Execute(a.accessTokenObj) @@ -369,8 +410,8 @@ func (a *API) EditPrice(skuPrice *sku_editPrice_request.SkuEditPriceParam) error // GetSkuBrand 获取商品所属品牌 func (a *API) GetSkuBrand(categoryId int64, brandName string) (int64, error) { request := brand_list_request.New() - request.Param.CategoryId = categoryId - request.Param.Query = brandName + request.Param.CategoryId = utils.Int64ToPointer(categoryId) + request.Param.Query = utils.String2Pointer(brandName) result, err := request.Execute(a.accessTokenObj) if err != nil { return 0, err @@ -601,36 +642,22 @@ func (a *API) GetRecommendCategoryByName(name string) (int64, error) { return 0, errors.New("抖音根据图片获取分类,返回值为0") } - var firstCid int64 - var secondCid int64 - var thirdCid int64 - var fourthCid int64 + if len(result.Data.CategoryDetails) == 0 { + return 0, errors.New("抖音根据名称获取分类,返回值为0") + } + categoryDetail := result.Data.CategoryDetails[0].CategoryDetail + cids := []int64{ + categoryDetail.FourthCid, + categoryDetail.ThirdCid, + categoryDetail.SecondCid, + categoryDetail.FirstCid, + } + for _, cid := range cids { + if cid != 0 { + return cid, nil + } + } - index := len(result.Data.CategoryDetails) - 1 - if result.Data.CategoryDetails[index].CategoryDetail.FirstCid != 0 { - firstCid = result.Data.CategoryDetails[index].CategoryDetail.FirstCid - } - if result.Data.CategoryDetails[index].CategoryDetail.SecondCid != 0 { - secondCid = result.Data.CategoryDetails[index].CategoryDetail.SecondCid - } - if result.Data.CategoryDetails[index].CategoryDetail.ThirdCid != 0 { - thirdCid = result.Data.CategoryDetails[index].CategoryDetail.ThirdCid - } - if result.Data.CategoryDetails[index].CategoryDetail.FourthCid != 0 { - fourthCid = result.Data.CategoryDetails[index].CategoryDetail.FourthCid - } - if fourthCid != 0 { - return fourthCid, nil - } - if thirdCid != 0 { - return thirdCid, nil - } - if secondCid != 0 { - return secondCid, nil - } - if firstCid != 0 { - return firstCid, nil - } return 0, errors.New("抖音获取推荐分类异常") } @@ -640,7 +667,7 @@ func (a *API) GetRecommendCategory(picParams []string) (int64, error) { return 0, errors.New("抖音根据图片预测分类,图片不能为空") } request := product_GetRecommendCategory_request.New() - request.Param.Scene = "smart_publish" // 根据图片获取分类属性 + request.Param.Scene = "predict_by_title_and_img" // 根据图片获取分类属性 picList := make([]product_GetRecommendCategory_request.PicItem, 0, 0) for _, v := range picParams { picList = append(picList, product_GetRecommendCategory_request.PicItem{Url: v}) @@ -658,36 +685,19 @@ func (a *API) GetRecommendCategory(picParams []string) (int64, error) { if len(result.Data.CategoryDetails) == 0 { return 0, errors.New("抖音根据图片获取分类,返回值为0") } + categoryDetail := result.Data.CategoryDetails[0].CategoryDetail + cids := []int64{ + categoryDetail.FourthCid, + categoryDetail.ThirdCid, + categoryDetail.SecondCid, + categoryDetail.FirstCid, + } + for _, cid := range cids { + if cid != 0 { + return cid, nil + } + } - var firstCid int64 - var secondCid int64 - var thirdCid int64 - var fourthCid int64 - - if result.Data.CategoryDetails[0].CategoryDetail.FirstCid != 0 { - firstCid = result.Data.CategoryDetails[0].CategoryDetail.FirstCid - } - if result.Data.CategoryDetails[0].CategoryDetail.SecondCid != 0 { - secondCid = result.Data.CategoryDetails[0].CategoryDetail.SecondCid - } - if result.Data.CategoryDetails[0].CategoryDetail.ThirdCid != 0 { - thirdCid = result.Data.CategoryDetails[0].CategoryDetail.ThirdCid - } - if result.Data.CategoryDetails[0].CategoryDetail.FourthCid != 0 { - fourthCid = result.Data.CategoryDetails[0].CategoryDetail.FourthCid - } - if fourthCid != 0 { - return fourthCid, nil - } - if thirdCid != 0 { - return thirdCid, nil - } - if secondCid != 0 { - return secondCid, nil - } - if firstCid != 0 { - return firstCid, nil - } return 0, errors.New("抖音获取推荐分类异常") } diff --git a/platformapi/tiktok_shop/tiktok_api/sku_test.go b/platformapi/tiktok_shop/tiktok_api/sku_test.go index e505c6a3..c85f9c55 100644 --- a/platformapi/tiktok_shop/tiktok_api/sku_test.go +++ b/platformapi/tiktok_shop/tiktok_api/sku_test.go @@ -3,12 +3,13 @@ package tiktok_api import ( "fmt" "git.rosy.net.cn/baseapi" - product_editV2_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/product_editV2/request" + product_addV2_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/product_addV2/request" product_editV2_commit_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/product_editV2_commit/request" product_listV2_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/product_listV2/request" sku_editPrice_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/sku_editPrice/request" sku_syncStock_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/sku_syncStock/request" "git.rosy.net.cn/baseapi/utils" + "git.rosy.net.cn/jx-callback/business/model" "git.rosy.net.cn/jx-callback/globals" "go.uber.org/zap" "strings" @@ -26,19 +27,144 @@ func TestCreateSubProduct(t *testing.T) { a.CreateSubProduct(3592508194611683124, 64251631) } -func TestCategory(t *testing.T) { - data, err := a.GetShopCategory(20314) - for _, v := range data { - fmt.Println(v.Id, "---", v.Name, "---", v.IsLeaf, "---", v.Level) +func TestGetRecommendCategoryByName(t *testing.T) { + a.GetRecommendCategoryByName("红富士苹果") +} + +func TestBatchGetChannelCategoryMapping(t *testing.T) { + items, err := a.BatchGetChannelCategoryMapping(nil) + globals.SugarLogger.Debugf("-items:= %s", utils.Format4Output(items, false)) + globals.SugarLogger.Debugf("-items:= %v", err) +} + +func TestCreateStoreCommodity(t *testing.T) { + //PayType := int64(1) + //weight := float64(300) + param := &product_addV2_request.ProductAddV2Param{ + //OuterProductId: utils.String2Pointer("6119735"), + //ProductType: 0, + //CategoryLeafId: 1000006281, + //Name: "[同城配送]过水猪耳朵1个", + RecommendRemark: nil, + //Pic: "https://p3-aio.ecombdimg.com/obj/ecom-shop-material/png_m_c3009881689e4115f65344a3f230ac23_sx_535006_www800-800", + //Description: "https://p3-aio.ecombdimg.com/obj/ecom-shop-material/png_m_0b96110a31122b380d0bb2f9bbacc8a7_sx_705423_www800-800", + //PayType: &PayType, + DeliveryMethod: nil, + CdfCategory: nil, + //ReduceType: 1, + AssocIds: nil, + //FreightId: 0, + //Weight: &weight, + //WeightUnit: &PayType, + //DeliveryDelayDay: utils.Int64ToPointer(9999), + //PresellType: utils.Int64ToPointer(0), + PresellDelay: nil, + PresellEndTime: nil, + Supply7dayReturn: nil, + //Mobile: "18981810340", + //Commit: true, + Remark: nil, + OutProductId: nil, + QualityList: nil, + SpecName: nil, + //Specs: utils.String2Pointer("总净重|300g"), + //SpecPrices: utils.String2Pointer("[{\"spec_detail_name1\":\"300g\",\"spec_detail_name2\":\"\",\"spec_detail_name3\":\"\",\"stock_num\":999999,\"price\":2500,\"code\":\"6119735\",\"step_stock_num\":0,\"supplier_id\":\"\",\"outer_sku_id\":\"6119735\",\"sku_type\":1,\"stock_num_map\":{\"260477060\":999999},\"delivery_infos\":[{\"info_type\":\"weight\",\"info_value\":\"300\",\"info_unit\":\"g\"}]}]"), + SpecPic: nil, + MaximumPerOrder: utils.Int64ToPointer(50), + LimitPerBuyer: utils.Int64ToPointer(200), + MinimumPerOrder: nil, + //ProductFormatNew: utils.String2Pointer("{\"1687\": [{\"diy_type\": 0,\"name\": \"品牌\",\"value\": 596120136}]}"), + SpuId: nil, + AppointDeliveryDay: nil, + ThirdUrl: nil, + Extra: nil, + Src: nil, + //StandardBrandId: utils.Int64ToPointer(596120136), + NeedCheckOut: nil, + PoiResource: nil, + CarVinCode: nil, + PresellConfigLevel: nil, + //NeedRechargeMode: nil, + AccountTemplateId: nil, + PresellDeliveryType: nil, + //WhiteBackGroundPicUrl: utils.String2Pointer("https://p3-aio.ecombdimg.com/obj/ecom-shop-material/png_m_c3009881689e4115f65344a3f230ac23_sx_535006_www800-800"), + LongPicUrl: nil, + //AfterSaleService: &map[string]string{"supply_day_return_selector": "7-0"}, + SellChannel: nil, + //StartSaleType: utils.Int64ToPointer(0), + DelayRule: nil, + MaterialVideoId: nil, + //PickupMethod: utils.String2Pointer("0"), + SizeInfoTemplateId: nil, + SubstituteGoodsUrl: nil, + SaleChannelType: nil, + RecruitInfo: nil, + StoreId: nil, + MainProductId: nil, + //SaleLimitId: nil, + NamePrefix: nil, + ReferencePrice: nil, + ReferencePriceCertificate: nil, + MainImageThreeToFour: nil, + UnitPriceInfo: nil, + QualityInspectionInfo: nil, + IsC2bSwitchOn: nil, + MicroAppId: nil, + IsAutoCharge: nil, + ShortProductName: nil, + AfterSaleServiceV2: nil, + SpecInfo: nil, + SpecPricesV2: nil, + WithSkuType: nil, + NameSuffix: nil, + UseBrandName: nil, + OpenLogisticsInfo: nil, + PriceHasTax: nil, + BizKind: nil, + CustomProperty: nil, + IsEvaluateOpened: nil, + DefaultProcessTime: nil, + CompanyId: nil, + IsSecondHandDigital: nil, + RecommendIds: &map[string]string{"key": "2026031817465122DCADE158861CDE62EC_17cf3282b23449a"}, + ShowCheckoutEntry: nil, + PickupPrepareTime: nil, + HomeInstallServiceTemplateId: nil, + CategoryPropertyPics: nil, } - fmt.Println("data====", err) + a.CreateStoreCommodity(param) } func TestGetCatePropertyV2(t *testing.T) { - data, err := a.GetCatePropertyV2(33622) - fmt.Println("err=====", err) - globals.SugarLogger.Debugf("data:=%s", utils.Format4Output(data, false)) - fmt.Println("data====", data) // 202209281558450102081001701D7B32C5 + categoryList, err := a.GetCatePropertyV2(1000002049) + if err != nil { + fmt.Println(err) + } + categoryMap := make(map[string][]map[string]interface{}) + for _, v := range categoryList.Data.Data { + if v.Required != model.YES { + continue + } + options := make([]map[string]interface{}, 0) + if v.PropertyName == "品牌" { + options = append(options, map[string]interface{}{"name": v.PropertyName, "value": 596120136, "diy_type": v.DiyType}) + categoryMap[utils.Int64ToStr(v.PropertyId)] = options + } else if v.PropertyName == "产地" { + options = append(options, map[string]interface{}{"name": v.PropertyName, "value": 13850, "diy_type": v.DiyType}) + categoryMap[utils.Int64ToStr(v.PropertyId)] = options + } else if v.PropertyName == "生鲜储存温度" { + options = append(options, map[string]interface{}{"name": v.PropertyName, "value": 2808, "diy_type": v.DiyType}) + categoryMap[utils.Int64ToStr(v.PropertyId)] = options + } else if len(v.Options) == 0 { + options = append(options, map[string]interface{}{"name": v.PropertyName, "value": 0, "diy_type": v.DiyType}) + categoryMap[utils.Int64ToStr(v.PropertyId)] = options + } else { + options = append(options, map[string]interface{}{"name": v.PropertyName, "value": utils.Str2Int64(v.Options[0].Value), "diy_type": v.DiyType}) + categoryMap[utils.Int64ToStr(v.PropertyId)] = options + } + } + productFormatNew := utils.Format4Output(categoryMap, false) + fmt.Println(productFormatNew) } func TestInt16(t *testing.T) { @@ -79,78 +205,78 @@ func TestEiduPrice(t *testing.T) { fmt.Println(err) } -// s上架1 -func TestEditStoreCommodity(t *testing.T) { - a.GetProductUpdateRule(32241) - err := a.EditStoreCommodity(&product_editV2_request.ProductEditV2Param{ - 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\":\"70122700701\",\"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-0", - }, - SellChannel: []int64{0}, - DelayRule: nil, - MaterialVideoId: "", - PickupMethod: "0", - SizeInfoTemplateId: 0, - SubstituteGoodsUrl: "", - SaleChannelType: "", - NamePrefix: "", - StoreId: 0, - MainProductId: 0, - SaleLimitId: 0, - }) - t.Fatal(err) -} +//// s上架1 +//func TestEditStoreCommodity(t *testing.T) { +// a.GetProductUpdateRule(32241) +// err := a.EditStoreCommodity(&product_editV2_request.ProductEditV2Param{ +// 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\":\"70122700701\",\"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-0", +// }, +// SellChannel: []int64{0}, +// DelayRule: nil, +// MaterialVideoId: "", +// PickupMethod: "0", +// SizeInfoTemplateId: 0, +// SubstituteGoodsUrl: "", +// SaleChannelType: "", +// NamePrefix: "", +// StoreId: 0, +// MainProductId: 0, +// SaleLimitId: 0, +// }) +// t.Fatal(err) +//} // 上架2 func TestEditStoreCommodity2(t *testing.T) { @@ -223,8 +349,8 @@ func TestDeleteSkuAndUploadSkuFengJinBiXu222(t *testing.T) { Status: 0, CheckStatus: 3, // 1-未提交;2-待审核;3-审核通过;4-审核未通过;5-封禁;7-审核通过待上架 Page: int64(i), - Size: 1, - StoreId: 152631194, + Size: 10, + StoreId: 255085124, }) if err != nil { globals.SugarLogger.Debugf("=index := %d ,err := %s", i, utils.Format4Output(err, false)) @@ -278,6 +404,9 @@ func TestDeleteSkuAndUploadSku55(t *testing.T) { globals.SugarLogger.Debugf("err := %s", utils.Format4Output(v, false)) } } +func TestDelete(t *testing.T) { + a.DeleteStoreCommodity(3809577644748571000) +} // 删除已经创建商品,重新同步 func TestDeleteSkuAndUploadSku7(t *testing.T) { diff --git a/platformapi/tiktok_shop/tiktok_api/sku_warehouse.go b/platformapi/tiktok_shop/tiktok_api/sku_warehouse.go index 63133001..1b715e69 100644 --- a/platformapi/tiktok_shop/tiktok_api/sku_warehouse.go +++ b/platformapi/tiktok_shop/tiktok_api/sku_warehouse.go @@ -57,6 +57,8 @@ func (a *API) BatchUploadImages(imgs []Imgs) (map[string]material_batchUploadIma img.FolderId = TiktokFolder1 case TiktokFloderKeyBeautifulKey: img.FolderId = TiktokFolder4 + case 260477060: + img.FolderId = "0" } param = append(param, img) } diff --git a/platformapi/tiktok_shop/tiktok_api/sku_warehouse_test.go b/platformapi/tiktok_shop/tiktok_api/sku_warehouse_test.go index 3220bc3a..67d76570 100644 --- a/platformapi/tiktok_shop/tiktok_api/sku_warehouse_test.go +++ b/platformapi/tiktok_shop/tiktok_api/sku_warehouse_test.go @@ -44,9 +44,12 @@ func TestUploadImg(t *testing.T) { //fmt.Println(err) //fmt.Println(data) //// logid 202209281425150101351501360B6DB460 - detail := "http://image.jxc4.com/image/a683f420e42e7f377998794cc3838114.jpg" - ImgOrigin := "http://image.jxc4.com/image/155162a672092721088cc26b88178886.png" - GetTiktokImgList(a, "668619", "", detail, ImgOrigin) + detail := "https://image.jxc4.com/image/af51596be83bee4ca9dd71d0a6380b38.jpg" + ImgOrigin := "https://image.jxc4.com/image/f7b0b4c6e13eadbf7852110dee602f39.png" + img1, img2, err := GetTiktokImgList(a, "668619", "", detail, ImgOrigin) + fmt.Println(img1) + fmt.Println(img2) + fmt.Println(err) } // GetTiktokImgList 获取抖音图片链接 diff --git a/platformapi/tiktok_shop/tiktok_api/store_test.go b/platformapi/tiktok_shop/tiktok_api/store_test.go index ca84914b..23d6f485 100644 --- a/platformapi/tiktok_shop/tiktok_api/store_test.go +++ b/platformapi/tiktok_shop/tiktok_api/store_test.go @@ -95,7 +95,7 @@ func TestGetStoreList2(t *testing.T) { //获取门店详细信息 func TestGetStoreDetail(t *testing.T) { data, err := a.GetStoreDetail(&shop_getStoreDetail_request.ShopGetStoreDetailParam{ - StoreId: "209723410", + StoreId: "255085124", }) if len(data.StoreDetail.Store.OpenTime.DayMap) != 0 { globals.SugarLogger.Debugf("-------data := %s", utils.Format4Output(data.StoreDetail.Store.OpenTime.DayMap, false)) diff --git a/platformapi/tonglianpayapi/tonglianpayapi_test.go b/platformapi/tonglianpayapi/tonglianpayapi_test.go index 1ab8a5ea..b0694813 100644 --- a/platformapi/tonglianpayapi/tonglianpayapi_test.go +++ b/platformapi/tonglianpayapi/tonglianpayapi_test.go @@ -23,11 +23,14 @@ func init() { func TestCreateUnitorderOrder(t *testing.T) { result, err := api.CreateUnitorderOrder(&CreateUnitorderOrderParam{ - Reqsn: "88320943177180", - Trxamt: 10, - NotifyUrl: "http://callback.test.jxc4.com/tlpay/msg/", - Acct: "ojWb10M_8kV8NT0aZJa6A5umG1c8", - PayType: PayTypeZfbJS, + CusID: "", + AppID: "", + Trxamt: 903, + Reqsn: "88511379245872", + NotifyUrl: "http://callback.jxc4.com/tonglian/msg/", + Acct: "ojWb10K9G43un9OmdPhKuy6ho8LI", + PayType: "W06", + SubAppID: "wx4b5930c13f8b1170", }) if err != nil { t.Fatal(err) diff --git a/platformapi/weixinapi/sns_send_order.go b/platformapi/weixinapi/sns_send_order.go new file mode 100644 index 00000000..d9215ae5 --- /dev/null +++ b/platformapi/weixinapi/sns_send_order.go @@ -0,0 +1,62 @@ +package weixinapi + +import ( + "encoding/json" + "fmt" +) + +// SNSSendGoodsOrder 小程序订单发货 https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/order-shipping/order-shipping.html#%E4%B8%80%E3%80%81%E5%8F%91%E8%B4%A7%E4%BF%A1%E6%81%AF%E5%BD%95%E5%85%A5%E6%8E%A5%E5%8F%A3 +func (a *API) SNSSendGoodsOrder(param *SNSSendOrderParameter) error { + body, _ := json.Marshal(param) + if a.CBGetToken() == "" { + a.CBRetrieveToken() + } + _, err := a.AccessAPI("wxa/sec/order/upload_shipping_info", nil, string(body)) + return err +} + +// SNSSendOrderParameter 小程序订单发货 +type SNSSendOrderParameter struct { + OrderKey struct { + OrderNumberType int `json:"order_number_type"` + TransactionId string `json:"transaction_id"` + Mchid string `json:"mchid"` + OutTradeNo string `json:"out_trade_no"` + } `json:"order_key"` + LogisticsType int `json:"logistics_type"` + DeliveryMode int `json:"delivery_mode"` + IsAllDelivered bool `json:"is_all_delivered"` + ShippingList []ShippingList `json:"shipping_list"` + UploadTime string `json:"upload_time"` + Payer struct { + Openid string `json:"openid"` + } `json:"payer"` +} +type ShippingList struct { + TrackingNo string `json:"tracking_no"` + ExpressCompany string `json:"express_company"` + ItemDesc string `json:"item_desc"` + Contact struct { + ConsignorContact string `json:"consignor_contact"` + ReceiverContact string `json:"receiver_contact"` + } `json:"contact"` +} + +// SNSDeliveryGoodsOrder 订单送达推送 +func (a *API) SNSDeliveryGoodsOrder(param *DeliveryOrder) error { + body, _ := json.Marshal(param) + if a.CBGetToken() == "" { + a.CBRetrieveToken() + } + result, err := a.AccessAPI("wxa/sec/order/notify_confirm_receive", nil, string(body)) + fmt.Println(result) + return err +} + +type DeliveryOrder struct { + TransactionId string `json:"transaction_id"` // 原支付交易对应的微信订单号 + MerchantId string `json:"merchant_id"` // 支付下单商户的商户号,由微信支付生成并下发 + MerchantTradeNo string `json:"merchant_trade_no"` // 商户系统内部订单号 + SubMerchantId string `json:"sub_merchant_id"` // 二级商户号 + ReceivedTime int64 `json:"received_time"` // 10快递签收时间,时间戳形式。 +} diff --git a/platformapi/weixinapi/sns_test.go b/platformapi/weixinapi/sns_test.go index 87db375b..b46ad55a 100644 --- a/platformapi/weixinapi/sns_test.go +++ b/platformapi/weixinapi/sns_test.go @@ -1,6 +1,10 @@ package weixinapi -import "testing" +import ( + "fmt" + "testing" + "time" +) func TestSNSRetrieveToken(t *testing.T) { result, err := api.SNSRetrieveToken("021UGn0006ICgQ13UC1005f2kD4UGn0r") @@ -37,3 +41,51 @@ func TestSNSGetUserInfo(t *testing.T) { } sugarLogger.Debug(result) } + +func TestSNSSendGoodsOrder(t *testing.T) { + param := &SNSSendOrderParameter{ + OrderKey: struct { + OrderNumberType int `json:"order_number_type"` + TransactionId string `json:"transaction_id"` + Mchid string `json:"mchid"` + OutTradeNo string `json:"out_trade_no"` + }{ + OrderNumberType: 2, + TransactionId: "4200003055202603242074503838", + }, + LogisticsType: 1, + DeliveryMode: 1, + IsAllDelivered: false, + ShippingList: append([]ShippingList{}, ShippingList{ + TrackingNo: "88512032279168", + ExpressCompany: "YD", + ItemDesc: "背心袋测试", + Contact: struct { + ConsignorContact string `json:"consignor_contact"` + ReceiverContact string `json:"receiver_contact"` + }{}, + }), + UploadTime: time.Now().Format(time.RFC3339), + Payer: struct { + Openid string `json:"openid"` + }{ + Openid: "ojWb10P-E520p3WZSClXclSBR_20", + }, + } + + api.SNSSendGoodsOrder(param) +} + +func TestSNSDeliveryGoodsOrder(t *testing.T) { + api.SNSDeliveryGoodsOrder(&DeliveryOrder{ + TransactionId: "4200003007202603198574473654", + MerchantId: "", + MerchantTradeNo: "", + SubMerchantId: "", + ReceivedTime: time.Now().Unix(), + }) +} + +func TestName(t *testing.T) { + fmt.Println(411 / 50) +} diff --git a/platformapi/weixinapi/weixinapi_test.go b/platformapi/weixinapi/weixinapi_test.go index 7cabb1f5..16d84e97 100644 --- a/platformapi/weixinapi/weixinapi_test.go +++ b/platformapi/weixinapi/weixinapi_test.go @@ -24,9 +24,9 @@ func init() { // 果园 //api = New("wx2d6949f724b2541d", "11f3c380551c4683c149990b004d6df9") - // 菜市 wixnapp2 - //api = New("wx4b5930c13f8b1170", "2a57228a716ce991a52739f0ff41111d") - api = New("wx2bb99eb5d2c9b82c", "6bbbed1443cc062c20a015a64c07a531") + // 菜市 wixnapp2(物料/菜市) + api = New("wx4b5930c13f8b1170", "2a57228a716ce991a52739f0ff41111d") + //api = New("wx2bb99eb5d2c9b82c", "6bbbed1443cc062c20a015a64c07a531") //api.CBSetToken("79_3x4gI4IFn9JKJd0EouSLe2HYFFoscRntAYCTZec4VLBlgivhOR0D2vp0mF0u6T-DmzbnAXotpTs_5Yp5Knxak7bfaMDzoaFMZM14r5n4CKpNTOaLH4PSyap2TnALTKgAHASAR") - api.CBSetToken("duyaeVYUsz8LuKBqJeQO1NX6KmoC43yfMsbJybcRJ3e") + api.CBSetToken("102_563eM-1LcfFzyjU00n-W036LZg1IHVzSrIi0FEj4ylD915aYUpB9nOJBe21UKFBhHHs_xzoyZXvcO_HOQ1-De-F9-W3H1CHyHFQe8SiCORnMlSnQaQkIPXTiMpERZWcAEAUCZ") }