mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-07-17 20:45:06 +08:00
增加 podam 随机生成对象,简化单元测试的成本
This commit is contained in:
@ -122,7 +122,7 @@ public class DBConfigRepository extends AbstractConfigRepository {
|
||||
|
||||
private Properties buildProperties(List<InfConfigDO> configs) {
|
||||
Properties properties = propertiesFactory.getPropertiesInstance();
|
||||
configs.stream().filter(config -> 0 == config.getDeleted()) // 过滤掉被删除的配置
|
||||
configs.stream().filter(BaseDO::getDeleted) // 过滤掉被删除的配置
|
||||
.forEach(config -> properties.put(config.getKey(), config.getValue()));
|
||||
return properties;
|
||||
}
|
||||
|
@ -32,6 +32,6 @@ public class BaseDO implements Serializable {
|
||||
* 是否删除
|
||||
*/
|
||||
@TableLogic
|
||||
private Integer deleted;
|
||||
private Boolean deleted;
|
||||
|
||||
}
|
||||
|
@ -85,7 +85,7 @@ public class SysAuthServiceImpl implements SysAuthService {
|
||||
@Override
|
||||
public String login(SysAuthLoginReqVO reqVO, String userIp, String userAgent) {
|
||||
// 判断验证码是否正确
|
||||
// this.verifyCaptcha(reqVO.getUsername(), reqVO.getUuid(), reqVO.getCode());
|
||||
this.verifyCaptcha(reqVO.getUsername(), reqVO.getUuid(), reqVO.getCode());
|
||||
|
||||
// 使用账号密码,进行登陆。
|
||||
LoginUser loginUser = this.login0(reqVO.getUsername(), reqVO.getPassword());
|
||||
@ -99,11 +99,13 @@ public class SysAuthServiceImpl implements SysAuthService {
|
||||
String code = captchaService.getCaptchaCode(captchaUUID);
|
||||
// 验证码不存在
|
||||
if (code == null) {
|
||||
// 创建登陆失败日志(验证码不存在)
|
||||
this.createLoginLog(username, SysLoginResultEnum.CAPTCHA_NOT_FOUND);
|
||||
throw ServiceExceptionUtil.exception(AUTH_LOGIN_CAPTCHA_NOT_FOUND);
|
||||
}
|
||||
// 验证码不正确
|
||||
if (!code.equals(captchaCode)) {
|
||||
// 创建登陆失败日志(验证码不正确)
|
||||
this.createLoginLog(username, SysLoginResultEnum.CAPTCHA_CODE_ERROR);
|
||||
throw ServiceExceptionUtil.exception(AUTH_LOGIN_CAPTCHA_CODE_ERROR);
|
||||
}
|
||||
|
Reference in New Issue
Block a user