作者 yangfu

字典数据排序

@@ -29,7 +29,21 @@ func (srv *CommonService) GetDictionaryByCode(getDictionaryQuery *query.GetDicti @@ -29,7 +29,21 @@ func (srv *CommonService) GetDictionaryByCode(getDictionaryQuery *query.GetDicti
29 if err != nil { 29 if err != nil {
30 return nil, err 30 return nil, err
31 } 31 }
32 - return result, nil 32 + var response = make([]interface{}, 0)
  33 + if result == nil || len(result.Dictionarys) == 0 {
  34 + return response, nil
  35 + }
  36 + for i := range getDictionaryQuery.DictCode {
  37 + code := getDictionaryQuery.DictCode[i]
  38 + for j := range result.Dictionarys {
  39 + item := result.Dictionarys[j]
  40 + if item.DictCode == code {
  41 + response = append(response, item)
  42 + break
  43 + }
  44 + }
  45 + }
  46 + return response, nil
33 } 47 }
34 48
35 //LatestVersionInfo 版本升级 49 //LatestVersionInfo 版本升级