xiaoyong931011
2021-12-17 083aadec140d59c23d7a8fa64b8e9faaca183ac9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package cc.mrbird.febs.video.controller;
 
import cc.mrbird.febs.common.entity.FebsResponse;
import cc.mrbird.febs.video.conversion.DataDicConversion;
import cc.mrbird.febs.video.entity.DataDictionaryCustom;
import cc.mrbird.febs.video.mapper.DataDictionaryCustomMapper;
import cc.mrbird.febs.video.vo.DataDicVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
 
import java.util.List;
 
/**
 * @author wzy
 * @date 2021-12-17
 **/
@Slf4j
@RestController
@RequestMapping(value = "/api/common/")
@RequiredArgsConstructor
@Api(value = "ApiDataDictionaryController", tags = "字典类")
public class ApiDataDictionaryController {
 
    private final DataDictionaryCustomMapper dataDictionaryCustomMapper;
 
    @ApiOperation(value = "根据type获取字典值", notes = "根据type获取字典值")
    @ApiResponses({
            @ApiResponse(code = 200, message = "success", response = DataDicVo.class)
    })
    @GetMapping(value = "/findDataByDicType")
    public FebsResponse findDataByDicType(@RequestParam("type") String type) {
        List<DataDictionaryCustom> dataDic = dataDictionaryCustomMapper.selectByType(type);
        return new FebsResponse().success().data(DataDicConversion.INSTANCE.entitiesToVos(dataDic));
    }
 
}