feat: merge remote
This commit is contained in:
commit
535c5826d3
@ -260,16 +260,16 @@ public class AgentServiceImpl
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
protected boolean beforeUpdate(final AgentUpdateServReq form, final Agent model, AgentBO bo) {
|
||||
super.beforeUpdate(form, model, bo);
|
||||
protected boolean beforeUpdate(final AgentUpdateServReq req, final Agent agent, final AgentBO agentBO) {
|
||||
super.beforeUpdate(req, agent, agentBO);
|
||||
|
||||
if (Boolean.TRUE.equals(form.getUpdatePassword()) ||
|
||||
StringUtils.isBlank(model.getPassword())) {
|
||||
log.info("Generate agent [{}] new password.", model.getAccount());
|
||||
model.setPassword(RandomStringUtils.randomAlphanumeric(passwordLength));
|
||||
if (Boolean.TRUE.equals(req.getUpdatePassword()) ||
|
||||
StringUtils.isBlank(agent.getPassword())) {
|
||||
log.info("Generate agent [{}] new password.", agent.getAccount());
|
||||
agentBO.setPassword(RandomStringUtils.randomAlphanumeric(passwordLength));
|
||||
}
|
||||
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -298,20 +298,22 @@ public class AuthUserServiceImpl
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
protected boolean beforeUpdate(final AuthUserUpdateServReq form, final AuthUser model, AuthUserBO bo) {
|
||||
super.beforeUpdate(form, model, bo);
|
||||
val password = form.getPassword();
|
||||
protected boolean beforeUpdate(final AuthUserUpdateServReq req,
|
||||
final AuthUser authUser,
|
||||
final AuthUserBO authUserBO) {
|
||||
|
||||
super.beforeUpdate(req, authUser, authUserBO);
|
||||
val password = req.getPassword();
|
||||
|
||||
if (StringUtils.isNotBlank(password)) {
|
||||
val length = password.length();
|
||||
Assert.state(length >= 6 && length <= 32, "密码长度不合规");
|
||||
model.setPassword(DigestUtils.md5Hex(password));
|
||||
authUser.setPassword(DigestUtils.md5Hex(password));
|
||||
}
|
||||
else {
|
||||
model.setPassword(null);
|
||||
authUser.setPassword(null);
|
||||
}
|
||||
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -3,11 +3,11 @@ package com.pudonghot.yo.cms.service.callinglist.impl;
|
||||
import lombok.val;
|
||||
import java.util.*;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import me.chyxion.tigon.dal.hook.AuthHook;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.stereotype.Service;
|
||||
import me.chyxion.tigon.kit.sequence.IdSequence;
|
||||
import com.pudonghot.yo.dal.campaign.CampaignDal;
|
||||
import me.chyxion.tigon.dal.hook.AuthHook;
|
||||
import me.chyxion.tigon.service.request.FindServReq;
|
||||
import me.chyxion.tigon.service.request.ListServReq;
|
||||
import me.chyxion.tigon.service.impl.TigonServiceImpl;
|
||||
|
@ -84,16 +84,17 @@ public class SoundServiceImpl
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
protected boolean beforeUpdate(final SoundUpdateServReq form, final Sound model, SoundBO bo) {
|
||||
super.beforeUpdate(form, model, bo);
|
||||
protected boolean beforeUpdate(final SoundUpdateServReq req, final Sound sound, final SoundBO soundBO) {
|
||||
super.beforeUpdate(req, sound, soundBO);
|
||||
|
||||
val file = form.getFile();
|
||||
val file = req.getFile();
|
||||
|
||||
if (file != null && !file.isEmpty()) {
|
||||
delete(beanService.convert(model, servModelType));
|
||||
saveFile(file, model);
|
||||
delete(beanService.convert(sound, servModelType));
|
||||
saveFile(file, sound);
|
||||
}
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -39,11 +39,12 @@ public class TagServiceImpl
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
protected boolean beforeUpdate(final TagUpdateServReq form, final Tag model, final TagBO tagBO) {
|
||||
super.beforeUpdate(form, model, tagBO);
|
||||
model.setOwner(form.getScope() == TagScopeEnum.USER ?
|
||||
form.getUpdatedBy() : Tag.OWNER_COMMON);
|
||||
protected boolean beforeUpdate(TagUpdateServReq req, Tag tag, TagBO tagBO) {
|
||||
super.beforeUpdate(req, tag, tagBO);
|
||||
|
||||
return true;
|
||||
tag.setOwner(req.getScope() == TagScopeEnum.USER ?
|
||||
req.getUpdatedBy() : Tag.OWNER_COMMON);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -38,16 +38,16 @@ public class TenantServiceImpl
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
protected boolean beforeUpdate(final TenantUpdateServReq form, final Tenant model, TenantBO bo) {
|
||||
super.beforeUpdate(form, model, bo);
|
||||
protected boolean beforeUpdate(final TenantUpdateServReq req, final Tenant model, final TenantBO tenantBO) {
|
||||
super.beforeUpdate(req, model, tenantBO);
|
||||
|
||||
if (Boolean.TRUE.equals(form.getRenewAccessSecret())) {
|
||||
if (Boolean.TRUE.equals(req.getRenewAccessSecret())) {
|
||||
log.info("Renew tenant [{}] access secret.", model);
|
||||
model.setAccessSecret(
|
||||
RandomStringUtils.randomAlphanumeric(accessSecretLength));
|
||||
RandomStringUtils.randomAlphanumeric(accessSecretLength));
|
||||
}
|
||||
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -38,16 +38,19 @@ public class TenantServiceImpl
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
protected boolean beforeUpdate(final TenantUpdateServReq req, final Tenant model, TenantServResp bo) {
|
||||
super.beforeUpdate(req, model, bo);
|
||||
protected boolean beforeUpdate(final TenantUpdateServReq req,
|
||||
final Tenant tenant,
|
||||
final TenantServResp tenantServResp) {
|
||||
|
||||
super.beforeUpdate(req, tenant, tenantServResp);
|
||||
|
||||
if (Boolean.TRUE.equals(req.getRenewAccessSecret())) {
|
||||
log.info("Renew tenant [{}] access secret.", model);
|
||||
model.setAccessSecret(
|
||||
log.info("Renew tenant [{}] access secret.", tenant);
|
||||
tenant.setAccessSecret(
|
||||
RandomStringUtils.randomAlphanumeric(accessSecretLength));
|
||||
}
|
||||
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1,6 +1,5 @@
|
||||
package com.pudonghot.yo.tj.cms;
|
||||
|
||||
import com.pudonghot.yo.tj.cms.auth.interceptor.ManagerInterceptor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.core.Ordered;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
@ -8,6 +7,7 @@ import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.ImportResource;
|
||||
import com.pudonghot.yo.tj.cms.auth.interceptor.ManagerInterceptor;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
||||
|
@ -13,7 +13,7 @@ public class SiteMediatorListReqVO extends ListCtrlrReq {
|
||||
public SiteMediatorListReqVO() {
|
||||
val filter = new Filter();
|
||||
filter.setField("active");
|
||||
filter.setValue(Arrays.asList(Boolean.TRUE.toString()));
|
||||
filter.setValue(Arrays.asList(String.valueOf(Boolean.TRUE)));
|
||||
setFilters(Arrays.asList(filter));
|
||||
}
|
||||
}
|
||||
|
@ -117,15 +117,16 @@ public class AgentServiceImpl
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
protected boolean beforeUpdate(final AgentUpdateServReq form, final Agent model, AgentBO bo) {
|
||||
super.beforeUpdate(form, model, bo);
|
||||
protected boolean beforeUpdate(final AgentUpdateServReq req, final Agent agent, final AgentBO agentBO) {
|
||||
super.beforeUpdate(req, agent, agentBO);
|
||||
|
||||
if (Boolean.TRUE.equals(form.getUpdatePassword()) ||
|
||||
StringUtils.isBlank(model.getPassword())) {
|
||||
log.info("Generate agent [{}] new password.", model.getAccount());
|
||||
model.setPassword(RandomStringUtils.randomAlphanumeric(passwordLength));
|
||||
if (Boolean.TRUE.equals(req.getUpdatePassword()) ||
|
||||
StringUtils.isBlank(agent.getPassword())) {
|
||||
log.info("Generate agent [{}] new password.", agent.getAccount());
|
||||
agent.setPassword(RandomStringUtils.randomAlphanumeric(passwordLength));
|
||||
}
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -301,9 +301,10 @@ public class AuthUserServiceImpl
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
protected boolean beforeUpdate(final AuthUserUpdateServReq form, final AuthUser model, AuthUserBO bo) {
|
||||
super.beforeUpdate(form, model, bo);
|
||||
val password = form.getPassword();
|
||||
protected boolean beforeUpdate(final AuthUserUpdateServReq req, final AuthUser model, final AuthUserBO authUserBO) {
|
||||
super.beforeUpdate(req, model, authUserBO);
|
||||
|
||||
val password = req.getPassword();
|
||||
|
||||
if (StringUtils.isNotBlank(password)) {
|
||||
val length = password.length();
|
||||
@ -314,6 +315,6 @@ public class AuthUserServiceImpl
|
||||
model.setPassword(null);
|
||||
}
|
||||
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user