mirror of
https://github.com/vran-dev/databasir.git
synced 2025-08-22 03:28:04 +08:00
feat: add ut (#66)
This commit is contained in:
@@ -39,9 +39,9 @@ public class OperationLogService {
|
||||
|
||||
private final OperationLogPojoConverter operationLogPojoConverter;
|
||||
|
||||
public void save(OperationLogRequest request) {
|
||||
public Long save(OperationLogRequest request) {
|
||||
OperationLogPojo pojo = operationLogRequestConverter.toPojo(request);
|
||||
operationLogDao.insertAndReturnId(pojo);
|
||||
return operationLogDao.insertAndReturnId(pojo);
|
||||
}
|
||||
|
||||
public Page<OperationLogPageResponse> list(Pageable page,
|
||||
|
@@ -56,11 +56,11 @@ public class LoginService {
|
||||
UserPojo user = userDao.selectOptionalById(login.getUserId())
|
||||
.orElseThrow(() -> {
|
||||
log.warn("user not exists but refresh token exists for " + login.getRefreshToken());
|
||||
return DomainErrors.INVALID_REFRESH_TOKEN_OPERATION.exception();
|
||||
return DomainErrors.INVALID_REFRESH_TOKEN_OPERATION.exception("invalid user");
|
||||
});
|
||||
if (!user.getEnabled()) {
|
||||
log.warn("user disabled but refresh token exists for " + login.getRefreshToken());
|
||||
throw DomainErrors.INVALID_REFRESH_TOKEN_OPERATION.exception();
|
||||
throw DomainErrors.INVALID_REFRESH_TOKEN_OPERATION.exception("invalid user status");
|
||||
}
|
||||
String accessToken = jwtTokens.accessToken(user.getEmail());
|
||||
LocalDateTime accessTokenExpireAt = jwtTokens.expireAt(accessToken);
|
||||
|
Reference in New Issue
Block a user