Quellcode durchsuchen

增加联系留言列表

FengChaoYu vor 1 Woche
Ursprung
Commit
dd5e8224c6

+ 13 - 4
mall-server-api/src/main/java/com/gree/mall/manager/controller/message/MessageController.java

@@ -4,17 +4,16 @@ import cn.hutool.core.lang.TypeReference;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.gree.mall.manager.annotation.ZfireList;
 import com.gree.mall.manager.bean.message.MessageVO;
+import com.gree.mall.manager.exception.RemoteServiceException;
 import com.gree.mall.manager.helper.ResponseHelper;
 import com.gree.mall.manager.logic.message.MessageLogic;
 import com.gree.mall.manager.zfire.bean.ZfireParamBean;
 import com.gree.mall.manager.zfire.util.FieldUtils;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
 import lombok.extern.slf4j.Slf4j;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
@@ -51,4 +50,14 @@ public class MessageController {
         //3.导出
         FieldUtils.exportData(page.getRecords(), zfireParamBean.getExportFields(), request, response);
     }
+
+    @PostMapping("/remark")
+    @ApiOperation(value = "备注")
+    public ResponseHelper remark(
+            @ApiParam(value = "id", required = true) @RequestParam String id,
+            @ApiParam(value = "备注") @RequestParam(required = false) String remark
+    ) throws RemoteServiceException {
+        messageLogic.remark(id, remark);
+        return ResponseHelper.success();
+    }
 }

+ 9 - 0
mall-server-api/src/main/java/com/gree/mall/manager/logic/message/MessageLogic.java

@@ -6,6 +6,8 @@ import com.gree.mall.manager.bean.admin.AdminUserCom;
 import com.gree.mall.manager.bean.message.MessageVO;
 import com.gree.mall.manager.commonmapper.CommonMapper;
 import com.gree.mall.manager.logic.common.CommonLogic;
+import com.gree.mall.manager.plus.entity.Message;
+import com.gree.mall.manager.plus.service.MessageService;
 import com.gree.mall.manager.zfire.bean.ZfireParamBean;
 import com.gree.mall.manager.zfire.util.FieldUtils;
 import lombok.RequiredArgsConstructor;
@@ -19,6 +21,7 @@ public class MessageLogic {
 
     private final CommonMapper commonMapper;
     private final CommonLogic commonLogic;
+    private final MessageService messageService;
 
 
     public IPage<MessageVO> list(ZfireParamBean zfireParamBean) {
@@ -29,4 +32,10 @@ public class MessageLogic {
         return page;
     }
 
+    public void remark(String id, String remark) {
+        messageService.lambdaUpdate()
+                .set(Message::getRemark, remark)
+                .eq(Message::getId, id)
+                .update();
+    }
 }