Search in sources :

Example 6 with User

use of com.vip.saturn.job.console.mybatis.entity.User in project Saturn by vipshop.

the class AuthorizationManageServiceImpl method validateUser.

protected void validateUser(UserRole userRole) throws SaturnJobConsoleException {
    String userName = userRole.getUserName();
    User user = userRepository.selectWithNotFilterDeleted(userName);
    if (user == null) {
        throw new SaturnJobConsoleException(String.format("用户名(%s)不存在", userName));
    }
}
Also used : User(com.vip.saturn.job.console.mybatis.entity.User) SaturnJobConsoleException(com.vip.saturn.job.console.exception.SaturnJobConsoleException)

Example 7 with User

use of com.vip.saturn.job.console.mybatis.entity.User in project Saturn by vipshop.

the class AuthorizationController method getLoginUser.

@ApiResponses(value = { @ApiResponse(code = 200, message = "Success/Fail", response = RequestResult.class) })
@GetMapping("/loginUser")
public SuccessResponseEntity getLoginUser(HttpSession httpSession) throws SaturnJobConsoleException {
    String currentLoginUserName = getCurrentLoginUserName();
    User user = authorizationService.getUser(currentLoginUserName);
    return new SuccessResponseEntity(user);
}
Also used : User(com.vip.saturn.job.console.mybatis.entity.User) SuccessResponseEntity(com.vip.saturn.job.console.controller.SuccessResponseEntity) GetMapping(org.springframework.web.bind.annotation.GetMapping) ApiResponses(io.swagger.annotations.ApiResponses)

Aggregations

User (com.vip.saturn.job.console.mybatis.entity.User)7 SuccessResponseEntity (com.vip.saturn.job.console.controller.SuccessResponseEntity)3 ApiResponses (io.swagger.annotations.ApiResponses)3 SaturnJobConsoleException (com.vip.saturn.job.console.exception.SaturnJobConsoleException)2 Audit (com.vip.saturn.job.console.aop.annotation.Audit)1 UserRole (com.vip.saturn.job.console.mybatis.entity.UserRole)1 Date (java.util.Date)1 Test (org.junit.Test)1 Transactional (org.springframework.transaction.annotation.Transactional)1 GetMapping (org.springframework.web.bind.annotation.GetMapping)1 PostMapping (org.springframework.web.bind.annotation.PostMapping)1 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)1