Kaynağa Gözat

举报管理添加注释

zjy 1 ay önce
ebeveyn
işleme
1133647dd1

+ 18 - 1
alien-entity/src/main/java/shop/alien/mapper/second/SecondUserViolationMapper.java

@@ -8,13 +8,30 @@ import shop.alien.entity.second.vo.SecondUserViolationVo;
 
 
 /**
- * 二手交易举报
+ * 二手交易举报Mapper接口
+ * 提供举报信息的数据库操作方法
  */
 public interface SecondUserViolationMapper extends BaseMapper<SecondUserViolationVo> {
 
+    /**
+     * 分页查询用户举报信息
+     *
+     * @param page 分页参数
+     * @param reportingUserName 举报人姓名
+     * @param reportingDate 举报日期
+     * @param processingStatus 处理状态
+     * @param reportContextType 举报内容类型
+     * @return 分页的用户举报信息列表
+     */
     IPage<SecondUserViolationVo> getUserViolationByPage(IPage<SecondUserViolationVo> page, @Param("reportingUserName") String reportingUserName,
                                                         @Param("reportingDate") String reportingDate, @Param("processingStatus") String processingStatus,
                                                         @Param("reportContextType") String reportContextType);
 
+    /**
+     * 根据ID获取用户举报详情信息
+     *
+     * @param id 举报记录ID
+     * @return 用户举报详情信息
+     */
     SecondUserViolationDetailVo getUserViolationInfo(@Param("id") Integer id);
 }

+ 25 - 2
alien-second/src/main/java/shop/alien/second/platform/PlatformUserViolationController.java

@@ -15,8 +15,10 @@ import shop.alien.entity.store.LifeUserViolation;
 import shop.alien.second.service.PlatformUserViolationService;
 
 /**
- * 作者:邹建宇
- * 描述:
+ * 平台二手举报管理控制器
+ * 提供举报信息查询、举报详情查看、举报审核等接口
+ * 
+ * @author 邹建宇
  */
 @Slf4j
 @Api(tags = {"平台-二手举报管理"})
