wuzeyu
2024-01-26 351577011aacad0d80394db206702a69bccc962b
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
package com.dy.pipIrrDemo.role;
 
 
import com.dy.common.webUtil.BaseResponse;
import com.dy.common.webUtil.BaseResponseUtils;
import com.dy.pipIrrGlobal.pojoDemo.DemoRole;
import com.dy.pipIrrGlobal.pojoDemo.DemoUser;
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="role")
@SuppressWarnings("unchecked")
public class RoleCtrl {
 
    @Autowired
    RoleSv sv ;
 
    @GetMapping("selectAll")
    public BaseResponse<DemoUser> selectAll(){
        try {
            List<DemoRole> list  = sv.selectAll() ;
            return BaseResponseUtils.buildSuccess(list);
        } catch (Exception e) {
            log.error("得到所有demo用户异常", e);
            return BaseResponseUtils.buildException(e.getMessage()) ;
        }
    }
}