Browse Source

举报优化

fangqing 1 month ago
parent
commit
98b95bf0ac

+ 4 - 4
ruoyi-generator/src/main/java/com/ruoyi/generator/controller/CommunityReportController.java

@@ -132,7 +132,7 @@ public class CommunityReportController {
     @ApiOperation("管理员查看界面")
     @GetMapping("/adminReport")
     //@Anonymous
-    public AjaxResult adminReport(Long id,Long type,String name,String reason,String userId) {
+    public AjaxResult adminReport(String id,Long type,String name,String reason,String userId) {
         List<CommunityReportUserVo> communityReportUsers = null;
         int total = 0 ;
         try {
@@ -211,7 +211,7 @@ public class CommunityReportController {
             reportUser.setUpdateBy(SecurityUtils.getUserId());
             reportUser.setUpdateTime(DateUtils.parseDate(DateUtils.getTime()));
 
-            Long replyId = communityReportPunishVo.getReplyId();
+            String replyId = communityReportPunishVo.getReplyId();
             switch (disposalType) {
                 case "0": //不处理
                     break;
@@ -232,7 +232,7 @@ public class CommunityReportController {
                 case "4": //删除
                     if (replyId != null){
                         CommunityCommentReply communityCommentReply = new CommunityCommentReply();
-                        communityCommentReply.setId(communityReportPunishVo.getReplyId());
+                        communityCommentReply.setId(Long.valueOf(communityReportPunishVo.getReplyId()));
                         communityCommentReply.setDelete(true);
                         communityCommentReply.setUpdateBy(SecurityUtils.getUserId());
                         communityCommentReply.setUpdateTime(DateUtils.parseDate(DateUtils.getTime()));
@@ -240,7 +240,7 @@ public class CommunityReportController {
                         communityReportUserMapper.updateById(reportUser);
                     }else {
                         CommunityArticleComment communityArticleComment = new CommunityArticleComment();
-                        communityArticleComment.setId(communityReportPunishVo.getCommentId());
+                        communityArticleComment.setId(Long.valueOf(communityReportPunishVo.getCommentId()));
                         communityArticleComment.setDelete(true);
                         communityArticleComment.setUpdateBy(SecurityUtils.getUserId());
                         communityArticleComment.setUpdateTime(DateUtils.parseDate(DateUtils.getTime()));

+ 2 - 2
ruoyi-generator/src/main/java/com/ruoyi/generator/domain/Community/CommunityReportImages.java

@@ -30,14 +30,14 @@ public class CommunityReportImages implements Serializable {
     @ApiModelProperty("图片id")
     @TableId("id")
     @JsonSerialize(using = ToStringSerializer.class)
-    private Long id;
+    private String id;
 
     /**
      * 文章id
      */
     @ApiModelProperty("文章id")
     @JsonSerialize(using = ToStringSerializer.class)
-    private Long reportId;
+    private String reportId;
 
     /**
      * 图片地址

+ 4 - 4
ruoyi-generator/src/main/java/com/ruoyi/generator/domain/Community/CommunityReportUser.java

@@ -27,7 +27,7 @@ public class CommunityReportUser implements Serializable {
     @NotNull(message = "[id]不能为空")
     @ApiModelProperty("id")
     @TableId(value = "id", type = IdType.AUTO)
-    private Long id;
+    private String id;
 
 
     /**
@@ -133,19 +133,19 @@ public class CommunityReportUser implements Serializable {
      * 文章ID
      */
     @ApiModelProperty("文章ID")
-    private Long articleId;
+    private String articleId;
 
     /**
      * 评论ID
      */
     @ApiModelProperty("评论ID")
-    private Long commentId;
+    private String commentId;
 
     /**
      * 子评论ID
      */
     @ApiModelProperty("子评论ID")
-    private Long replyId;
+    private String replyId;
 
 
 

+ 1 - 1
ruoyi-generator/src/main/java/com/ruoyi/generator/mapper/community/CommunityReportUserMapper.java

@@ -21,7 +21,7 @@ public interface CommunityReportUserMapper extends BaseMapper<CommunityReportUse
     List<CommunityReportUserVo> selectCommunityReportUser          (@Param("offset") int offset,
                                                                       @Param("limit") int limit,
                                                                       @Param("searchType") int searchType,
-                                                                      @Param("id") Long  id,
+                                                                      @Param("id") String  id,
                                                                       @Param("type") Long  type,
                                                                       @Param("name") String  name,
                                                                       @Param("reason") String  reason,

+ 1 - 1
ruoyi-generator/src/main/java/com/ruoyi/generator/service/CommunityReportUserServiceImpl.java

@@ -62,7 +62,7 @@ public class CommunityReportUserServiceImpl extends ServiceImpl<CommunityReportU
         reportUser.setCreateTime(DateUtils.parseDate(DateUtils.getTime()));
         communityReportUserMapper.insert(reportUser);
 
-        Long id = reportUser.getId();
+        String id = reportUser.getId();
         System.out.println(id);
         //插入图片日志
         List<String> images = communityReportUser.getImages();

+ 4 - 4
ruoyi-generator/src/main/java/com/ruoyi/generator/vo/CommunityReportPunishVo.java

@@ -25,7 +25,7 @@ public class CommunityReportPunishVo {
     @ApiModelProperty("id")
     @TableId("id")
     @JsonSerialize(using = ToStringSerializer.class)
-    private Long id;
+    private String id;
 
     /**
      * 举报类型
@@ -76,17 +76,17 @@ public class CommunityReportPunishVo {
      * 文章ID
      */
     @ApiModelProperty("文章ID")
-    private Long articleId;
+    private String articleId;
 
     /**
      * 评论ID
      */
     @ApiModelProperty("评论ID")
-    private Long commentId;
+    private String commentId;
 
     /**
      * 子评论ID
      */
     @ApiModelProperty("子评论ID")
-    private Long replyId;
+    private String replyId;
 }