| | |
| | | import java.io.IOException; |
| | | import java.net.URLEncoder; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @RestController |
| | | @Slf4j |
| | |
| | | @Autowired |
| | | private SnowflakeIdWorker snowflakeIdWorker; |
| | | |
| | | @GetMapping(value = "/pla/dropdownValues/list") |
| | | @ManagerAuth(memo = "获取下拉选择框值列表") |
| | | public R list() { |
| | | List<DropdownValuesDto> list = plaService.getDropdownValues(); |
| | | Map<String, List<String>> map = new HashMap<>(); |
| | | |
| | | // owner 去重并加入 map |
| | | List<String> owners = list.stream() |
| | | .filter(dropdownValuesDto -> dropdownValuesDto.getType().equals("owner")) |
| | | .map(DropdownValuesDto::getValue) |
| | | .collect(Collectors.toList()); |
| | | map.put("owner", owners); |
| | | |
| | | // workshop 去重并加入 map |
| | | List<String> workshops = list.stream() |
| | | .filter(dropdownValuesDto -> dropdownValuesDto.getType().equals("workshop")) |
| | | .map(DropdownValuesDto::getValue) |
| | | .collect(Collectors.toList()); |
| | | map.put("workshop", workshops); |
| | | return R.ok(map); |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = "/pla/list/auth") |
| | | @ManagerAuth |