Merge branch 'master' of e.coding.net:rosydev/baseapi

This commit is contained in:
邹宗楠
2022-11-14 15:20:58 +08:00
3 changed files with 61 additions and 37 deletions

View File

@@ -45,40 +45,40 @@ func (c *ShopGetStoreListRequest) GetParams() *ShopGetStoreListParam {
} }
type ShopGetStoreListParam struct { type ShopGetStoreListParam struct {
// 门店名称集合,不支持模糊 //// 门店名称集合,不支持模糊
StoreNameList []string `json:"store_name_list"` //StoreNameList []string `json:"store_name_list"`
// 门店id集合用于查询门店信息 //// 门店id集合用于查询门店信息
StoreIdList []int64 `json:"store_id_list"` //StoreIdList []int64 `json:"store_id_list"`
// 门店编码,开发者自定义 //// 门店编码,开发者自定义
StoreCodeList []string `json:"store_code_list"` //StoreCodeList []string `json:"store_code_list"`
// 绑定状态1绑定中;2绑定成功;3:资质验证中;4账户认证中;5正常营业(c端可下单) //// 绑定状态1绑定中;2绑定成功;3:资质验证中;4账户认证中;5正常营业(c端可下单)
State int64 `json:"state"` //State int64 `json:"state"`
// poi审核状态0无提审;1审核中;2审核成功;3驳回 //// poi审核状态0无提审;1审核中;2审核成功;3驳回
PoiAuditState []int64 `json:"poi_audit_state"` //PoiAuditState []int64 `json:"poi_audit_state"`
// 省 //// 省
Province string `json:"province"` //Province string `json:"province"`
// 市 //// 市
City string `json:"city"` //City string `json:"city"`
// 区 //// 区
District string `json:"district"` //District string `json:"district"`
// 门店poiId集合 //// 门店poiId集合
PoiIdList []int64 `json:"poi_id_list"` //PoiIdList []int64 `json:"poi_id_list"`
// 门店名称,支持模糊查询 //// 门店名称,支持模糊查询
NameFuzzy string `json:"name_fuzzy"` //NameFuzzy string `json:"name_fuzzy"`
// 门店编码,支持模糊查询 //// 门店编码,支持模糊查询
StoreCodeFuzzy string `json:"store_code_fuzzy"` //StoreCodeFuzzy string `json:"store_code_fuzzy"`
// 资质审核状态0未提交1审核中2审核通过3驳回 //// 资质审核状态0未提交1审核中2审核通过3驳回
QualState int64 `json:"qual_state"` //QualState int64 `json:"qual_state"`
// 账户验证状态0未提交1验证中2通过3失败 //// 账户验证状态0未提交1验证中2通过3失败
RemitState int64 `json:"remit_state"` //RemitState int64 `json:"remit_state"`
// 开户状态0未开户;1已开户 //// 开户状态0未开户;1已开户
OpenAccountState int64 `json:"open_account_state"` //OpenAccountState int64 `json:"open_account_state"`
// 是否需要poi审核信息只要审核状态的审核不要传true需要详细的提交信息时传true //// 是否需要poi审核信息只要审核状态的审核不要传true需要详细的提交信息时传true
IsNeedPoiAuditInfo bool `json:"is_need_poi_audit_info"` //IsNeedPoiAuditInfo bool `json:"is_need_poi_audit_info"`
// 是否需要关联的抖店信息只要shopId不要传true需要关联店铺名称等信息时传true //// 是否需要关联的抖店信息只要shopId不要传true需要关联店铺名称等信息时传true
IsNeedRelShopUser bool `json:"is_need_rel_shop_user"` //IsNeedRelShopUser bool `json:"is_need_rel_shop_user"`
// 第几页(从0开始) // 第几页(从0开始)
Page int64 `json:"page"` Page string `json:"page"`
// 每页条数 // 每页条数
PageSize int64 `json:"page_size"` PageSize string `json:"page_size"`
} }

View File

