提交 | 用户 | 时间
|
e7c126
|
1 |
package com.iailab.module.system.controller.app.dict; |
H |
2 |
|
|
3 |
import com.iailab.framework.common.enums.CommonStatusEnum; |
|
4 |
import com.iailab.framework.common.pojo.CommonResult; |
|
5 |
import com.iailab.framework.common.util.object.BeanUtils; |
|
6 |
import com.iailab.module.system.controller.app.dict.vo.AppDictDataRespVO; |
|
7 |
import com.iailab.module.system.dal.dataobject.dict.DictDataDO; |
|
8 |
import com.iailab.module.system.service.dict.DictDataService; |
|
9 |
import io.swagger.v3.oas.annotations.Operation; |
|
10 |
import io.swagger.v3.oas.annotations.Parameter; |
|
11 |
import io.swagger.v3.oas.annotations.tags.Tag; |
|
12 |
import org.springframework.validation.annotation.Validated; |
|
13 |
import org.springframework.web.bind.annotation.GetMapping; |
|
14 |
import org.springframework.web.bind.annotation.RequestMapping; |
|
15 |
import org.springframework.web.bind.annotation.RequestParam; |
|
16 |
import org.springframework.web.bind.annotation.RestController; |
|
17 |
|
|
18 |
import javax.annotation.Resource; |
|
19 |
import java.util.List; |
|
20 |
|
|
21 |
import static com.iailab.framework.common.pojo.CommonResult.success; |
|
22 |
|
|
23 |
@Tag(name = "用户 App - 字典数据") |
|
24 |
@RestController |
|
25 |
@RequestMapping("/system/dict-data") |
|
26 |
@Validated |
|
27 |
public class AppDictDataController { |
|
28 |
|
|
29 |
@Resource |
|
30 |
private DictDataService dictDataService; |
|
31 |
|
|
32 |
@GetMapping("/type") |
|
33 |
@Operation(summary = "根据字典类型查询字典数据信息") |
|
34 |
@Parameter(name = "type", description = "字典类型", required = true, example = "common_status") |
|
35 |
public CommonResult<List<AppDictDataRespVO>> getDictDataListByType(@RequestParam("type") String type) { |
|
36 |
List<DictDataDO> list = dictDataService.getDictDataList( |
|
37 |
CommonStatusEnum.ENABLE.getStatus(), type); |
|
38 |
return success(BeanUtils.toBean(list, AppDictDataRespVO.class)); |
|
39 |
} |
|
40 |
|
|
41 |
} |