1
This commit is contained in:
@@ -1,125 +0,0 @@
|
||||
package tiktok_api
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"git.rosy.net.cn/baseapi"
|
||||
address_create_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/address_create/request"
|
||||
afterSale_Detail_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/afterSale_Detail/request"
|
||||
afterSale_rejectReasonCodeList_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/afterSale_rejectReasonCodeList/request"
|
||||
shop_batchCreateStore_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/shop_batchCreateStore/request"
|
||||
"go.uber.org/zap"
|
||||
"testing"
|
||||
)
|
||||
|
||||
var (
|
||||
api *address_create_request.AddressCreateRequest
|
||||
sugarLogger *zap.SugaredLogger
|
||||
)
|
||||
|
||||
func init() {
|
||||
logger, _ := zap.NewDevelopment()
|
||||
sugarLogger = logger.Sugar()
|
||||
baseapi.Init(sugarLogger)
|
||||
|
||||
// sandbox
|
||||
// api = New("7136048270014416392", "c397aa9f-3927-47c4-8cfe-4d84e02602e0")
|
||||
// prod
|
||||
api = address_create_request.New()
|
||||
}
|
||||
|
||||
func TestCreateToken(t *testing.T) {
|
||||
api2 := New("7136048270014416392", "c397aa9f-3927-47c4-8cfe-4d84e02602e0", "")
|
||||
accessToken, err := api2.CreateToken("bb52688c-7bca-4b64-8747-5258a9a6ba33")
|
||||
fmt.Println(err)
|
||||
fmt.Println(accessToken)
|
||||
}
|
||||
|
||||
func TestRefreshToken(t *testing.T) {
|
||||
accesstoken := `{"access_token":"6c4d71b3-831c-4a96-8d2e-977e37afba5a","expires_in":604800,"scope":"SCOPE","shop_id":"","shop_name":"小时达开放平台对接专用店","refresh_token":"65aae144-4cc0-44d2-89ba-5d3062caca41","authority_id":""}`
|
||||
api2 := New("7136048270014416392", "c397aa9f-3927-47c4-8cfe-4d84e02602e0", accesstoken)
|
||||
data, err := api2.RefreshToken()
|
||||
fmt.Println(err)
|
||||
fmt.Println(data)
|
||||
}
|
||||
|
||||
// {"access_token":"90868a42-1287-4453-ba71-34c72f22e886","expires_in":555553,"scope":"SCOPE","shop_id":"","shop_name":"小时达开放平台对接专用店","refresh_token":"4e8cf946-8df1-4489-be88-f96f2d4603a8","authority_id ":""}
|
||||
func TestCreateStore(t *testing.T) {
|
||||
accesstoken := `{"access_token":"6c4d71b3-831c-4a96-8d2e-977e37afba5a","expires_in":604800,"scope":"SCOPE","shop_id":"","shop_name":"小时达开放平台对接 专用店","refresh_token":"65aae144-4cc0-44d2-89ba-5d3062caca41","authority_ id":""}`
|
||||
a := New("7136048270014416392", "c397aa9f-3927-47c4-8cfe-4d84e02602e0", accesstoken)
|
||||
request := address_create_request.New()
|
||||
param := request.GetParams()
|
||||
param.StoreId = 666667
|
||||
|
||||
storeParam := &address_create_request.Address{}
|
||||
storeParam.UserName = "火车南站店"
|
||||
storeParam.Mobile = "13688039650"
|
||||
storeParam.ProvinceId = 510000
|
||||
storeParam.CityId = 510100
|
||||
storeParam.TownId = 510107
|
||||
storeParam.Detail = "四川省成都市武侯区火车南站综合市场蔬菜区27-28号"
|
||||
storeParam.StreetId = 222
|
||||
storeParam.LinkType = 0
|
||||
storeParam.FixedPhone = "13688039650"
|
||||
storeParam.Remark = "抖音火车南站测试门店"
|
||||
param.Address = storeParam
|
||||
data, err := request.Execute(a.accessTokenObj)
|
||||
t.Fatal("err===========", err)
|
||||
fmt.Println("data==", fmt.Sprintf("%v", data))
|
||||
}
|
||||
|
||||
func TestCreateStoreList(t *testing.T) {
|
||||
accesstoken := `{"access_token":"6c4d71b3-831c-4a96-8d2e-977e37afba5a","expires_in":604800,"scope":"SCOPE","shop_id":"","shop_name":"小时达开放平台对接 专用店","refresh_token":"65aae144-4cc0-44d2-89ba-5d3062caca41","authority_ id":""}`
|
||||
a := New("7136048270014416392", "c397aa9f-3927-47c4-8cfe-4d84e02602e0", accesstoken)
|
||||
request := shop_batchCreateStore_request.New()
|
||||
//param := request.GetParams()
|
||||
|
||||
//storeList := make([]*shop_batchCreateStore_request.ShopBatchCreateStoreParam, 0)
|
||||
list := &shop_batchCreateStore_request.StoreList{
|
||||
RowID: 1,
|
||||
Name: "黄田市场店测试",
|
||||
StoreCode: "667510",
|
||||
Longitude: "113.846355",
|
||||
Latitude: "22.62557",
|
||||
Province: "510000",
|
||||
City: "510100",
|
||||
District: "510107",
|
||||
Address: "深圳西乡黄田市场大夫天路北三巷八号",
|
||||
Contact: "18981810340",
|
||||
OpenTime: shop_batchCreateStore_request.OpenTime{DayMap: map[string]string{"1": "07:00-19:00"}},
|
||||
}
|
||||
request.Param.StoreList = append(request.Param.StoreList, list)
|
||||
resp, err := request.Execute(a.accessTokenObj)
|
||||
t.Fatal("err===========", err)
|
||||
t.Fatalf("resp===========:%v", resp)
|
||||
|
||||
}
|
||||
|
||||
func TestNamGetRejectReasonCodeList(t *testing.T) {
|
||||
accesstoken := `{"access_token":"6c4d71b3-831c-4a96-8d2e-977e37afba5a","expires_in":604800,"scope":"SCOPE","shop_id":"","shop_name":"小时达开放平台对接 专用店","refresh_token":"65aae144-4cc0-44d2-89ba-5d3062caca41","authority_ id":""}`
|
||||
a := New("7136048270014416392", "c397aa9f-3927-47c4-8cfe-4d84e02602e0", accesstoken)
|
||||
request := afterSale_rejectReasonCodeList_request.New()
|
||||
date, _ := request.Execute(a.accessTokenObj)
|
||||
for _, v := range date.Data.Items {
|
||||
fmt.Println(v.RejectReasonCode)
|
||||
fmt.Println(v.Reason)
|
||||
}
|
||||
}
|
||||
|
||||
func TestSturctToMap(t *testing.T) {
|
||||
aa := `{"access_token":"6c4d71b3-831c-4a96-8d2e-977e37afba5a","expires_in":604800,"scope":"SCOPE","shop_id":"","shop_name":"小时达开放平台对接 专用店","refresh_token":"65aae144-4cc0-44d2-89ba-5d3062caca41","authority_ id":""}`
|
||||
fmt.Println(len(aa))
|
||||
}
|
||||
|
||||
func TestGetOrder(t *testing.T) {
|
||||
accesstoken := `{"access_token":"90868a42-1287-4453-ba71-34c72f22e886","expires_in":30536,"scope":"SCOPE","shop_id":"","shop_name":"小时达开放平台对接专用店","refresh_token":"4e8cf946-8df1-4489-be88-f96f2d4603a8","authority_id ":""}`
|
||||
a := New("7136048270014416392", "c397aa9f-3927-47c4-8cfe-4d84e02602e0", accesstoken)
|
||||
|
||||
request := afterSale_Detail_request.New()
|
||||
param := request.GetParams()
|
||||
param.AfterSaleId = "4981791596669925176"
|
||||
|
||||
result, err := request.Execute(a.accessTokenObj)
|
||||
|
||||
fmt.Println("err", err)
|
||||
fmt.Println("result===", result)
|
||||
}
|
||||
@@ -1,166 +0,0 @@
|
||||
package tiktok_api
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
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_getStoreFreight_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/shop_getStoreFreight/request"
|
||||
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(a.accessTokenObj)
|
||||
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(a.accessTokenObj)
|
||||
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(a.accessTokenObj)
|
||||
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(a.accessTokenObj)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if response.Code != 1000 {
|
||||
return nil, errors.New(response.Msg)
|
||||
}
|
||||
return response.Data, nil
|
||||
}
|
||||
|
||||
//门店绑定限售模板
|
||||
func (a *API) 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(a.accessTokenObj)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if response.Code != 1000 {
|
||||
return nil, errors.New(response.Msg)
|
||||
}
|
||||
return response.Data, nil
|
||||
}
|
||||
|
||||
// GetStoreFreight 获取门店绑定的限售模板
|
||||
func (a *API) GetStoreFreight(storeId int64) (int64, error) {
|
||||
request := shop_getStoreFreight_request.New()
|
||||
request.Param.StoreId = storeId
|
||||
|
||||
result, err := request.Execute(a.accessTokenObj)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
if result.Code != RequestSuccessCode {
|
||||
return 0, errors.New(result.SubMsg)
|
||||
}
|
||||
|
||||
if len(result.Data.StoreFreights) == 0 {
|
||||
return 0, errors.New(fmt.Sprintf("此门[%d]店暂未绑定运费模板", storeId))
|
||||
}
|
||||
return result.Data.StoreFreights[0].FreightId, nil
|
||||
}
|
||||
@@ -1,11 +1,5 @@
|
||||
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 (
|
||||
|
||||
//限购模型
|
||||
@@ -31,41 +25,46 @@ const (
|
||||
TradeLimitSubjectReceivingMobile = 5 //收件电话
|
||||
TradeLimitSubjectIDCard = 6 //身份证号
|
||||
TradeLimitSubjectPayAccount = 7 //支付账号
|
||||
|
||||
//联系方式类型
|
||||
LinkTypePhone = 0 //手机
|
||||
LinkTypeOrdinary = 1 //普通座机
|
||||
LinkTypeEnterprise = 2 //企业座机
|
||||
)
|
||||
|
||||
//门店信息
|
||||
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"` //变成已开户的时间
|
||||
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 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"` //变成已开户的时间
|
||||
}
|
||||
|
||||
//关联抖店信息
|
||||
@@ -83,26 +82,26 @@ type RelShopUser struct {
|
||||
|
||||
//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"` //营业时间
|
||||
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 OpenTime `json:"open_time"` //营业时间
|
||||
}
|
||||
|
||||
//营业时间
|
||||
type OpenTime struct {
|
||||
DayMap map[string]string `json:"day_map"`
|
||||
Custom string `json:"custom"` //暂时不使用
|
||||
DayMap map[int]string `json:"day_map"`
|
||||
Custom string `json:"custom"` //暂时不使用
|
||||
}
|
||||
|
||||
//负责人信息
|
||||
@@ -121,34 +120,37 @@ type StoreDetail struct {
|
||||
|
||||
//批量创建门店
|
||||
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
|
||||
StoreList []*StoreList `json:"store_list"`
|
||||
}
|
||||
type StoreList 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 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
|
||||
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"` //营业时间
|
||||
StoreID int `json:"store_id"` //创建成功的门店ID
|
||||
}
|
||||
|
||||
//暂停营业
|
||||
@@ -165,11 +167,26 @@ type UnsuspendStoreReq struct {
|
||||
|
||||
//创建限售规则模板
|
||||
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"` //限购时间
|
||||
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 // 支付账号
|
||||
}
|
||||
|
||||
//门店绑定限售模板
|
||||
@@ -177,3 +194,21 @@ type BindBindStoreSaleLimitReq struct {
|
||||
StoreID int64 `json:"store_id"` //门店ID
|
||||
SaleLimitID int64 `json:"sale_limit_id"` //限售模板ID
|
||||
}
|
||||
|
||||
//创建店铺地址库
|
||||
type CreateAddressReq struct {
|
||||
Address *Address `json:"address"` // 地址信息
|
||||
StoreId int64 `json:"store_id"` // 门店ID(新建地址绑定在该门店下,非门店场景无需填写)
|
||||
}
|
||||
type Address struct {
|
||||
UserName string `json:"user_name"` // 联系人姓名
|
||||
Mobile string `json:"mobile"` // 手机号码
|
||||
ProvinceId int64 `json:"province_id"` // 省份ID
|
||||
CityId int64 `json:"city_id"` // 城市ID
|
||||
TownId int64 `json:"town_id"` // 区ID
|
||||
Detail string `json:"detail"` // 详细地址
|
||||
StreetId int64 `json:"street_id"` // 街道ID
|
||||
LinkType int32 `json:"link_type"` // 联系方式类型(0-手机,1-普通座机,2-企业座机)
|
||||
FixedPhone string `json:"fixed_phone"` // 普通座机格式:区号-座机号-分机号(分机号选填)、区号3~4位、座机号7~8位、分机号不超过5位。企业座机:400/800开头不超过10位、95开头在5~8we
|
||||
Remark string `json:"remark"` // 售后备注
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user