|
@ -15,8 +15,6 @@ import lombok.RequiredArgsConstructor; |
|
|
import org.springframework.data.domain.Pageable; |
|
|
import org.springframework.data.domain.Pageable; |
|
|
import org.springframework.data.domain.Sort; |
|
|
import org.springframework.data.domain.Sort; |
|
|
import org.springframework.data.web.PageableDefault; |
|
|
import org.springframework.data.web.PageableDefault; |
|
|
import org.springframework.http.HttpStatus; |
|
|
|
|
|
import org.springframework.http.ResponseEntity; |
|
|
|
|
|
import org.springframework.security.access.prepost.PreAuthorize; |
|
|
import org.springframework.security.access.prepost.PreAuthorize; |
|
|
import org.springframework.validation.annotation.Validated; |
|
|
import org.springframework.validation.annotation.Validated; |
|
|
import org.springframework.web.bind.annotation.*; |
|
|
import org.springframework.web.bind.annotation.*; |
|
@ -36,20 +34,20 @@ public class DictDetailController { |
|
|
|
|
|
|
|
|
@ApiOperation("查询字典详情") |
|
|
@ApiOperation("查询字典详情") |
|
|
@GetMapping |
|
|
@GetMapping |
|
|
public ResponseEntity<Object> queryDictDetail(DictDetailQueryCriteria criteria, |
|
|
|
|
|
|
|
|
public ApiResponse<Object> queryDictDetail(DictDetailQueryCriteria criteria, |
|
|
@PageableDefault(sort = {"dictSort"}, direction = Sort.Direction.ASC) Pageable pageable) { |
|
|
@PageableDefault(sort = {"dictSort"}, direction = Sort.Direction.ASC) Pageable pageable) { |
|
|
return new ResponseEntity<>(dictDetailService.queryAll(criteria, pageable), HttpStatus.OK); |
|
|
|
|
|
|
|
|
return ApiResponse.success(dictDetailService.queryAll(criteria, pageable)); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ApiOperation("查询多个字典详情") |
|
|
@ApiOperation("查询多个字典详情") |
|
|
@GetMapping(value = "/map") |
|
|
@GetMapping(value = "/map") |
|
|
public ResponseEntity<Object> getDictDetailMaps(@RequestParam String dictName) { |
|
|
|
|
|
|
|
|
public ApiResponse<Object> getDictDetailMaps(@RequestParam String dictName) { |
|
|
String[] names = dictName.split("[,,]"); |
|
|
String[] names = dictName.split("[,,]"); |
|
|
Map<String, List<DictDetailDto>> dictMap = new HashMap<>(16); |
|
|
Map<String, List<DictDetailDto>> dictMap = new HashMap<>(16); |
|
|
for (String name : names) { |
|
|
for (String name : names) { |
|
|
dictMap.put(name, dictDetailService.getDictByName(name)); |
|
|
dictMap.put(name, dictDetailService.getDictByName(name)); |
|
|
} |
|
|
} |
|
|
return new ResponseEntity<>(dictMap, HttpStatus.OK); |
|
|
|
|
|
|
|
|
return ApiResponse.success(dictMap); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Log("新增字典详情") |
|
|
@Log("新增字典详情") |
|
|