达达新接口

This commit is contained in:
gazebo
2020-02-07 11:31:39 +08:00
parent 354f826e66
commit 29d85fe970
4 changed files with 24 additions and 114 deletions

View File

@@ -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