Browse Source

修改 参数

DESKTOP-USV654P\pc 1 year ago
parent
commit
7d0cac596d

+ 2 - 2
src/main/java/com/xjrsoft/module/oa/controller/NewsController.java

@@ -199,7 +199,7 @@ public class NewsController {
 
     @PutMapping("/reply")
     @ApiOperation(value = "新闻回复")
-    public R reply(@RequestParam("id") String id, @RequestParam("replyContent") String replyContent) throws Exception {
+    public R reply(@RequestBody String id, @RequestBody String replyContent) throws Exception {
         NewsRelation newsRelation = newsRelationService.getOne(
                 Wrappers.<NewsRelation>query().lambda()
                         .eq(NewsRelation::getNewsId,id)
@@ -208,7 +208,7 @@ public class NewsController {
             throw new Exception("参数异常");
         }
 
-        if (newsRelation.getReadMark() == 0) {
+        if (newsRelation.getReadMark()==null || newsRelation.getReadMark() == 0) {
             newsRelation.setReadMark(1);
             newsRelation.setReadDate(LocalDateTime.now());
         }