|
@@ -64,6 +64,11 @@ public class TagInfoController {
|
|
public Result<TagInfo> add(@RequestBody TagInfo tagInfo) {
|
|
public Result<TagInfo> add(@RequestBody TagInfo tagInfo) {
|
|
Result<TagInfo> result = new Result<>();
|
|
Result<TagInfo> result = new Result<>();
|
|
try {
|
|
try {
|
|
|
|
+ TagInfo getTag = tagInfoService.getByTagCode(tagInfo.getTagCode());
|
|
|
|
+ if(null!=getTag){
|
|
|
|
+ result.error500("标签编码已存在");
|
|
|
|
+ return result;
|
|
|
|
+ }
|
|
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
tagInfo.setDelFlag(0);
|
|
tagInfo.setDelFlag(0);
|
|
if(null == tagInfo.getStatus()){
|
|
if(null == tagInfo.getStatus()){
|
|
@@ -79,8 +84,8 @@ public class TagInfoController {
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|
|
String tagCode = parentTag.getTagCode()+tagInfo.getTagCode();
|
|
String tagCode = parentTag.getTagCode()+tagInfo.getTagCode();
|
|
- TagInfo getTag = tagInfoService.getByTagCode(tagCode);
|
|
|
|
- if(null!=getTag){
|
|
|
|
|
|
+ TagInfo getTag2 = tagInfoService.getByTagCode(tagCode);
|
|
|
|
+ if(null!=getTag2){
|
|
result.error500("标签编码已存在");
|
|
result.error500("标签编码已存在");
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|