优化GetMyStoreListNew的返回数据
This commit is contained in:
@@ -368,7 +368,7 @@ func GetStoreList4User(ctx *jxcontext.Context, mobileNum, userID string) (storeL
|
|||||||
return storeList, err
|
return storeList, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetMyStoreListNew(ctx *jxcontext.Context) (storeList []*dao.StoreWithCityName, errCode string, err error) {
|
func GetMyStoreListNew(ctx *jxcontext.Context) (storesInfo interface{}, errCode string, err error) {
|
||||||
if !auth2.IsV2Token(ctx.GetToken()) {
|
if !auth2.IsV2Token(ctx.GetToken()) {
|
||||||
return nil, model.ErrCodeTokenIsInvalid, model.ErrTokenIsInvalid
|
return nil, model.ErrCodeTokenIsInvalid, model.ErrTokenIsInvalid
|
||||||
}
|
}
|
||||||
@@ -376,8 +376,25 @@ func GetMyStoreListNew(ctx *jxcontext.Context) (storeList []*dao.StoreWithCityNa
|
|||||||
if mobileNum == "" {
|
if mobileNum == "" {
|
||||||
return nil, "", fmt.Errorf("不能得到用户手机号")
|
return nil, "", fmt.Errorf("不能得到用户手机号")
|
||||||
}
|
}
|
||||||
storeList, err = GetStoreList4User(ctx, mobileNum, userID)
|
var storeList []*dao.StoreWithCityName
|
||||||
return storeList, "", err
|
if storeList, err = GetStoreList4User(ctx, mobileNum, userID); err == nil && len(storeList) > 0 {
|
||||||
|
// todo,应该用通过方法
|
||||||
|
mapDataList := make([]map[string]interface{}, len(storeList))
|
||||||
|
for k, v := range storeList {
|
||||||
|
mapDataList[k] = map[string]interface{}{
|
||||||
|
"id": v.ID,
|
||||||
|
"address": v.Address,
|
||||||
|
"cityName": v.CityName,
|
||||||
|
"name": v.Name,
|
||||||
|
"tel1": v.Tel1,
|
||||||
|
"tel2": v.Tel2,
|
||||||
|
"payeeName": v.PayeeName,
|
||||||
|
"status": v.Status,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
storesInfo = mapDataList
|
||||||
|
}
|
||||||
|
return storesInfo, "", err
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetStoreRoleList(ctx *jxcontext.Context) (roleList []*authz.RoleInfo, err error) {
|
func GetStoreRoleList(ctx *jxcontext.Context) (roleList []*authz.RoleInfo, err error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user