@@ -29,6 +31,13 @@ public class PlatformUserViolationController {
 
     private final PlatformUserViolationService service;
 
+    /**
+     * 分页查询举报信息
+     *
+     * @param vo 查询条件,包含页码、页面大小、举报人姓名、举报日期、处理状态、举报内容类型等
+     * @return 分页的举报信息列表
+     * @throws Exception 查询过程中可能发生的异常
+     */
     @ApiOperation("查询举报信息")
     @PostMapping("/queryUserViolationByPage")
     public R<IPage<SecondUserViolationVo>> queryUserViolationByPage(@RequestBody SecondUserViolationVo vo) throws Exception {
@@ -38,6 +47,13 @@ public class PlatformUserViolationController {
     }
 
 
+    /**
+     * 查询举报详情
+     *
+     * @param id 举报记录ID
+     * @return 举报详情信息
+     * @throws Exception 查询过程中可能发生的异常
+     */
     @ApiOperation("查询举报详情")
     @GetMapping("/queryUserViolationDetail")
     public R<SecondUserViolationDetailVo> queryUserViolationDetail(Integer id) throws Exception {
@@ -45,6 +61,13 @@ public class PlatformUserViolationController {
         return R.data(service.getUserViolationDetail(id), "查询成功");
     }
 
+    /**
+     * 举报审核
+     *
+     * @param row 包含审核信息的举报记录对象
+     * @return 审核结果,成功返回"审核成功",失败返回"审核失败"
+     * @throws Exception 审核过程中可能发生的异常
+     */
     @ApiOperation("举报审核")
     @PostMapping("/updateUserViolation")
     public R<String> updateUserViolation(@RequestBody LifeUserViolation row) throws Exception {

+ 30 - 1
alien-second/src/main/java/shop/alien/second/service/PlatformUserViolationService.java

@@ -6,11 +6,40 @@ import shop.alien.entity.second.vo.SecondUserViolationDetailVo;
 import shop.alien.entity.second.vo.SecondUserViolationVo;
 import shop.alien.entity.store.LifeUserViolation;
 
+/**
+ * 平台用户举报服务接口
+ * 提供举报信息查询、举报详情查看、举报审核等核心业务功能
+ */
 public interface PlatformUserViolationService extends IService<SecondUserViolationVo> {
 
+    /**
+     * 分页获取用户举报信息
+     *
+     * @param page 分页参数
+     * @param reportingUserName 举报人姓名
+     * @param reportingDate 举报日期
+     * @param processingStatus 处理状态
+     * @param reportContextType 举报内容类型
+     * @return 分页的用户举报信息列表
+     * @throws Exception 查询过程中可能发生的异常
+     */
     IPage<SecondUserViolationVo> getUserViolationByPage(IPage<SecondUserViolationVo> page, String reportingUserName, String reportingDate, String processingStatus, String reportContextType) throws Exception;
 
+    /**
+     * 获取用户举报详情
+     *
+     * @param id 举报记录ID
+     * @return 用户举报详情信息
+     * @throws Exception 查询过程中可能发生的异常
+     */
     SecondUserViolationDetailVo getUserViolationDetail(Integer id) throws Exception;
 
+    /**
+     * 更新用户举报信息(审核操作)
+     *
+     * @param row 包含审核信息的举报记录对象
+     * @return 更新记录数,大于0表示更新成功
+     * @throws Exception 更新过程中可能发生的异常
+     */
     int updateUserViolation(LifeUserViolation row) throws Exception;
-}
+}

+ 41 - 1
alien-second/src/main/java/shop/alien/second/service/impl/PlatformUserViolationServiceImpl.java

@@ -23,10 +23,17 @@ import shop.alien.util.common.Constants;
 
 import java.util.*;
 
+/**
+ * 平台用户举报服务实现类
+ * 实现用户举报信息的查询、详情获取和审核处理等核心业务逻辑
+ */
 @Slf4j
 @Service
 public class PlatformUserViolationServiceImpl extends ServiceImpl<SecondUserViolationMapper, SecondUserViolationVo> implements PlatformUserViolationService {
 
+    /**
+     * 视频文件类型列表
+     */
     List<String> videoFileType = Arrays.asList("mp4", "avi", "flv", "mkv", "rmvb", "wmv", "3gp", "mov");
 
     @Autowired
@@ -46,6 +53,17 @@ public class PlatformUserViolationServiceImpl extends ServiceImpl<SecondUserViol
     private SecondGoodsService secondGoodsService;
 
 
+    /**
+     * 分页获取用户举报信息
+     *
+     * @param page 分页参数
+     * @param reportingUserName 举报人姓名
+     * @param reportingDate 举报日期
+     * @param processingStatus 处理状态
+     * @param reportContextType 举报内容类型
+     * @return 分页的用户举报信息列表
+     * @throws Exception 查询过程中可能发生的异常
+     */
     @Override
     public IPage<SecondUserViolationVo> getUserViolationByPage(IPage<SecondUserViolationVo> page, String reportingUserName,
                                                                String reportingDate, String processingStatus, String reportContextType) throws Exception {
@@ -57,6 +75,14 @@ public class PlatformUserViolationServiceImpl extends ServiceImpl<SecondUserViol
         }
     }
 
+    /**
+     * 获取用户举报详情
+     * 包括举报基本信息、相关商品信息(如果举报类型为商品)以及相关图片/视频信息
+     *
+     * @param id 举报记录ID
+     * @return 用户举报详情信息
+     * @throws Exception 查询过程中可能发生的异常
+     */
     @Override
     public SecondUserViolationDetailVo getUserViolationDetail(Integer id) throws Exception {
         try {
@@ -97,6 +123,14 @@ public class PlatformUserViolationServiceImpl extends ServiceImpl<SecondUserViol
         }
     }
 
+    /**
+     * 更新用户举报信息(审核操作)
+     * 更新举报记录的处理状态、处理时间和举报结果
+     *
+     * @param row 包含审核信息的举报记录对象
+     * @return 更新记录数,大于0表示更新成功
+     * @throws Exception 更新过程中可能发生的异常
+     */
     @Override
     public int updateUserViolation(LifeUserViolation row) throws Exception {
         LambdaUpdateWrapper<LifeUserViolation> updateWrapper = new LambdaUpdateWrapper<>();
@@ -108,6 +142,12 @@ public class PlatformUserViolationServiceImpl extends ServiceImpl<SecondUserViol
         return lifeUserViolationMapper.update(null, updateWrapper);
     }
 
+    /**
+     * 判断URL是否为视频文件
+     *
+     * @param url 文件URL
+     * @return 如果是视频文件返回true,否则返回false
+     */
     private static boolean isVideoUrl(String url) {
         if (url == null) return false;
         url = url.toLowerCase();
@@ -119,4 +159,4 @@ public class PlatformUserViolationServiceImpl extends ServiceImpl<SecondUserViol
                 url.endsWith(".mkv");
     }
 
-}
+}