Kaynağa Gözat

优化举报接口

zhangchen 3 hafta önce
ebeveyn
işleme
026584c349

+ 4 - 4
alien-lawyer/src/main/java/shop/alien/lawyer/controller/LawyerUserViolationController.java

@@ -33,10 +33,10 @@ public class LawyerUserViolationController {
 
     @ApiOperation("举报")
     @ApiOperationSupport(order = 1)
-    @PostMapping("/reporting")
-    public R<String> reporting(@RequestBody LawyerUserViolation lawyerUserViolation) throws Exception  {
-        log.info("LawyerUserViolationController.reporting?lawyerUserViolation={}", lawyerUserViolation.toString());
-        int reporting = lawyerUserViolationService.reporting(lawyerUserViolation);
+    @PostMapping("/userReporting")
+    public R<String> userReporting(@RequestBody LawyerUserViolation lawyerUserViolation) throws Exception  {
+        log.info("LawyerUserViolationController.userReporting?lawyerUserViolation={}", lawyerUserViolation.toString());
+        int reporting = lawyerUserViolationService.userReporting(lawyerUserViolation);
         if (0 == reporting) {
             return R.fail("举报失败");
         } else {

+ 1 - 1
alien-lawyer/src/main/java/shop/alien/lawyer/service/LawyerUserViolationService.java

@@ -19,7 +19,7 @@ import java.util.Map;
  */
 public interface LawyerUserViolationService extends IService<LawyerUserViolation> {
 
-    int reporting(LawyerUserViolation lawyerUserViolation) throws Exception ;
+    int userReporting(LawyerUserViolation lawyerUserViolation) throws Exception ;
 
     Map<String, Object> reportListByUserId(String userId);
 

+ 3 - 10
alien-lawyer/src/main/java/shop/alien/lawyer/service/impl/LawyerUserViolationServiceImpl.java

@@ -1,6 +1,6 @@
 package shop.alien.lawyer.service.impl;
 
-import com.alibaba.fastjson.JSONObject;
+import com.alibaba.fastjson2.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
@@ -21,7 +21,6 @@ import shop.alien.mapper.*;
 import shop.alien.lawyer.config.WebSocketProcess;
 import shop.alien.lawyer.service.LawyerUserViolationService;
 import shop.alien.lawyer.service.LawyerUserService;
-import shop.alien.util.ali.AliOSSUtil;
 import shop.alien.util.common.EnumUtil;
 
 import java.io.IOException;
@@ -56,14 +55,8 @@ public class LawyerUserViolationServiceImpl extends ServiceImpl<LawyerUserViolat
 
     private final WebSocketProcess webSocketProcess;
 
-    @Value("${spring.web.resources.excel-path}")
-    private String excelPath;
-
-    @Value("${spring.web.resources.excel-generate-path}")
-    private String excelGeneratePath;
-
     @Override
-    public int reporting(LawyerUserViolation lawyerUserViolation) throws Exception {
+    public int userReporting(LawyerUserViolation lawyerUserViolation) throws Exception {
         try {
             int result = lawyerUserViolationMapper.insert(lawyerUserViolation);
             if (result > 0) {
@@ -76,7 +69,7 @@ public class LawyerUserViolationServiceImpl extends ServiceImpl<LawyerUserViolat
                 websocketVo.setCategory("notice");
                 websocketVo.setNoticeType("1");
                 websocketVo.setIsRead(0);
-                websocketVo.setText(com.alibaba.fastjson2.JSONObject.from(lifeNotice).toJSONString());
+                websocketVo.setText(JSONObject.from(lifeNotice).toJSONString());
                 webSocketProcess.sendMessage(lifeNotice.getReceiverId(), com.alibaba.fastjson2.JSONObject.from(websocketVo).toJSONString());
 
                 // 被举报人消息