添加国美api,删除老版本蜂鸟API,添加抖音授权api、
This commit is contained in:
@@ -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