zhubaomin
2024-08-30 7ccce6911249a0a9df42f2e04e7a34da4c66a6da
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
package com.dy.pipIrrBase.dict;
 
import com.dy.common.aop.SsoAop;
import com.dy.common.webUtil.BaseResponse;
import com.dy.common.webUtil.BaseResponseUtils;
import com.dy.pipIrrGlobal.voBa.VoDictItem;
import com.dy.pipIrrGlobal.voBa.VoMapCenter;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
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 ZhuBaoMin
 * @date 2024-06-26 20:36
 * @LastEditTime 2024-06-26 20:36
 * @Description
 */
 
@Slf4j
@Tag(name = "字典项管理", description = "字典项管理")
@RestController
@RequestMapping(path="dict_item")
public class DictCtrl {
    @Autowired
    private DictSv dictSv;
 
    /**
     * 根据字典Code获取字典项
     * @param dictCode
     * @return
     */
    @GetMapping(path = "some")
    @SsoAop()
    public BaseResponse<List<VoDictItem>> some(@RequestParam String dictCode){
        return BaseResponseUtils.buildSuccess(dictSv.getDictItemsByDictCode(dictCode));
    }
 
    /**
     * 根据配置项名称获取配置项值
     * @param itemName
     * @return
     */
    @GetMapping(path = "setting")
    @SsoAop()
    public BaseResponse<String> getSettingValue(String itemName) {
        return BaseResponseUtils.buildSuccess(dictSv.getItemValue(itemName));
    }
 
    /**
     * 获取地图中心坐标
     * @return
     */
    @GetMapping(path = "map_center")
    @SsoAop
    public BaseResponse<VoMapCenter> getMapCenter() {
        return BaseResponseUtils.buildSuccess(dictSv.getMapCenter());
    }
 
}