From e8109eee3549d43fc4de2fe4286e29a4152f824d Mon Sep 17 00:00:00 2001
From: zepengdev <lzpsmith@outlook.com>
Date: Wed, 04 Jun 2025 08:38:07 +0800
Subject: [PATCH] 删除CreateBy、UpdateBy赋值

---
 oying-system/src/main/java/com/oying/modules/message/rest/MessageSystemController.java |   96 ++++++++++++++++++++++++++++++++----------------
 1 files changed, 64 insertions(+), 32 deletions(-)

diff --git a/oying-system/src/main/java/com/oying/modules/message/rest/MessageSystemController.java b/oying-system/src/main/java/com/oying/modules/message/rest/MessageSystemController.java
index 04ea356..0df458c 100644
--- a/oying-system/src/main/java/com/oying/modules/message/rest/MessageSystemController.java
+++ b/oying-system/src/main/java/com/oying/modules/message/rest/MessageSystemController.java
@@ -5,7 +5,12 @@
 import com.oying.modules.message.service.MessageSystemService;
 import com.oying.modules.message.domain.dto.MessageSystemQueryCriteria;
 import lombok.RequiredArgsConstructor;
+
+import java.sql.Timestamp;
+import java.util.Date;
 import java.util.List;
+
+import org.springframework.format.annotation.DateTimeFormat;
 import org.springframework.http.HttpStatus;
 import org.springframework.http.ResponseEntity;
 import org.springframework.security.access.prepost.PreAuthorize;
@@ -18,23 +23,23 @@
 import com.oying.utils.PageResult;
 
 /**
-* @author 李萌
-* @date 2025-05-14
-**/
+ * @author 李萌
+ * @date 2025-05-20
+ **/
 @RestController
 @RequiredArgsConstructor
 @Api(tags = "消息_系统")
-@RequestMapping("/api/messageSystem")
+@RequestMapping("/api/message/messageSystem")
 public class MessageSystemController {
 
     private final MessageSystemService messageSystemService;
 
-    @ApiOperation("导出数据")
-    @GetMapping(value = "/download")
-    @PreAuthorize("@el.check('messageSystem:list')")
-    public void exportMessageSystem(HttpServletResponse response, MessageSystemQueryCriteria criteria) throws IOException {
-        messageSystemService.download(messageSystemService.queryAll(criteria), response);
-    }
+//    @ApiOperation("导出数据")
+//    @GetMapping(value = "/download")
+//    @PreAuthorize("@el.check('messageSystem:list')")
+//    public void exportMessageSystem(HttpServletResponse response, MessageSystemQueryCriteria criteria) throws IOException {
+//        messageSystemService.download(messageSystemService.queryAll(criteria), response);
+//    }
 
     @GetMapping
     @ApiOperation("查询消息_系统")
@@ -44,30 +49,57 @@
         return new ResponseEntity<>(messageSystemService.queryAll(criteria,page),HttpStatus.OK);
     }
 
-    @PostMapping
-    @Log("新增消息_系统")
-    @ApiOperation("新增消息_系统")
-    @PreAuthorize("@el.check('messageSystem:add')")
-    public ResponseEntity<Object> createMessageSystem(@Validated @RequestBody MessageSystem resources){
-        messageSystemService.create(resources);
-        return new ResponseEntity<>(HttpStatus.CREATED);
-    }
+//    @PostMapping
+//    @Log("新增消息_系统")
+//    @ApiOperation("新增消息_系统")
+//    @PreAuthorize("@el.check('messageSystem:add')")
+//    public ResponseEntity<Object> createMessageSystem(@Validated @RequestBody MessageSystem resources){
+//        messageSystemService.create(resources);
+//        return new ResponseEntity<>(HttpStatus.CREATED);
+//    }
 
-    @PutMapping
-    @Log("修改消息_系统")
-    @ApiOperation("修改消息_系统")
-    @PreAuthorize("@el.check('messageSystem:edit')")
-    public ResponseEntity<Object> updateMessageSystem(@Validated @RequestBody MessageSystem resources){
-        messageSystemService.update(resources);
-        return new ResponseEntity<>(HttpStatus.NO_CONTENT);
-    }
+//    @PutMapping
+//    @Log("修改消息_系统")
+//    @ApiOperation("修改消息_系统")
+//    @PreAuthorize("@el.check('messageSystem:edit')")
+//    public ResponseEntity<Object> updateMessageSystem(@Validated @RequestBody MessageSystem resources){
+//        messageSystemService.update(resources);
+//        return new ResponseEntity<>(HttpStatus.NO_CONTENT);
+//    }
 
-    @DeleteMapping
-    @Log("删除消息_系统")
-    @ApiOperation("删除消息_系统")
-    @PreAuthorize("@el.check('messageSystem:del')")
-    public ResponseEntity<Object> deleteMessageSystem(@ApiParam(value = "传ID数组[]") @RequestBody List<Long> ids) {
-        messageSystemService.deleteAll(ids);
+//    @DeleteMapping
+//    @Log("删除消息_系统")
+//    @ApiOperation("删除消息_系统")
+//    @PreAuthorize("@el.check('messageSystem:del')")
+//    public ResponseEntity<Object> deleteMessageSystem(@ApiParam(value = "传ID数组[]") @RequestBody List<Integer> ids) {
+//        messageSystemService.deleteAll(ids);
+//        return new ResponseEntity<>(HttpStatus.OK);
+//    }
+
+    //查询一条系统消息
+    @GetMapping("/{id}")
+    @ApiOperation("查询一条系统消息")
+    public ResponseEntity<MessageSystem> getMessageSystem(@PathVariable Integer id){
+        MessageSystem messageSystem = messageSystemService.getById(id);
+        return new ResponseEntity<>(messageSystem,HttpStatus.OK);
+    }
+    //插入一条系统消息 带两个参数start与end
+    @PostMapping()
+    @ApiOperation("插入一条系统消息")
+    public ResponseEntity<Object> insertMessageSystem(
+            @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date start,
+            @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date end) {
+
+        // 创建 MessageSystem 对象
+        MessageSystem messageSystem = new MessageSystem();
+        messageSystem.setStartTime(new Timestamp(start.getTime()));
+        messageSystem.setEndTime(new Timestamp(end.getTime()));
+
+        // 调用服务层保存数据
+        messageSystemService.save(messageSystem);
+
         return new ResponseEntity<>(HttpStatus.OK);
     }
+
+
 }

--
Gitblit v1.9.3