添加国美api,删除老版本蜂鸟API,添加抖音授权api、
This commit is contained in:
@@ -70,14 +70,14 @@ func TestCreateStore(t *testing.T) {
|
||||
api = New("6705486294797503379", "c1e6c280-e618-4103-9d0a-673bc54fb22e", "5375691", "cabrXQf9eFMVWVYg4hNlwu")
|
||||
token, _ := api.GetAccessToken()
|
||||
api.accessToken = token.BusinessDataObj.AccessToken
|
||||
err, _ := api.CreateStore(&CreateStoreBaseInfo{
|
||||
HeadShopName: "刘磊测试门店",
|
||||
data, err := api.CreateStore(&CreateStoreBaseInfo{
|
||||
HeadShopName: "刘磊测试门店10",
|
||||
ContactPhone: "18981810340",
|
||||
Address: "四川成都",
|
||||
Longitude: 104.094555,
|
||||
Latitude: 30.661382,
|
||||
PositionSource: 3,
|
||||
OutShopCode: "637910",
|
||||
OutShopCode: "6379110",
|
||||
CategoryID: "12",
|
||||
OwnerName: "刘磊",
|
||||
OwnerIDNum: "511324199308263974",
|
||||
@@ -99,6 +99,7 @@ func TestCreateStore(t *testing.T) {
|
||||
TabacooLicensePicHash: "",
|
||||
})
|
||||
fmt.Println(err)
|
||||
fmt.Println(data)
|
||||
}
|
||||
|
||||
func TestUpdataStore(t *testing.T) {
|
||||
@@ -195,3 +196,7 @@ func TestDataUnmas(t *testing.T) {
|
||||
fmt.Println("retsult", retsult.CallbackBusinessType)
|
||||
fmt.Println("retsult", retsult.Param.PartnerOrderCode)
|
||||
}
|
||||
|
||||
func TestErr2CallbackResponse(t *testing.T) {
|
||||
fmt.Println(20 & 2)
|
||||
}
|
||||
|
||||
@@ -27,6 +27,14 @@ const (
|
||||
ShopUpdateStatusAuditOnline = 30 // 审核驳回
|
||||
)
|
||||
|
||||
type CreateStoreStruct struct {
|
||||
Sign string `json:"sign"` //返回值签名,详见开放平台侧返回值签名算法
|
||||
Code string `json:"code"` //错误码,详见开放平台侧错误码映射表
|
||||
Msg string `json:"msg"` //错误信息
|
||||
BusinessData string `json:"business_data"` // string
|
||||
ApiCode string `json:"api_code"` // string
|
||||
}
|
||||
|
||||
func (a *API) CreateStore(createStoreParam *CreateStoreBaseInfo) (result1 string, err error) {
|
||||
requestHead := a.MakeFnRequestHead()
|
||||
storeByte, err := json.Marshal(createStoreParam)
|
||||
@@ -39,13 +47,19 @@ func (a *API) CreateStore(createStoreParam *CreateStoreBaseInfo) (result1 string
|
||||
return "", err
|
||||
}
|
||||
|
||||
createShop := struct {
|
||||
ChainStoreId string `json:"chain_store_id"`
|
||||
}{}
|
||||
if err := json.Unmarshal([]byte(utils.Interface2String(result["business_data"])), &createShop); err != nil {
|
||||
createData := &CreateStoreStruct{}
|
||||
if err := utils.Map2StructByJson(result, createData, false); err != nil {
|
||||
return "", err
|
||||
}
|
||||
return createShop.ChainStoreId, nil
|
||||
|
||||
defaultResult := struct {
|
||||
ChainStoreId int64 `json:"chain_store_id"`
|
||||
}{}
|
||||
|
||||
if err := json.Unmarshal([]byte(createData.BusinessData), &defaultResult); err != nil {
|
||||
return "", err
|
||||
}
|
||||
return utils.Int64ToStr(defaultResult.ChainStoreId), err
|
||||
}
|
||||
|
||||
func (a *API) UpdateStore(updateStore *UpdateStoreParam) (err error) {
|
||||
|
||||
Reference in New Issue
Block a user