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 selectAll(){ try { List list = sv.selectAll() ; return BaseResponseUtils.buildSuccess(list); } catch (Exception e) { log.error("得到所有demo用户异常", e); return BaseResponseUtils.buildException(e.getMessage()) ; } } }