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
package com.dy.pmsGlobal.global;
 
 
import com.dy.common.aop.SsoPowerAop;
import com.dy.common.webUtil.BaseResponse;
import com.dy.common.webUtil.BaseResponseUtils;
import com.dy.pmsGlobal.pojoBa.BaUser;
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.RestController;
 
/**
 * 系统设置
 */
@Slf4j
@RestController
@RequestMapping(path = "sysSet")
@SuppressWarnings("unchecked")//java版本越高,对泛型约束越严,所以配置SuppressWarnings("unchecked")
public class SysSetCtrl {
 
    @Autowired
    private SysSetSv sv;
 
    /**
     * 得到唯一系统设置
     * @return 唯一系统设置
     */
    //@GetMapping(path = "one", consumes = MediaType.TEXT_PLAIN_VALUE)//指前端向后传的参数类型
    @GetMapping(path = "one")
    //@SsoAop() //只有登录验证,没有权限验证
    @SsoPowerAop(power = "-1") //登录与权限同时验证
    public BaseResponse<BaUser> single() {
        try {
            return BaseResponseUtils.buildSuccess(this.sv.selectSingle());
        } catch (Exception e) {
            log.error("查询一个用户数据异常", e);
            return BaseResponseUtils.buildException(e.getMessage());
        }
    }
}