liurunyu
2023-11-04 df37487916ebc1ff8d8e0f8b088c5b6af1e582ff
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
package com.dy.pipIrrDemo.auth;
 
 
import com.dy.common.webUtil.BaseResponse;
import com.dy.common.webUtil.BaseResponseUtils;
import com.dy.pipIrrGlobal.pojoDemo.DemoAuth;
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;
 
import java.util.List;
 
@Slf4j
@RestController
@RequestMapping(path="auth")
@SuppressWarnings("unchecked")
public class AuthCtrl {
 
    @Autowired
    AuthSv sv ;
 
    @GetMapping("selectAll")
    public BaseResponse<DemoAuth> selectAll(){
        try {
            List<DemoAuth> list  = sv.selectAll() ;
            return BaseResponseUtils.buildSuccess(list);
        } catch (Exception e) {
            log.error("得到所有demo权限异常", e);
            return BaseResponseUtils.buildException(e.getMessage()) ;
        }
    }
}