|
|
|
@ -189,7 +189,12 @@ public class SysContentController { |
|
|
|
|
@PostMapping("/checkIfTheTitleIsRepeat") |
|
|
|
|
@Decrypt |
|
|
|
|
@ApiOperation(value = "标题判重——只对已发布的判重(新增,编辑,点击发布时候都要调用判断))", response = ContentHeavyTitleReqVO.class) |
|
|
|
|
public R checkIfTheTitleIsRepeat(@RequestBody @Valid ContentHeavyTitleReqVO content) { |
|
|
|
|
public R checkIfTheTitleIsRepeat(@RequestBody @Valid ContentHeavyTitleReqVO content) throws UnsupportedEncodingException { |
|
|
|
|
if (!org.springframework.util.StringUtils.isEmpty(content.getTitle())) { |
|
|
|
|
//中文转码
|
|
|
|
|
String name = URLDecoder.decode(content.getTitle(), StandardCharsets.UTF_8.toString()); |
|
|
|
|
content.setTitle(name); |
|
|
|
|
} |
|
|
|
|
return service.checkIfTheTitleIsRepeat(content) ? R.success() : R.fail("该标题已重复!"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -202,6 +207,18 @@ public class SysContentController { |
|
|
|
|
String title = URLDecoder.decode(content.getTitle(), StandardCharsets.UTF_8.toString()); |
|
|
|
|
content.setTitle(title); |
|
|
|
|
} |
|
|
|
|
if (!StringUtils.isEmpty(content.getPatentQueryKeyWord())) { |
|
|
|
|
String title = URLDecoder.decode(content.getPatentQueryKeyWord(), StandardCharsets.UTF_8.toString()); |
|
|
|
|
content.setPatentQueryKeyWord(title); |
|
|
|
|
} |
|
|
|
|
if (!StringUtils.isEmpty(content.getMonographQueryKeyWord())) { |
|
|
|
|
String title = URLDecoder.decode(content.getMonographQueryKeyWord(), StandardCharsets.UTF_8.toString()); |
|
|
|
|
content.setMonographQueryKeyWord(title); |
|
|
|
|
} |
|
|
|
|
if (!StringUtils.isEmpty(content.getPaperQueryKeyWord())) { |
|
|
|
|
String title = URLDecoder.decode(content.getPaperQueryKeyWord(), StandardCharsets.UTF_8.toString()); |
|
|
|
|
content.setPaperQueryKeyWord(title); |
|
|
|
|
} |
|
|
|
|
return service.newlyPublishedArticles(content); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|