shop
This commit is contained in:
@@ -2,6 +2,8 @@ package product_getProductUpdateRule_request
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
product_getProductUpdateRule_response "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/product_getProductUpdateRule/response"
|
||||
doudian_sdk "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/core"
|
||||
)
|
||||
|
||||
type ProductGetProductUpdateRuleRequest struct {
|
||||
@@ -20,7 +22,6 @@ func New() *ProductGetProductUpdateRuleRequest {
|
||||
request.SetConfig(doudian_sdk.GlobalConfig)
|
||||
request.SetClient(doudian_sdk.DefaultDoudianOpApiClient)
|
||||
return request
|
||||
|
||||
}
|
||||
|
||||
func (c *ProductGetProductUpdateRuleRequest) Execute(accessToken *doudian_sdk.AccessToken) (*product_getProductUpdateRule_response.ProductGetProductUpdateRuleResponse, error) {
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
package shop_batchCreateStore_request
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
shop_batchCreateStore_response "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/shop_batchCreateStore/response"
|
||||
doudian_sdk "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/core"
|
||||
)
|
||||
|
||||
type ShopBatchCreateStoreRequest struct {
|
||||
doudian_sdk.BaseDoudianOpApiRequest
|
||||
Param *ShopBatchCreateStoreParam
|
||||
}
|
||||
|
||||
type ShopBatchCreateStoreParam struct {
|
||||
RowID int64 `json:"row_id"`
|
||||
Name string `json:"name"`
|
||||
StoreCode string `json:"store_code"` //门店编码
|
||||
Longitude string `json:"longitude"` //经度
|
||||
Latitude string `json:"latitude"` //纬度
|
||||
Province string `json:"province"` //省份
|
||||
City string `json:"city"` //市
|
||||
District string `json:"district"` //区
|
||||
Address string `json:"address"` //详细地址
|
||||
Contact string `json:"contact"` //联系方式
|
||||
OpenTime OpenTime `json:"open_time"` //营业时间
|
||||
StoreID int64 `json:"store_id"` //创建成功的门店ID
|
||||
}
|
||||
type OpenTime struct {
|
||||
DayMap map[string]string `json:"day_map"`
|
||||
Custom string `json:"custom"` //暂时不使用
|
||||
}
|
||||
|
||||
func (c *ShopBatchCreateStoreRequest) GetUrlPath() string {
|
||||
return "/shop/batchCreateStore"
|
||||
}
|
||||
|
||||
func New() *ShopBatchCreateStoreRequest {
|
||||
request := &ShopBatchCreateStoreRequest{
|
||||
Param: &ShopBatchCreateStoreParam{},
|
||||
}
|
||||
request.SetConfig(doudian_sdk.GlobalConfig)
|
||||
request.SetClient(doudian_sdk.DefaultDoudianOpApiClient)
|
||||
return request
|
||||
}
|
||||
|
||||
func (c *ShopBatchCreateStoreRequest) Execute(accessToken *doudian_sdk.AccessToken) (*shop_batchCreateStore_response.ShopBatchCreateStoreResponse, error) {
|
||||
responseJson, err := c.GetClient().Request(c, accessToken)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
response := &shop_batchCreateStore_response.ShopBatchCreateStoreResponse{}
|
||||
_ = json.Unmarshal([]byte(responseJson), response)
|
||||
return response, nil
|
||||
}
|
||||
func (c *ShopBatchCreateStoreRequest) GetParamObject() interface{} {
|
||||
return c.Param
|
||||
}
|
||||
|
||||
func (c *ShopBatchCreateStoreRequest) GetParams() *ShopBatchCreateStoreParam {
|
||||
return c.Param
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package shop_batchCreateStore_response
|
||||
|
||||
import doudian_sdk "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/core"
|
||||
|
||||
type ShopBatchCreateStoreResponse struct {
|
||||
doudian_sdk.BaseDoudianOpApiResponse
|
||||
Data *ShopBatchCreateStoreData `json:"data"`
|
||||
}
|
||||
type DataItem struct {
|
||||
RowID int `json:"row_id"`
|
||||
Name string `json:"name"`
|
||||
StoreCode string `json:"store_code"` //门店编码
|
||||
Longitude string `json:"longitude"` //经度
|
||||
Latitude string `json:"latitude"` //纬度
|
||||
Province string `json:"province"` //省份
|
||||
City string `json:"city"` //市
|
||||
District string `json:"district"` //区
|
||||
Address string `json:"address"` //详细地址
|
||||
Contact string `json:"contact"` //联系方式
|
||||
OpenTime OpenTime `json:"open_time"` //营业时间
|
||||
}
|
||||
|
||||
type OpenTime struct {
|
||||
DayMap map[string]string `json:"day_map"`
|
||||
Custom string `json:"custom"` //暂时不使用
|
||||
}
|
||||
type ShopBatchCreateStoreData struct {
|
||||
Data []DataItem `json:"data"`
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package shop_bindStoreSaleLimit_request
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
shop_bindStoreSaleLimit_response "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/shop_bindStoreSaleLimit/response"
|
||||
|
||||
//shop_bindStoreSaleLimit_response "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/shop_bindStoreSaleLimit/response"
|
||||
doudian_sdk "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/core"
|
||||
)
|
||||
|
||||
type ShopBindStoreSaleLimitRequest struct {
|
||||
doudian_sdk.BaseDoudianOpApiRequest
|
||||
Param *ShopBindStoreSaleLimitParam
|
||||
}
|
||||
|
||||
type ShopBindStoreSaleLimitParam struct {
|
||||
StoreID int64 `json:"store_id"` //创建成功的门店ID
|
||||
SaleLimitID int64 `json:"sale_limit_id"` //限售模板ID
|
||||
}
|
||||
type OpenTime struct {
|
||||
DayMap map[string]string `json:"day_map"`
|
||||
Custom string `json:"custom"` //暂时不使用
|
||||
}
|
||||
|
||||
func (c *ShopBindStoreSaleLimitRequest) GetUrlPath() string {
|
||||
return "/shop/bindStoreSaleLimit"
|
||||
}
|
||||
|
||||
func New() *ShopBindStoreSaleLimitRequest {
|
||||
request := &ShopBindStoreSaleLimitRequest{
|
||||
Param: &ShopBindStoreSaleLimitParam{},
|
||||
}
|
||||
request.SetConfig(doudian_sdk.GlobalConfig)
|
||||
request.SetClient(doudian_sdk.DefaultDoudianOpApiClient)
|
||||
return request
|
||||
}
|
||||
|
||||
func (c *ShopBindStoreSaleLimitRequest) Execute(accessToken *doudian_sdk.AccessToken) (*shop_bindStoreSaleLimit_response.ShopBindStoreSaleLimitResponse, error) {
|
||||
responseJson, err := c.GetClient().Request(c, accessToken)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
response := &shop_bindStoreSaleLimit_response.ShopBindStoreSaleLimitResponse{}
|
||||
_ = json.Unmarshal([]byte(responseJson), response)
|
||||
return response, nil
|
||||
}
|
||||
func (c *ShopBindStoreSaleLimitRequest) GetParamObject() interface{} {
|
||||
return c.Param
|
||||
}
|
||||
|
||||
func (c *ShopBindStoreSaleLimitRequest) GetParams() *ShopBindStoreSaleLimitParam {
|
||||
return c.Param
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package shop_bindStoreSaleLimit_response
|
||||
|
||||
import doudian_sdk "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/core"
|
||||
|
||||
type ShopBindStoreSaleLimitResponse struct {
|
||||
doudian_sdk.BaseDoudianOpApiResponse
|
||||
Data *ShopBindStoreSaleLimitData `json:"data"`
|
||||
}
|
||||
|
||||
type ShopBindStoreSaleLimitData struct {
|
||||
}
|
||||
@@ -2,6 +2,8 @@ package shop_brandList_request
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
shop_brandList_response "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/shop_brandList/response"
|
||||
doudian_sdk "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/core"
|
||||
)
|
||||
|
||||
type ShopBrandListRequest struct {
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package shop_brandList_response
|
||||
|
||||
import doudian_sdk "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/core"
|
||||
|
||||
type ShopBrandListResponse struct {
|
||||
doudian_sdk.BaseDoudianOpApiResponse
|
||||
Data *ShopBrandListData `json:"data"`
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
package shop_editStore_request
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
shop_editStore_response "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/shop_editStore/response"
|
||||
doudian_sdk "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/core"
|
||||
)
|
||||
|
||||
type ShopEditStoreRequest struct {
|
||||
doudian_sdk.BaseDoudianOpApiRequest
|
||||
Param *ShopEditStoreParam
|
||||
}
|
||||
type ShopEditStoreParam struct {
|
||||
RowID int64 `json:"row_id"`
|
||||
Name string `json:"name"`
|
||||
StoreCode string `json:"store_code"` //门店编码
|
||||
Longitude string `json:"longitude"` //经度
|
||||
Latitude string `json:"latitude"` //纬度
|
||||
Province string `json:"province"` //省份
|
||||
City string `json:"city"` //市
|
||||
District string `json:"district"` //区
|
||||
Address string `json:"address"` //详细地址
|
||||
Contact string `json:"contact"` //联系方式
|
||||
OpenTime OpenTime `json:"open_time"` //营业时间
|
||||
StoreID int64 `json:"store_id"` //创建成功的门店ID
|
||||
}
|
||||
type OpenTime struct {
|
||||
DayMap map[string]string `json:"day_map"`
|
||||
Custom string `json:"custom"` //暂时不使用
|
||||
}
|
||||
|
||||
func (c *ShopEditStoreRequest) GetUrlPath() string {
|
||||
return "/shop/editStore"
|
||||
}
|
||||
|
||||
func New() *ShopEditStoreRequest {
|
||||
request := &ShopEditStoreRequest{
|
||||
Param: &ShopEditStoreParam{},
|
||||
}
|
||||
request.SetConfig(doudian_sdk.GlobalConfig)
|
||||
request.SetClient(doudian_sdk.DefaultDoudianOpApiClient)
|
||||
return request
|
||||
|
||||
}
|
||||
|
||||
func (c *ShopEditStoreRequest) Execute(accessToken *doudian_sdk.AccessToken) (*shop_editStore_response.ShopEditStoreResponse, error) {
|
||||
responseJson, err := c.GetClient().Request(c, accessToken)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
response := &shop_editStore_response.ShopEditStoreResponse{}
|
||||
_ = json.Unmarshal([]byte(responseJson), response)
|
||||
return response, nil
|
||||
}
|
||||
|
||||
func (c *ShopEditStoreRequest) GetParamObject() interface{} {
|
||||
return c.Param
|
||||
}
|
||||
|
||||
func (c *ShopEditStoreRequest) GetParams() *ShopEditStoreParam {
|
||||
return c.Param
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package shop_editStore_response
|
||||
|
||||
import doudian_sdk "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/core"
|
||||
|
||||
type ShopEditStoreResponse struct {
|
||||
doudian_sdk.BaseDoudianOpApiResponse
|
||||
Data *ShopEditStoreData `json:"data"`
|
||||
}
|
||||
type ShopEditStoreData struct {
|
||||
}
|
||||
@@ -2,6 +2,8 @@ package shop_getShopCategory_request
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
shop_getShopCategory_response "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/shop_getShopCategory/response"
|
||||
doudian_sdk "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/core"
|
||||
)
|
||||
|
||||
type ShopGetShopCategoryRequest struct {
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package shop_getShopCategory_response
|
||||
|
||||
import doudian_sdk "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/core"
|
||||
|
||||
type ShopGetShopCategoryResponse struct {
|
||||
doudian_sdk.BaseDoudianOpApiResponse
|
||||
Data *ShopGetShopCategoryData `json:"data"`
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
package shop_storeSuspend_request
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
shop_storeSuspend_response "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/shop_storeSuspend/response"
|
||||
doudian_sdk "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/core"
|
||||
)
|
||||
|
||||
type ShopStoreSuspendRequest struct {
|
||||
doudian_sdk.BaseDoudianOpApiRequest
|
||||
Param *ShopStoreSuspendParam
|
||||
}
|
||||
type ShopStoreSuspendParam struct {
|
||||
StoreID int64 `json:"store_id"` //门店ID
|
||||
Reason string `json:"reason"` //停业原因
|
||||
}
|
||||
|
||||
func (c *ShopStoreSuspendRequest) GetUrlPath() string {
|
||||
return "/shop/storeSuspend"
|
||||
}
|
||||
|
||||
func New() *ShopStoreSuspendRequest {
|
||||
request := &ShopStoreSuspendRequest{
|
||||
Param: &ShopStoreSuspendParam{},
|
||||
}
|
||||
request.SetConfig(doudian_sdk.GlobalConfig)
|
||||
request.SetClient(doudian_sdk.DefaultDoudianOpApiClient)
|
||||
return request
|
||||
|
||||
}
|
||||
|
||||
func (c *ShopStoreSuspendRequest) Execute(accessToken *doudian_sdk.AccessToken) (*shop_storeSuspend_response.ShopStoreSuspendResponse, error) {
|
||||
responseJson, err := c.GetClient().Request(c, accessToken)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
response := &shop_storeSuspend_response.ShopStoreSuspendResponse{}
|
||||
_ = json.Unmarshal([]byte(responseJson), response)
|
||||
return response, nil
|
||||
}
|
||||
|
||||
func (c *ShopStoreSuspendRequest) GetParamObject() interface{} {
|
||||
return c.Param
|
||||
}
|
||||
|
||||
func (c *ShopStoreSuspendRequest) GetParams() *ShopStoreSuspendParam {
|
||||
return c.Param
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package shop_storeSuspend_response
|
||||
|
||||
import doudian_sdk "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/core"
|
||||
|
||||
type ShopStoreSuspendResponse struct {
|
||||
doudian_sdk.BaseDoudianOpApiResponse
|
||||
Data *ShopStoreSuspendData `json:"data"`
|
||||
}
|
||||
type ShopStoreSuspendData struct {
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package shop_unsuspendStore_request
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
shop_unsuspendStore_response "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/shop_unsuspendStore/response"
|
||||
doudian_sdk "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/core"
|
||||
)
|
||||
|
||||
type ShopUnsuspendStoreRequest struct {
|
||||
doudian_sdk.BaseDoudianOpApiRequest
|
||||
Param *ShopUnsuspendStoreParam
|
||||
}
|
||||
type ShopUnsuspendStoreParam struct {
|
||||
StoreID int64 `json:"store_id"` //门店ID
|
||||
Reason string `json:"reason"` //停业原因
|
||||
}
|
||||
|
||||
func (c *ShopUnsuspendStoreRequest) GetUrlPath() string {
|
||||
return "/shop/unsuspendStore"
|
||||
}
|
||||
|
||||
func New() *ShopUnsuspendStoreRequest {
|
||||
request := &ShopUnsuspendStoreRequest{
|
||||
Param: &ShopUnsuspendStoreParam{},
|
||||
}
|
||||
request.SetConfig(doudian_sdk.GlobalConfig)
|
||||
request.SetClient(doudian_sdk.DefaultDoudianOpApiClient)
|
||||
return request
|
||||
|
||||
}
|
||||
|
||||
func (c *ShopUnsuspendStoreRequest) Execute(accessToken *doudian_sdk.AccessToken) (*shop_unsuspendStore_response.ShopUnsuspendStoreResponse, error) {
|
||||
responseJson, err := c.GetClient().Request(c, accessToken)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
response := &shop_unsuspendStore_response.ShopUnsuspendStoreResponse{}
|
||||
_ = json.Unmarshal([]byte(responseJson), response)
|
||||
return response, nil
|
||||
}
|
||||
|
||||
func (c *ShopUnsuspendStoreRequest) GetParamObject() interface{} {
|
||||
return c.Param
|
||||
}
|
||||
|
||||
func (c *ShopUnsuspendStoreRequest) GetParams() *ShopUnsuspendStoreParam {
|
||||
return c.Param
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package shop_unsuspendStore_response
|
||||
|
||||
import doudian_sdk "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/core"
|
||||
|
||||
type ShopUnsuspendStoreResponse struct {
|
||||
doudian_sdk.BaseDoudianOpApiResponse
|
||||
Data *ShopUnsuspendStoreData `json:"data"`
|
||||
}
|
||||
type ShopUnsuspendStoreData struct {
|
||||
}
|
||||
@@ -2,6 +2,8 @@ package sku_detail_request
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
sku_detail_response "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/sku_detail/response"
|
||||
doudian_sdk "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/core"
|
||||
)
|
||||
|
||||
type SkuDetailRequest struct {
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package sku_detail_response
|
||||
|
||||
import doudian_sdk "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/core"
|
||||
|
||||
type SkuDetailResponse struct {
|
||||
doudian_sdk.BaseDoudianOpApiResponse
|
||||
Data *SkuDetailData `json:"data"`
|
||||
|
||||
@@ -2,6 +2,8 @@ package sku_editPrice_request
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
sku_editPrice_response "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/sku_editPrice/response"
|
||||
doudian_sdk "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/core"
|
||||
)
|
||||
|
||||
type SkuEditPriceRequest struct {
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package sku_editPrice_response
|
||||
|
||||
import doudian_sdk "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/core"
|
||||
|
||||
type SkuEditPriceResponse struct {
|
||||
doudian_sdk.BaseDoudianOpApiResponse
|
||||
Data *SkuEditPriceData `json:"data"`
|
||||
|
||||
@@ -2,6 +2,8 @@ package sms_public_template_request
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
sms_public_template_response "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/sms_public_template/response"
|
||||
doudian_sdk "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/core"
|
||||
)
|
||||
|
||||
type SmsPublicTemplateRequest struct {
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
package trade_createTradeLimitTemplate_request
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
trade_createTradeLimitTemplate_response "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/trade_createTradeLimitTemplate/response"
|
||||
doudian_sdk "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/core"
|
||||
)
|
||||
|
||||
type TradeCreateTradeLimitTemplateRequest struct {
|
||||
doudian_sdk.BaseDoudianOpApiRequest
|
||||
Param *TradeCreateTradeLimitTemplateParam
|
||||
}
|
||||
|
||||
type TradeCreateTradeLimitTemplateParam struct {
|
||||
StoreID int64 `json:"store_id"` //门店ID
|
||||
TradeLimitRuleRequestList []*TradeLimitRuleRequestList `json:"trade_limit_rule_request_list"` //限购参数
|
||||
TradeLimitResourceObject TradeLimitResourceObject `json:"trade_limit_resource_object"` //限购资源值
|
||||
TradeLimitPattern TradeLimitPattern `json:"trade_limit_pattern"` //限购值,模型为重量则单位为毫克,模型为金额则单位为分
|
||||
TimePeriod TimePeriod `json:"time_period"` //限购时间
|
||||
}
|
||||
type TradeLimitRuleRequestList struct {
|
||||
TradeLimitModel int32 `json:"trade_limit_model"` //限购模型 1-重量,2-数量,3-地区,4-金额
|
||||
TradeLimitResource int32 `json:"trade_limit_resource"` //限购资源类别1-抖店,2-门店,3-商品ID,4-sku,5-类目,6-活动,7-商品标
|
||||
}
|
||||
type TradeLimitResourceObject struct {
|
||||
TradeLimitResourceIDList []string `json:"trade_limit_resource_id_list"` //限购资源值列表
|
||||
}
|
||||
type TradeLimitPattern struct {
|
||||
Minimum int64 `json:"minimum"` //单次下限
|
||||
Maximum int64 `json:"maximum"` //单次上限
|
||||
CumulativeMax int64 `json:"cumulative_max"` //累计限购值
|
||||
}
|
||||
type TimePeriod struct {
|
||||
TradeLimitSubjectList []int64 `json:"trade_limit_subject_list"` //限购维度1 // 端用户(比如uid=122,aid=1128) 2 // 用户组用户(比如uid=122,group=aweme) 3 // 设备 4 // 下单电话 5 // 收件电话 6 // 身份证号 7 // 支付账号
|
||||
}
|
||||
|
||||
func (c *TradeCreateTradeLimitTemplateRequest) GetUrlPath() string {
|
||||
return "/trade/createTradeLimitTemplate"
|
||||
}
|
||||
|
||||
func New() *TradeCreateTradeLimitTemplateRequest {
|
||||
request := &TradeCreateTradeLimitTemplateRequest{
|
||||
Param: &TradeCreateTradeLimitTemplateParam{},
|
||||
}
|
||||
request.SetConfig(doudian_sdk.GlobalConfig)
|
||||
request.SetClient(doudian_sdk.DefaultDoudianOpApiClient)
|
||||
return request
|
||||
}
|
||||
|
||||
func (c *TradeCreateTradeLimitTemplateRequest) Execute(accessToken *doudian_sdk.AccessToken) (*trade_createTradeLimitTemplate_response.TradeCreateTradeLimitTemplateResponse, error) {
|
||||
responseJson, err := c.GetClient().Request(c, accessToken)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
response := &trade_createTradeLimitTemplate_response.TradeCreateTradeLimitTemplateResponse{}
|
||||
_ = json.Unmarshal([]byte(responseJson), response)
|
||||
return response, nil
|
||||
}
|
||||
func (c *TradeCreateTradeLimitTemplateRequest) GetParamObject() interface{} {
|
||||
return c.Param
|
||||
}
|
||||
|
||||
func (c *TradeCreateTradeLimitTemplateRequest) GetParams() *TradeCreateTradeLimitTemplateParam {
|
||||
return c.Param
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package trade_createTradeLimitTemplate_response
|
||||
|
||||
import doudian_sdk "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/core"
|
||||
|
||||
type TradeCreateTradeLimitTemplateResponse struct {
|
||||
doudian_sdk.BaseDoudianOpApiResponse
|
||||
Data *TradeCreateTradeLimitTemplateData `json:"data"`
|
||||
}
|
||||
type TradeCreateTradeLimitTemplateData struct {
|
||||
TradeLimitID int64 `json:"trade_limit_id"` //限购模板ID
|
||||
}
|
||||
152
platformapi/tiktok_shop/tiktok_api/store.go
Normal file
152
platformapi/tiktok_shop/tiktok_api/store.go
Normal file
@@ -0,0 +1,152 @@
|
||||
package tiktok_api
|
||||
|
||||
import (
|
||||
"errors"
|
||||
shop_batchCreateStore_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/shop_batchCreateStore/request"
|
||||
shop_batchCreateStore_response "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/shop_batchCreateStore/response"
|
||||
shop_bindStoreSaleLimit_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/shop_bindStoreSaleLimit/request"
|
||||
shop_bindStoreSaleLimit_response "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/shop_bindStoreSaleLimit/response"
|
||||
shop_editStore_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/shop_editStore/request"
|
||||
shop_editStore_response "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/shop_editStore/response"
|
||||
shop_storeSuspend_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/shop_storeSuspend/request"
|
||||
shop_storeSuspend_response "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/shop_storeSuspend/response"
|
||||
shop_unsuspendStore_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/shop_unsuspendStore/request"
|
||||
shop_unsuspendStore_response "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/shop_unsuspendStore/response"
|
||||
trade_createTradeLimitTemplate_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/trade_createTradeLimitTemplate/request"
|
||||
trade_createTradeLimitTemplate_response "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/trade_createTradeLimitTemplate/response"
|
||||
)
|
||||
|
||||
//GetStoreDetail 单个获取门店信息
|
||||
func (a *Api) GetStoreDetail() {
|
||||
|
||||
}
|
||||
|
||||
//BatchCreateStore 批量创建门店
|
||||
func (a *Api) BatchCreateStore(storeInfo BatchCreateStoreReq) (*shop_batchCreateStore_response.ShopBatchCreateStoreData, error) {
|
||||
request := shop_batchCreateStore_request.New()
|
||||
request.Param = &shop_batchCreateStore_request.ShopBatchCreateStoreParam{
|
||||
RowID: int64(storeInfo.RowID),
|
||||
Name: storeInfo.Name,
|
||||
StoreCode: storeInfo.StoreCode,
|
||||
Longitude: storeInfo.Longitude,
|
||||
Latitude: storeInfo.Latitude,
|
||||
Province: storeInfo.Province,
|
||||
City: storeInfo.City,
|
||||
District: storeInfo.District,
|
||||
Address: storeInfo.Address,
|
||||
Contact: storeInfo.Contact,
|
||||
OpenTime: storeInfo.OpenTime,
|
||||
StoreID: int64(storeInfo.StoreID),
|
||||
}
|
||||
response, err := request.Execute(AccessToken)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if response.Code != 1000 {
|
||||
return nil, errors.New(response.Msg)
|
||||
}
|
||||
return response.Data, nil
|
||||
}
|
||||
|
||||
// EditStore 编辑门店
|
||||
func (a *Api) EditStore(storeInfo EditStoreReq) (*shop_editStore_response.ShopEditStoreData, error) {
|
||||
request := shop_editStore_request.New()
|
||||
request.Param = &shop_editStore_request.ShopEditStoreParam{
|
||||
RowID: int64(storeInfo.RowID),
|
||||
Name: storeInfo.Name,
|
||||
StoreCode: storeInfo.StoreCode,
|
||||
Longitude: storeInfo.Longitude,
|
||||
Latitude: storeInfo.Latitude,
|
||||
Province: storeInfo.Province,
|
||||
City: storeInfo.City,
|
||||
District: storeInfo.District,
|
||||
Address: storeInfo.Address,
|
||||
Contact: storeInfo.Contact,
|
||||
OpenTime: storeInfo.OpenTime,
|
||||
StoreID: int64(storeInfo.StoreID),
|
||||
}
|
||||
response, err := request.Execute(AccessToken)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if response.Code != 1000 {
|
||||
return nil, errors.New(response.Msg)
|
||||
}
|
||||
return response.Data, nil
|
||||
}
|
||||
|
||||
//暂停营业
|
||||
func (a *Api) StoreSuspend(info StoreSuspendReq) (*shop_storeSuspend_response.ShopStoreSuspendData, error) {
|
||||
request := shop_storeSuspend_request.New()
|
||||
request.Param = &shop_storeSuspend_request.ShopStoreSuspendParam{
|
||||
StoreID: int64(info.StoreID),
|
||||
Reason: info.Reason,
|
||||
}
|
||||
response, err := request.Execute(AccessToken)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if response.Code != 1000 {
|
||||
return nil, errors.New(response.Msg)
|
||||
}
|
||||
return response.Data, nil
|
||||
}
|
||||
|
||||
//门店恢复营业
|
||||
func (a *Api) UnsuspendStore(info UnsuspendStoreReq) (*shop_unsuspendStore_response.ShopUnsuspendStoreData, error) {
|
||||
request := shop_unsuspendStore_request.New()
|
||||
request.Param = &shop_unsuspendStore_request.ShopUnsuspendStoreParam{
|
||||
StoreID: int64(info.StoreID),
|
||||
Reason: info.Reason,
|
||||
}
|
||||
response, err := request.Execute(AccessToken)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if response.Code != 1000 {
|
||||
return nil, errors.New(response.Msg)
|
||||
}
|
||||
return response.Data, nil
|
||||
}
|
||||
|
||||
//创建限售规则模板
|
||||
func (a *Api) CreateTradeLimitTemplate(info CreateTradeLimitTemplateReq) (*trade_createTradeLimitTemplate_response.TradeCreateTradeLimitTemplateData, error) {
|
||||
request := trade_createTradeLimitTemplate_request.New()
|
||||
request.Param = &trade_createTradeLimitTemplate_request.TradeCreateTradeLimitTemplateParam{
|
||||
StoreID: info.StoreID,
|
||||
TradeLimitRuleRequestList: info.TradeLimitRuleRequestList,
|
||||
TradeLimitResourceObject: info.TradeLimitResourceObject,
|
||||
TradeLimitPattern: info.TradeLimitPattern,
|
||||
TimePeriod: info.TimePeriod,
|
||||
}
|
||||
response, err := request.Execute(AccessToken)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if response.Code != 1000 {
|
||||
return nil, errors.New(response.Msg)
|
||||
}
|
||||
return response.Data, nil
|
||||
}
|
||||
|
||||
//门店绑定限售模板
|
||||
func BindStoreSaleLimit(info BindBindStoreSaleLimitReq) (*shop_bindStoreSaleLimit_response.ShopBindStoreSaleLimitData, error) {
|
||||
request := shop_bindStoreSaleLimit_request.New()
|
||||
request.Param = &shop_bindStoreSaleLimit_request.ShopBindStoreSaleLimitParam{
|
||||
StoreID: info.StoreID,
|
||||
SaleLimitID: info.SaleLimitID,
|
||||
}
|
||||
response, err := request.Execute(AccessToken)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if response.Code != 1000 {
|
||||
return nil, errors.New(response.Msg)
|
||||
}
|
||||
return response.Data, nil
|
||||
}
|
||||
|
||||
//门店新增查询发货地址
|
||||
func AddressCreate() {
|
||||
|
||||
}
|
||||
179
platformapi/tiktok_shop/tiktok_api/store_model.go
Normal file
179
platformapi/tiktok_shop/tiktok_api/store_model.go
Normal file
@@ -0,0 +1,179 @@
|
||||
package tiktok_api
|
||||
|
||||
import (
|
||||
shop_batchCreateStore_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/shop_batchCreateStore/request"
|
||||
shop_editStore_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/shop_editStore/request"
|
||||
trade_createTradeLimitTemplate_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/trade_createTradeLimitTemplate/request"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
//限购模型
|
||||
TradeLimitModelWeight = 1 //重量
|
||||
TradeLimitModelQuantity = 2 //数量
|
||||
TradeLimitModelRegion = 3 //地区
|
||||
TradeLimitModelMoney = 4 //金额
|
||||
|
||||
//限购资源类型
|
||||
TradeLimitResourceDouDian = 1 //抖店
|
||||
TradeLimitResourceStore = 2 //门店
|
||||
TradeLimitResourceSkuID = 3 //商品ID
|
||||
TradeLimitResourceSku = 4 //sku
|
||||
TradeLimitResourceCategory = 5 //类目
|
||||
TradeLimitResourceActivity = 6 //活动
|
||||
TradeLimitResourceSkuLabel = 7 //商品标
|
||||
|
||||
//限购维度
|
||||
TradeLimitSubjectEndUser = 1 //端用户
|
||||
TradeLimitSubjectUserGroup = 2 //用户组用户
|
||||
TradeLimitSubjectDevice = 3 //设备
|
||||
TradeLimitSubjectBuyMobile = 4 //下单电话
|
||||
TradeLimitSubjectReceivingMobile = 5 //收件电话
|
||||
TradeLimitSubjectIDCard = 6 //身份证号
|
||||
TradeLimitSubjectPayAccount = 7 //支付账号
|
||||
)
|
||||
|
||||
//门店信息
|
||||
type Store struct {
|
||||
StoreID int `json:"id"`
|
||||
Name string `json:"name"`
|
||||
StoreCode string `json:"store_code"` //门店编码
|
||||
RelShopID int `json:"rel_shop_id"` //关联抖店Id
|
||||
PoiID int `json:"poi_id"`
|
||||
Longitude string `json:"longitude"` //经度
|
||||
Latitude string `json:"latitude"` //纬度
|
||||
Province string `json:"province"` //省份
|
||||
ProvinceCode string `json:"province_code"` //省份code
|
||||
City string `json:"city"` //市
|
||||
CityCode string `json:"city_code"` //城市code
|
||||
District string `json:"district"` //区
|
||||
DistrictCode string `json:"district_code"` //区code
|
||||
Town string `json:"town"` //街道/镇
|
||||
TownCode string `json:"town_code"` //街道/镇code
|
||||
Address string `json:"address"` //详细地址
|
||||
Contact string `json:"contact"` //联系方式
|
||||
OpenTime shop_batchCreateStore_request.OpenTime `json:"open_time"` //营业时间
|
||||
IsOpenNow bool `json:"is_open_now"` //当前时间是否在营业时间中,如果不在则是打烊中
|
||||
State int `json:"state"` //绑定状态 1绑定中;2绑定成功;3:资质验证中;4账户认证中;5正常营业(c端可下单);6暂停营业\
|
||||
PoiAuditState int `json:"poi_audit_state"` //poi审核子状态:1审核中;2绑定成功;3驳回
|
||||
QualState int `json:"qual_state"` //资质审核状态:0未提交;1审核中;2审核通过;3驳回
|
||||
RemitState int `json:"remit_state"` //账户验证状态:0未提交;1验证中;2通过;3失败
|
||||
OpenAccountState int `json:"open_account_state"` //开户状态:0未开户;1已开户
|
||||
SuspendType int `json:"suspend_type"` //停业类型:1商家主动操作;2平台处罚
|
||||
BoundTime int `json:"bound_time"` //绑定成功的时间
|
||||
CreateTime int `json:"create_time"` // 创建时间
|
||||
UpdateTime int `json:"update_time"` //更新时间
|
||||
QualPassTime int `json:"qual_pass_time"` //资质验证通过时间
|
||||
RemitPassTime int `json:"remit_pass_time"` //账户验证通过时间
|
||||
OpenAccountTime int `json:"open_account_time"` //变成已开户的时间
|
||||
}
|
||||
|
||||
//关联抖店信息
|
||||
type RelShopUser struct {
|
||||
ID int `json:"id"` //关联店铺ID
|
||||
ShopName string `json:"shop_name"` //店铺名称
|
||||
ShopChargeName string `json:"shop_charge_name"` //商家负责人
|
||||
ToutiaoID int `json:"toutiao_id"` //uid
|
||||
OceanID int `json:"ocean_id"` //商业化id
|
||||
OperateStatus int `json:"operate_status"` //营业状态,0正常营业 1停业整顿
|
||||
BizType int `json:"biz_type"` //业务类型 0二类电商 1放心购
|
||||
VType int `json:"v_type"` //资质类型 11个人 41 个体 0企业
|
||||
ShopType int `json:"shop_type"` //店铺类型 0普通,1专营,2专卖,3旗舰
|
||||
}
|
||||
|
||||
//poi审核信息
|
||||
type PoiAudiInfo struct {
|
||||
PoiAuditID string `json:"poi_audit_id"` //poi审核id
|
||||
PoiAuditState int `json:"poi_audit_state"` //poi审核子状态:1审核中;2绑定成功;3驳回
|
||||
StoreID int `json:"store_id"` //门店ID
|
||||
Name string `json:"name"` //门店名称
|
||||
StoreCode string `json:"store_code"` //门店编码
|
||||
Longitude string `json:"longitude"` //经度
|
||||
Latitude string `json:"latitude"` //纬度
|
||||
Province string `json:"province"` //省份
|
||||
ProvinceCode string `json:"province_code"` //省份code
|
||||
City string `json:"city"` //市
|
||||
District string `json:"district"` //区
|
||||
Address string `json:"address"` //详细地址
|
||||
Contact string `json:"contact"` //联系方式
|
||||
OpenTime shop_batchCreateStore_request.OpenTime `json:"open_time"` //营业时间
|
||||
}
|
||||
|
||||
//营业时间
|
||||
type OpenTime struct {
|
||||
DayMap map[string]string `json:"day_map"`
|
||||
Custom string `json:"custom"` //暂时不使用
|
||||
}
|
||||
|
||||
//负责人信息
|
||||
type StoreChargeInfo struct {
|
||||
ChargeName string `json:"charge_name"` //负责人姓名
|
||||
ChargeMoblie string `json:"charge_moblie"` //负责人电话
|
||||
}
|
||||
|
||||
//单个获取门店信息
|
||||
type StoreDetail struct {
|
||||
Store Store `json:"store"` //门店信息
|
||||
RelShopUser RelShopUser `json:"rel_shop_user"` //关联抖店信息
|
||||
PoiAudiInfo PoiAudiInfo `json:"poi_audi_info"` //poi审核信息
|
||||
StoreChargeInfo StoreChargeInfo `json:"store_charge_info"` //负责人信息
|
||||
}
|
||||
|
||||
//批量创建门店
|
||||
type BatchCreateStoreReq struct {
|
||||
RowID int `json:"row_id"`
|
||||
Name string `json:"name"`
|
||||
StoreCode string `json:"store_code"` //门店编码
|
||||
Longitude string `json:"longitude"` //经度
|
||||
Latitude string `json:"latitude"` //纬度
|
||||
Province string `json:"province"` //省份
|
||||
City string `json:"city"` //市
|
||||
District string `json:"district"` //区
|
||||
Address string `json:"address"` //详细地址
|
||||
Contact string `json:"contact"` //联系方式
|
||||
OpenTime shop_batchCreateStore_request.OpenTime `json:"open_time"` //营业时间
|
||||
StoreID int `json:"store_id"` //创建成功的门店ID
|
||||
}
|
||||
|
||||
//批量创建门店
|
||||
type EditStoreReq struct {
|
||||
RowID int `json:"row_id"`
|
||||
Name string `json:"name"`
|
||||
StoreCode string `json:"store_code"` //门店编码
|
||||
Longitude string `json:"longitude"` //经度
|
||||
Latitude string `json:"latitude"` //纬度
|
||||
Province string `json:"province"` //省份
|
||||
City string `json:"city"` //市
|
||||
District string `json:"district"` //区
|
||||
Address string `json:"address"` //详细地址
|
||||
Contact string `json:"contact"` //联系方式
|
||||
OpenTime shop_editStore_request.OpenTime `json:"open_time"` //营业时间
|
||||
StoreID int `json:"store_id"` //创建成功的门店ID
|
||||
}
|
||||
|
||||
//暂停营业
|
||||
type StoreSuspendReq struct {
|
||||
StoreID int `json:"store_id"` //门店ID
|
||||
Reason string `json:"reason"` //停业原因
|
||||
}
|
||||
|
||||
//门店恢复营业
|
||||
type UnsuspendStoreReq struct {
|
||||
StoreID int `json:"store_id"` //门店ID
|
||||
Reason string `json:"reason"` //停业原因
|
||||
}
|
||||
|
||||
//创建限售规则模板
|
||||
type CreateTradeLimitTemplateReq struct {
|
||||
StoreID int64 `json:"store_id"` //门店ID
|
||||
TradeLimitRuleRequestList []*trade_createTradeLimitTemplate_request.TradeLimitRuleRequestList `json:"trade_limit_rule_request_list"` //限购参数
|
||||
TradeLimitResourceObject trade_createTradeLimitTemplate_request.TradeLimitResourceObject `json:"trade_limit_resource_object"` //限购资源值
|
||||
TradeLimitPattern trade_createTradeLimitTemplate_request.TradeLimitPattern `json:"trade_limit_pattern"` //限购值,模型为重量则单位为毫克,模型为金额则单位为分
|
||||
TimePeriod trade_createTradeLimitTemplate_request.TimePeriod `json:"time_period"` //限购时间
|
||||
}
|
||||
|
||||
//门店绑定限售模板
|
||||
type BindBindStoreSaleLimitReq struct {
|
||||
StoreID int64 `json:"store_id"` //门店ID
|
||||
SaleLimitID int64 `json:"sale_limit_id"` //限售模板ID
|
||||
}
|
||||
Reference in New Issue
Block a user