dingsong il y a 4 ans
Parent
commit
63dd3e8c76

+ 29 - 0
src/main/java/com/migao/controller/DemandAttachmentController.java

@@ -0,0 +1,29 @@
+package com.migao.controller;
+
+import com.migao.config.response.ResponseBean;
+import com.migao.service.DemandAttachmentService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+
+/**
+ * @author dingsong
+ */
+@Api(tags = "008.需求库附件模快")
+@RestController
+@RequestMapping("/DemandAttachment")
+public class DemandAttachmentController {
+    @Resource
+    DemandAttachmentService demandAttachmentService;
+
+    @ApiOperation("删除附件")
+    @PostMapping(value = "/deleteById")
+    public ResponseBean<?> deleteById(@RequestParam String id){
+        return demandAttachmentService.deleteById(id);
+    }
+}

+ 60 - 0
src/main/java/com/migao/controller/MessageController.java

@@ -0,0 +1,60 @@
+package com.migao.controller;
+
+import com.migao.config.response.BasePageRequest;
+import com.migao.config.response.PageBeanOne;
+import com.migao.config.response.ResponseBean;
+import com.migao.entity.vo.req.MessageQueryReq;
+import com.migao.entity.vo.res.MessageQueryRes;
+import com.migao.service.MessageService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+
+/**
+ * @author dingsong
+ */
+@Api(tags = "009.消息模快")
+@RestController
+@RequestMapping("/Message")
+public class MessageController {
+    @Resource
+    MessageService messageService;
+
+    @ApiOperation("分页查询所有消息")
+    @PostMapping(value = "/pageQuery")
+    public ResponseBean<PageBeanOne<MessageQueryRes>> pageQuery(@RequestBody BasePageRequest basePageRequest) {
+        return messageService.pageQuery(basePageRequest);
+    }
+
+    @ApiOperation("分页查询当前用户消息")
+    @PostMapping(value = "/pageQueryById")
+    public ResponseBean<PageBeanOne<MessageQueryRes>> pageQueryById(@RequestBody BasePageRequest basePageRequest) {
+        return messageService.pageQueryById(basePageRequest);
+    }
+
+    @ApiOperation("通过id查询单个消息")
+    @PostMapping(value = "/pageQueryOne")
+    public ResponseBean<MessageQueryRes> pageQueryOne(@RequestParam String id) {
+        return messageService.pageQueryOne(id);
+    }
+
+    @ApiOperation("通过id更新读取状态")
+    @PostMapping(value = "/updateById")
+    public ResponseBean<?> updateById(@RequestParam String id) {
+        return messageService.updateById(id);
+    }
+
+    @ApiOperation("分页模糊查询所有数据")
+    @PostMapping(value = "/pageQueryTwo")
+    public ResponseBean<PageBeanOne<MessageQueryRes>> pageQueryTwo(@RequestBody MessageQueryReq messageQueryReq) {
+        return messageService.pageQueryTwo(messageQueryReq);
+    }
+
+    @ApiOperation("分页模糊查询当前用户数据")
+    @PostMapping(value = "/pageQueryTwoById")
+    public ResponseBean<PageBeanOne<MessageQueryRes>> pageQueryTwoById(@RequestBody MessageQueryReq messageQueryReq) {
+        return messageService.pageQueryTwoById(messageQueryReq);
+    }
+}

+ 1 - 1
src/main/java/com/migao/service/DemandAttachmentService.java

@@ -13,5 +13,5 @@ public interface DemandAttachmentService extends IService<DemandAttachment> {
      * @param id
      * @return
      */
-    ResponseBean<?> deleteById(String id);
+   public ResponseBean<?> deleteById(String id);
 }

+ 2 - 0
src/main/java/com/migao/service/impl/MessageServiceImpl.java

@@ -146,6 +146,7 @@ public class MessageServiceImpl extends ServiceImpl<MessageMapper, Message> impl
         size = size == null ? 10 : size <= 0 ? 10 : size;
 
         LambdaQueryWrapper<Message> mee = Wrappers.<Message>lambdaQuery();
+        mee.eq(Message::getDeleted,0);
         if(StringUtils.isNotBlank(messageQueryReq.getKey())){
             //标题
             mee.like(Message::getName,messageQueryReq.getKey());
@@ -191,6 +192,7 @@ public class MessageServiceImpl extends ServiceImpl<MessageMapper, Message> impl
 
         LambdaQueryWrapper<Message> mee = Wrappers.<Message>lambdaQuery();
         mee.eq(Message::getAcceptUserId,user.getId());
+        mee.eq(Message::getDeleted,0);
         if(StringUtils.isNotBlank(messageQueryReq.getKey())){
             //标题
             mee.like(Message::getName,messageQueryReq.getKey());