|
@@ -10,10 +10,12 @@ import com.ruoyi.common.utils.SecurityUtils;
|
|
import com.ruoyi.common.utils.ServletUtils;
|
|
import com.ruoyi.common.utils.ServletUtils;
|
|
import com.ruoyi.generator.domain.Community.*;
|
|
import com.ruoyi.generator.domain.Community.*;
|
|
import com.ruoyi.generator.mapper.community.CommunityReportDataMapper;
|
|
import com.ruoyi.generator.mapper.community.CommunityReportDataMapper;
|
|
|
|
+import com.ruoyi.generator.mapper.community.CommunityReportUserMapper;
|
|
import com.ruoyi.generator.service.ICommunityNotificationService;
|
|
import com.ruoyi.generator.service.ICommunityNotificationService;
|
|
import com.ruoyi.generator.service.ICommunityPrivacyService;
|
|
import com.ruoyi.generator.service.ICommunityPrivacyService;
|
|
import com.ruoyi.generator.service.ICommunityReportDataService;
|
|
import com.ruoyi.generator.service.ICommunityReportDataService;
|
|
import com.ruoyi.generator.service.ICommunityReportUserService;
|
|
import com.ruoyi.generator.service.ICommunityReportUserService;
|
|
|
|
+import com.ruoyi.generator.vo.CommunityReportUserVo;
|
|
import com.ruoyi.generator.vo.CommunityUserNotificationVo;
|
|
import com.ruoyi.generator.vo.CommunityUserNotificationVo;
|
|
import com.ruoyi.generator.vo.CommunityUserPrivacyVo;
|
|
import com.ruoyi.generator.vo.CommunityUserPrivacyVo;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
@@ -22,6 +24,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
+import java.util.Map;
|
|
import java.util.Objects;
|
|
import java.util.Objects;
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -41,6 +44,9 @@ public class CommunityReportController {
|
|
@Autowired
|
|
@Autowired
|
|
private ICommunityReportUserService communityReportUserService;
|
|
private ICommunityReportUserService communityReportUserService;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private CommunityReportUserMapper communityReportUserMapper;
|
|
|
|
+
|
|
|
|
|
|
/**
|
|
/**
|
|
* 获取举报类型信息
|
|
* 获取举报类型信息
|
|
@@ -64,7 +70,6 @@ public class CommunityReportController {
|
|
.and((wrapper) -> {
|
|
.and((wrapper) -> {
|
|
wrapper.ne("is_delete", true).or().isNull("is_delete");
|
|
wrapper.ne("is_delete", true).or().isNull("is_delete");
|
|
});
|
|
});
|
|
-
|
|
|
|
communityReportData = communityReportDataMapper.selectPage(page, queryWrapper).getRecords();
|
|
communityReportData = communityReportDataMapper.selectPage(page, queryWrapper).getRecords();
|
|
|
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
@@ -77,26 +82,71 @@ public class CommunityReportController {
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
- * 举报
|
|
|
|
|
|
+ * 用户举报
|
|
* @param
|
|
* @param
|
|
- * @return 举报
|
|
|
|
|
|
+ * @return 用户举报
|
|
*/
|
|
*/
|
|
- @ApiOperation("举报")
|
|
|
|
|
|
+ @ApiOperation("用户举报")
|
|
@GetMapping("/reportTypes")
|
|
@GetMapping("/reportTypes")
|
|
//@Anonymous
|
|
//@Anonymous
|
|
public AjaxResult reportMessage(@RequestBody CommunityReportUser communityReportUser) {
|
|
public AjaxResult reportMessage(@RequestBody CommunityReportUser communityReportUser) {
|
|
if (Objects.isNull(communityReportUser.getUserId())) {
|
|
if (Objects.isNull(communityReportUser.getUserId())) {
|
|
return AjaxResult.error("请传被举报人ID!");
|
|
return AjaxResult.error("请传被举报人ID!");
|
|
}
|
|
}
|
|
- CommunityReportUser reportUser = null;
|
|
|
|
try {
|
|
try {
|
|
- reportUser = communityReportUserService.insertCommunityReportUser(communityReportUser);
|
|
|
|
|
|
+ communityReportUserService.insertCommunityReportUser(communityReportUser);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
System.out.println(e.getMessage());
|
|
System.out.println(e.getMessage());
|
|
throw new ProjectException();
|
|
throw new ProjectException();
|
|
}
|
|
}
|
|
-
|
|
|
|
return AjaxResult.success("举报成功");
|
|
return AjaxResult.success("举报成功");
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 管理员查看界面
|
|
|
|
+ * @param
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @ApiOperation("管理员查看界面")
|
|
|
|
+ @GetMapping("/adminReport")
|
|
|
|
+ //@Anonymous
|
|
|
|
+ public AjaxResult adminReport() {
|
|
|
|
+ List<CommunityReportUserVo> communityReportUsers = null;
|
|
|
|
+ try {
|
|
|
|
+ int pageNum = Convert.toInt(ServletUtils.getParameter("pageNum"), 1);
|
|
|
|
+ int pageSize = Convert.toInt(ServletUtils.getParameter("pageSize"), 10);
|
|
|
|
+ int offset = (pageNum - 1) * pageSize;
|
|
|
|
+ int searchType = Convert.toInt(ServletUtils.getParameter("searchType"), 0);
|
|
|
|
+ communityReportUsers = communityReportUserMapper.selectCommunityReportUser(offset, pageSize, searchType);
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ System.out.println(e.getMessage());
|
|
|
|
+ throw new ProjectException();
|
|
|
|
+ }
|
|
|
|
+ return AjaxResult.success(communityReportUsers);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 管理员查看界面
|
|
|
|
+ * @param
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @ApiOperation("管理员处罚界面")
|
|
|
|
+ @GetMapping("/adminReportPunish")
|
|
|
|
+ //@Anonymous
|
|
|
|
+ public AjaxResult adminReportPunish() {
|
|
|
|
+ List<CommunityReportUserVo> communityReportUsers = null;
|
|
|
|
+ try {
|
|
|
|
+ int pageNum = Convert.toInt(ServletUtils.getParameter("pageNum"), 1);
|
|
|
|
+ int pageSize = Convert.toInt(ServletUtils.getParameter("pageSize"), 10);
|
|
|
|
+ int offset = (pageNum - 1) * pageSize;
|
|
|
|
+ int searchType = Convert.toInt(ServletUtils.getParameter("searchType"), 0);
|
|
|
|
+ communityReportUsers = communityReportUserMapper.selectCommunityReportUser(offset, pageSize, searchType);
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ System.out.println(e.getMessage());
|
|
|
|
+ throw new ProjectException();
|
|
|
|
+ }
|
|
|
|
+ return AjaxResult.success(communityReportUsers);
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|