|
|
@@ -34,13 +34,17 @@ import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
- * 二手商品服务实现类
|
|
|
+ * 二手商品举报服务实现类
|
|
|
+ * 实现举报详情查询和商品举报等核心业务逻辑
|
|
|
*/
|
|
|
@Slf4j
|
|
|
@Service
|
|
|
@RequiredArgsConstructor
|
|
|
public class SecondGoodsReportingServiceImpl implements SecondGoodsReportingService {
|
|
|
|
|
|
+ /**
|
|
|
+ * 视频文件类型列表
|
|
|
+ */
|
|
|
List<String> videoFileType = Arrays.asList("mp4", "avi", "flv", "mkv", "rmvb", "wmv", "3gp", "mov");
|
|
|
|
|
|
@Autowired
|
|
|
@@ -63,6 +67,13 @@ public class SecondGoodsReportingServiceImpl implements SecondGoodsReportingServ
|
|
|
@Autowired
|
|
|
private final StoreImgMapper storeImgMapper;
|
|
|
|
|
|
+ /**
|
|
|
+ * 查询举报详情信息
|
|
|
+ * 根据举报ID获取举报详情,包括举报内容、举报类型、举报时间等信息
|
|
|
+ *
|
|
|
+ * @param id 举报记录ID
|
|
|
+ * @return 举报详情信息
|
|
|
+ */
|
|
|
@Override
|
|
|
public SecondReportingVo queryReportingDetail (Integer id) {
|
|
|
SecondReportingVo secondReportingVo = new SecondReportingVo();
|
|
|
@@ -179,6 +190,14 @@ public class SecondGoodsReportingServiceImpl implements SecondGoodsReportingServ
|
|
|
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 商品举报
|
|
|
+ * 处理用户对商品或用户的举报请求,保存举报信息并发送通知
|
|
|
+ *
|
|
|
+ * @param lifeuserViolation 举报信息对象
|
|
|
+ * @return 举报结果,大于0表示举报成功
|
|
|
+ * @throws Exception 举报过程中可能发生的异常
|
|
|
+ */
|
|
|
@Override
|
|
|
public int reporting(SecondUserViolationVo lifeuserViolation) throws Exception {
|
|
|
try {
|
|
|
@@ -221,6 +240,12 @@ public class SecondGoodsReportingServiceImpl implements SecondGoodsReportingServ
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 创建举报通知
|
|
|
+ *
|
|
|
+ * @param lifeuserViolation 举报信息对象
|
|
|
+ * @return 举报通知对象
|
|
|
+ */
|
|
|
private static LifeNotice getLifeNotice(LifeUserViolation lifeuserViolation) {
|
|
|
JSONObject data = JwtUtil.getCurrentUserInfo();
|
|
|
String phoneId = null;
|
|
|
@@ -241,10 +266,11 @@ public class SecondGoodsReportingServiceImpl implements SecondGoodsReportingServ
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 保存商品图片信息
|
|
|
+ * 保存举报图片信息
|
|
|
+ *
|
|
|
* @param id 举报ID
|
|
|
- * @param goods .getimgUrl 图片URL列表
|
|
|
- * @return 保存结果
|
|
|
+ * @param goods 举报信息对象,包含图片URL列表
|
|
|
+ * @return 保存结果,始终返回true
|
|
|
*/
|
|
|
private boolean saveStoreImages(Integer id, SecondUserViolationVo goods ) {
|
|
|
if (CollectionUtil.isEmpty(goods.getImgUrl())) {
|