@@ -24,7 +24,6 @@ import (
shop_getStoreDetail_response "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/shop_getStoreDetail/response" shop_getStoreDetail_response "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/shop_getStoreDetail/response"
shop_getStoreFreight_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/shop_getStoreFreight/request" shop_getStoreFreight_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/shop_getStoreFreight/request"
shop_getStoreList_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/shop_getStoreList/request" shop_getStoreList_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/shop_getStoreList/request"
shop_getStoreList_response "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/shop_getStoreList/response"
shop_getStoreSaleLimit_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/shop_getStoreSaleLimit/request" shop_getStoreSaleLimit_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/shop_getStoreSaleLimit/request"
shop_setStorePackageFee_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/shop_setStorePackageFee/request" shop_setStorePackageFee_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/shop_setStorePackageFee/request"
shop_storeSuspend_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/shop_storeSuspend/request" shop_storeSuspend_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/shop_storeSuspend/request"
@@ -140,8 +139,13 @@ func (a *API) UnsuspendStore(param *shop_unsuspendStore_request.ShopUnsuspendSto
return response.Data, nil return response.Data, nil
} }
type VendorAndStoreId struct {
StoreId string `json:"store_id"` //京西本地ID
VendorStoreID int64 `json:"vendor_store_id"` //抖店平台ID
}
//门店列表分页查询 //门店列表分页查询
func (a *API) GetStoreList(param *shop_getStoreList_request.ShopGetStoreListParam) (*shop_getStoreList_response.ShopGetStoreListData, error) { func (a *API) GetStoreList(param *shop_getStoreList_request.ShopGetStoreListParam) (map[int64]string, error) {
request := shop_getStoreList_request.New() request := shop_getStoreList_request.New()
request.Param = param request.Param = param
response, err := request.Execute(a.accessTokenObj) response, err := request.Execute(a.accessTokenObj)
@@ -151,7 +155,14 @@ func (a *API) GetStoreList(param *shop_getStoreList_request.ShopGetStoreListPara
if response.Code != RequestSuccessCode { if response.Code != RequestSuccessCode {
return nil, errors.New(response.SubMsg) return nil, errors.New(response.SubMsg)
} }
return response.Data, nil //测试用
resp := map[int64]string{}
if len(response.Data.StoreDetailList) > 0 {
for _, v := range response.Data.StoreDetailList {
resp[v.Store.StoreId] = v.Store.StoreCode
}
}
return resp, err
} }
//创建限售规则模板 //创建限售规则模板

View File

@@ -7,6 +7,7 @@ import (
shop_batchCreateStore_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/shop_batchCreateStore/request" shop_batchCreateStore_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/shop_batchCreateStore/request"
shop_bindStoreSaleLimit_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/shop_bindStoreSaleLimit/request" shop_bindStoreSaleLimit_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/shop_bindStoreSaleLimit/request"
shop_editStore_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/shop_editStore/request" shop_editStore_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/shop_editStore/request"
shop_getStoreList_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/shop_getStoreList/request"
shop_storeSuspend_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/shop_storeSuspend/request" shop_storeSuspend_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/shop_storeSuspend/request"
shop_unsuspendStore_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/shop_unsuspendStore/request" shop_unsuspendStore_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/shop_unsuspendStore/request"
trade_createTradeLimitTemplate_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/trade_createTradeLimitTemplate/request" trade_createTradeLimitTemplate_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/trade_createTradeLimitTemplate/request"
@@ -52,6 +53,18 @@ func TestCreateStore(t *testing.T) {
fmt.Println("err==", err) fmt.Println("err==", err)
} }
//门店列表分页查询
func TestGetStoreList(t *testing.T) {
data, err := a.GetStoreList(&shop_getStoreList_request.ShopGetStoreListParam{
Page: "1",
PageSize: "20",
})
for _, v := range data {
fmt.Println(v)
}
fmt.Println(err)
}
func TestSysnc(t *testing.T) { func TestSysnc(t *testing.T) {
fmt.Println((2 & 2) != 0) // 创建 fmt.Println((2 & 2) != 0) // 创建
} }