提交 5399eb3d authored 作者: liupengfei's avatar liupengfei

--no commit message

上级 37a7ee4f
package com.zrqx.member.bg.vip.controller;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
......@@ -14,6 +15,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.zrqx.core.enums.ResponseCodeEnum;
import com.zrqx.core.enums.member.VipEnum;
import com.zrqx.core.exception.BaseException;
import com.zrqx.core.util.page.PageInfo;
import com.zrqx.core.util.page.PageParam;
......@@ -89,6 +91,22 @@ public class VipController {
return CallBack.success(page);
}
@ApiOperation(value = "所有vip类型列表" , notes ="所有vip类型")
@GetMapping(value = "/type/list")
public CallBack<Map<String,Integer>> queryTypeList(){
Map<String, Integer> map = VipEnum.getAllEnumMap();
map = sortList(map);
return CallBack.success(map);
}
public Map<String, Integer> sortList(Map<String, Integer> map){
Map<String, Integer> result = map.entrySet().stream()
.sorted(Map.Entry.comparingByKey())
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue,
(oldValue, newValue) -> oldValue, LinkedHashMap::new));
return result;
}
/**
* 去标签
* @param list
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论