use of com.easy.cloud.core.basic.pojo.dto.EcBaseServiceResult in project dq-easy-cloud by dq-open-cloud.
the class UserServiceImpl method login.
@Override
public EcBaseServiceResult login(UserComposeQuery userComposeQuery) {
if (EcBaseUtils.isNull(userComposeQuery)) {
throw EcBaseBusinessException.newInstance(EcBaseErrorCodeEnum.QUERY_OBJ_CANT_NULL);
}
if (EcStringUtils.isEmpty(userComposeQuery.getPassword())) {
throw EcBaseBusinessException.newInstance(UserErrorCodeEnum.USER_PASSWOR_CANT_EMPTY);
}
Integer loginMode = userComposeQuery.getLoginMode();
if (LoginMode.isNotAvailableValue(LoginMode.class, loginMode)) {
throw EcBaseBusinessException.newInstance(UserComposeErrorCodeEnum.LOGIN_MODE_WRONG);
}
if (LoginMode.isLoginByEmailAndPassword(loginMode)) {
if (EcStringUtils.isEmpty(userComposeQuery.getEmail())) {
throw EcBaseBusinessException.newInstance(UserErrorCodeEnum.USER_EMAIL_CANT_EMPTY);
}
} else if (LoginMode.isLoginByUsernameAndPassword(loginMode)) {
if (EcStringUtils.isEmpty(userComposeQuery.getUserName())) {
throw EcBaseBusinessException.newInstance(UserErrorCodeEnum.USER_NAME_CANT_EMPTY);
}
}
EcBaseServiceResult dqBaseServiceResult = EcBaseServiceResult.newInstanceOfSuccess();
if (LoginMode.isLoginByEmailAndPassword(loginMode)) {
dqBaseServiceResult = userClient.loginByEmailAndPassword(userComposeQuery);
} else if (LoginMode.isLoginByUsernameAndPassword(loginMode)) {
dqBaseServiceResult = userClient.loginByUserNameAndPassword(userComposeQuery);
}
return dqBaseServiceResult;
}
use of com.easy.cloud.core.basic.pojo.dto.EcBaseServiceResult in project dq-easy-cloud by dq-open-cloud.
the class SysFilterConfigLogic method saveSysFilterConfig.
@Transactional(rollbackFor = Exception.class)
public EcBaseServiceResult saveSysFilterConfig(SysFilterConfigDTO sysFilterConfigDTO) {
EcBaseServiceResult serviceResult = sysFilterConfigService.saveSysFilterConfig(sysFilterConfigDTO);
authorityManager.updateFilterChains(sysFilterConfigService.loadFilterChainDefinitions());
return serviceResult;
}
Aggregations