提交 f3129a98 作者: 沈振路

关键词回复接口

上级 4af437ae
......@@ -83,12 +83,19 @@ public class CustomerKeywordServiceImpl extends ServiceImpl<CustomerKeywordMappe
CustomerKeyword sourceEntity = null;
boolean isCreate = ObjectUtil.isNull(entity.getId());
// 判断该关键词是否存在
QueryWrapper<CustomerKeyword> query = new QueryWrapper<CustomerKeyword>().eq("appid", entity.getAppid()).eq("keyword", entity.getKeyword());
if (!isCreate) {
sourceEntity = this.getById(entity.getId());
if (ObjectUtil.isNull(sourceEntity)) {
return new GenericsResult<>(false, "");
}
query = query.ne("id", entity.getId());
}
if (this.count(query) != 0) {
return new GenericsResult<>(false, "该关键词已配置");
}
if (isCreate) {
// 新增的id
entity.setId(snowflakeComponent.snowflakeId());
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论