举报佐证材料限制数量

This commit is contained in:
liyj 2025-08-15 09:40:06 +08:00
parent 9fe7ed4ef6
commit 65956d5b69

View File

@ -22,7 +22,6 @@ import com.suisung.mall.sns.service.SnsUserReportService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import java.util.*; import java.util.*;
@ -30,10 +29,6 @@ import java.util.*;
@Service @Service
@lombok.extern.slf4j.Slf4j @lombok.extern.slf4j.Slf4j
public class SnsUserReportServiceImpl extends BaseServiceImpl<SnsUserReportMapper, SnsUserReport> implements SnsUserReportService { public class SnsUserReportServiceImpl extends BaseServiceImpl<SnsUserReportMapper, SnsUserReport> implements SnsUserReportService {
@Autowired
private ShopService shopService;
private final static Set<Integer> processingStatusList= Collections.unmodifiableSet(new HashSet<>( private final static Set<Integer> processingStatusList= Collections.unmodifiableSet(new HashSet<>(
Arrays.asList(1,2,3) Arrays.asList(1,2,3)
)); ));
@ -131,6 +126,9 @@ public class SnsUserReportServiceImpl extends BaseServiceImpl<SnsUserReportMappe
} }
Gson gson=new Gson(); Gson gson=new Gson();
List<ReportImageData> reportImageData= gson.fromJson(snsUserReport.getEvidenceImages(), new TypeToken<List<ReportImageData>>(){}.getType()); List<ReportImageData> reportImageData= gson.fromJson(snsUserReport.getEvidenceImages(), new TypeToken<List<ReportImageData>>(){}.getType());
if(reportImageData.size()>limtFiels){
return CommonResult.failed("佐证材料不能超过3个");
}
String evedenceImageDatas= gson.toJson(reportImageData); String evedenceImageDatas= gson.toJson(reportImageData);
if(!checkoutImageUrl(reportImageData)){ if(!checkoutImageUrl(reportImageData)){
return CommonResult.failed("处理佐证材料格式不正确"); return CommonResult.failed("处理佐证材料格式不正确");