hasan 2 년 전
부모
커밋
8a216e5e33

+ 4 - 2
src/main/java/com/szls/nstths/controller/DataController.java

@@ -7,6 +7,8 @@ import org.slf4j.Logger;
7 7
 import org.slf4j.LoggerFactory;
8 8
 import org.springframework.beans.factory.annotation.Autowired;
9 9
 import org.springframework.web.bind.annotation.PostMapping;
10
+import org.springframework.web.bind.annotation.RequestBody;
11
+import org.springframework.web.bind.annotation.ResponseBody;
10 12
 import org.springframework.web.bind.annotation.RestController;
11 13
 
12 14
 
@@ -23,9 +25,9 @@ public class DataController {
23 25
     }
24 26
 
25 27
     @PostMapping("/equipmentTestingEnd")
26
-    public String equipmentTesting(TeData teData) {
28
+    public String equipmentTesting(@RequestBody TeData teData) {
27 29
         logger.info("{}", teData);
28 30
         int dbi = teDataMapper.insert(teData);
29
-        return dbi + " success";
31
+        return dbi+" success";
30 32
     }
31 33
 }

+ 7 - 1
src/main/java/com/szls/nstths/entity/TeData.java

@@ -1,8 +1,11 @@
1 1
 package com.szls.nstths.entity;
2 2
 
3 3
 
4
+import com.baomidou.mybatisplus.annotation.IdType;
5
+import com.baomidou.mybatisplus.annotation.TableField;
4 6
 import com.baomidou.mybatisplus.annotation.TableId;
5 7
 import com.baomidou.mybatisplus.annotation.TableName;
8
+import com.fasterxml.jackson.annotation.JsonFormat;
6 9
 import lombok.Data;
7 10
 
8 11
 import java.util.Date;
@@ -10,10 +13,13 @@ import java.util.Date;
10 13
 @Data
11 14
 @TableName("te_data")
12 15
 public class TeData {
13
-    @TableId
16
+    @TableId(type = IdType.NONE)
14 17
     private Long id;
18
+    @TableField("equipmentID")
15 19
     private String equipmentID;
20
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
16 21
     private Date stime;
22
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
17 23
     private Date etime;
18 24
     private String rotationxy;
19 25
 

+ 2 - 1
src/main/java/com/szls/nstths/entity/User.java

@@ -1,5 +1,6 @@
1 1
 package com.szls.nstths.entity;
2 2
 
3
+import com.baomidou.mybatisplus.annotation.IdType;
3 4
 import com.baomidou.mybatisplus.annotation.TableId;
4 5
 import com.baomidou.mybatisplus.annotation.TableName;
5 6
 import lombok.Data;
@@ -7,7 +8,7 @@ import lombok.Data;
7 8
 @Data
8 9
 @TableName("sys_user")
9 10
 public class User {
10
-    @TableId
11
+    @TableId(type = IdType.NONE)
11 12
     private Long id;
12 13
     private String name;
13 14
     private String email;