达达新接口
This commit is contained in:
@@ -43,10 +43,7 @@ type ShopInfo struct {
|
||||
Password string `json:"password,omitempty"`
|
||||
|
||||
NewShopID string `json:"new_shop_id,omitempty"` // 修改用
|
||||
|
||||
BDName string `json:"bd_name,omitempty"` // 查询用
|
||||
BDPhone string `json:"bd_phone,omitempty"` // 查询用
|
||||
Status int `json:"status,omitempty"` // 查询用
|
||||
Status int `json:"status"` // 修改用,0是有效值
|
||||
}
|
||||
|
||||
type AddShopFailedInfo struct {
|
||||
@@ -97,7 +94,12 @@ func (a *API) ShopAdd(shopInfo *ShopInfo) (outOriginShopID string, err error) {
|
||||
}
|
||||
|
||||
func (a *API) BatchShopAdd(shopInfoList []*ShopInfo) (addResult *AddShopResult, err error) {
|
||||
result, err := a.AccessAPI("api/shop/add", shopInfoList)
|
||||
mapList := make([]map[string]interface{}, len(shopInfoList))
|
||||
for k, v := range shopInfoList {
|
||||
mapList[k] = utils.Struct2MapByJson(v)
|
||||
delete(mapList[k], "status") // 创建时没有status参数
|
||||
}
|
||||
result, err := a.AccessAPI("api/shop/add", mapList)
|
||||
err2 := utils.Map2StructByJson(result.Result, &addResult, false)
|
||||
if err == nil {
|
||||
err = err2
|
||||
|
||||
Reference in New Issue
Block a user