Merge branch 'hotfix/20240726-reportOpt' into 'master'
Hotfix/20240726 report opt See merge request universal/infrastructure/backend/tyr!91
This commit is contained in:
commit
a355be301b
@ -26,6 +26,18 @@ public class PageElementReportReq {
|
||||
@NotBlank(message = "端信息不能为空")
|
||||
private String terminal;
|
||||
|
||||
/**
|
||||
* 上报秘钥
|
||||
*/
|
||||
@NotBlank(message = "上报秘钥不能为空")
|
||||
private String secretKey;
|
||||
|
||||
/**
|
||||
* 创建人名
|
||||
*/
|
||||
@NotBlank(message = "创建人名不能为空")
|
||||
private String createName;
|
||||
|
||||
/**
|
||||
* 页面元素列表
|
||||
*/
|
||||
|
||||
@ -55,4 +55,10 @@ public class SaasPageElement extends BaseEntity<SaasPageElement> {
|
||||
*/
|
||||
@TableField("terminal")
|
||||
private String terminal;
|
||||
|
||||
/**
|
||||
* 创建人名
|
||||
*/
|
||||
@TableField("create_name")
|
||||
private String createName;
|
||||
}
|
||||
|
||||
@ -5,6 +5,7 @@ import cn.axzo.basics.common.util.AssertUtil;
|
||||
import cn.axzo.basics.common.util.StopWatchUtil;
|
||||
import cn.axzo.basics.profiles.api.UserProfileServiceApi;
|
||||
import cn.axzo.basics.profiles.dto.basic.PersonProfileDto;
|
||||
import cn.axzo.foundation.exception.BusinessException;
|
||||
import cn.axzo.framework.domain.page.PageResp;
|
||||
import cn.axzo.pokonyan.config.mybatisplus.BaseEntity;
|
||||
import cn.axzo.tyr.client.common.enums.FeatureResourceType;
|
||||
@ -17,7 +18,6 @@ import cn.axzo.tyr.client.model.res.IdentityAuthRes;
|
||||
import cn.axzo.tyr.client.model.res.PageElementBasicDTO;
|
||||
import cn.axzo.tyr.client.model.res.PageElementResp;
|
||||
import cn.axzo.tyr.server.model.RelationOperateLogResourceBindElementDO;
|
||||
import cn.axzo.tyr.server.model.RelationOperateLogResourceBindRoleDO;
|
||||
import cn.axzo.tyr.server.repository.dao.SaasFeatureResourceDao;
|
||||
import cn.axzo.tyr.server.repository.dao.SaasPageElementDao;
|
||||
import cn.axzo.tyr.server.repository.dao.SaasPageElementFeatureResourceRelationDao;
|
||||
@ -74,12 +74,18 @@ public class SaasPageElementServiceImpl implements SaasPageElementService {
|
||||
private ExecutorService asyncExecutor;
|
||||
@Value("${not.auth.featureCodes:}")
|
||||
private Set<String> notAuthFeatureCodes;
|
||||
@Value("#{'${pageElement.report.secretKeys:1qaz@WSX}'.split(',')}")
|
||||
private List<String> reportSecretKeys;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void report(PageElementReportReq request) {
|
||||
StopWatchUtil watch = StopWatchUtil.createStarted("saasPageElement-report");
|
||||
watch.start("report");
|
||||
// AssertUtil.isTrue(reportSecretKeys.contains(request.getSecretKey()), "上报秘钥有误。");
|
||||
if (!reportSecretKeys.contains(request.getSecretKey())) {
|
||||
throw new BusinessException("403", "上报秘钥有误。");
|
||||
}
|
||||
// 根据端删除所有的元素
|
||||
saasPageElementDao.deleteAllByTerminal(request.getTerminal());
|
||||
|
||||
@ -273,6 +279,7 @@ public class SaasPageElementServiceImpl implements SaasPageElementService {
|
||||
.type(pageElement.getType())
|
||||
.name(pageElement.getName())
|
||||
.linkUrl(pageElement.getLinkUrl())
|
||||
.createName(request.getCreateName())
|
||||
.build());
|
||||
|
||||
if (CollectionUtils.isNotEmpty(pageElement.getChildren())) {
|
||||
@ -282,6 +289,7 @@ public class SaasPageElementServiceImpl implements SaasPageElementService {
|
||||
.code(e.getCode())
|
||||
.type(e.getType())
|
||||
.name(e.getName())
|
||||
.createName(request.getCreateName())
|
||||
.build()).collect(Collectors.toList()));
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user