hasan 2 年之前
父節點
當前提交
8a216e5e33

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

@@ -7,6 +7,8 @@ import org.slf4j.Logger;
7
 import org.slf4j.LoggerFactory;
7
 import org.slf4j.LoggerFactory;
8
 import org.springframework.beans.factory.annotation.Autowired;
8
 import org.springframework.beans.factory.annotation.Autowired;
9
 import org.springframework.web.bind.annotation.PostMapping;
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
 import org.springframework.web.bind.annotation.RestController;
12
 import org.springframework.web.bind.annotation.RestController;
11
 
13
 
12
 
14
 
@@ -23,9 +25,9 @@ public class DataController {
23
     }
25
     }
24
 
26
 
25
     @PostMapping("/equipmentTestingEnd")
27
     @PostMapping("/equipmentTestingEnd")
26
-    public String equipmentTesting(TeData teData) {
28
+    public String equipmentTesting(@RequestBody TeData teData) {
27
         logger.info("{}", teData);
29
         logger.info("{}", teData);
28
         int dbi = teDataMapper.insert(teData);
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
 package com.szls.nstths.entity;
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
 import com.baomidou.mybatisplus.annotation.TableId;
6
 import com.baomidou.mybatisplus.annotation.TableId;
5
 import com.baomidou.mybatisplus.annotation.TableName;
7
 import com.baomidou.mybatisplus.annotation.TableName;
8
+import com.fasterxml.jackson.annotation.JsonFormat;
6
 import lombok.Data;
9
 import lombok.Data;
7
 
10
 
8
 import java.util.Date;
11
 import java.util.Date;
@@ -10,10 +13,13 @@ import java.util.Date;
10
 @Data
13
 @Data
11
 @TableName("te_data")
14
 @TableName("te_data")
12
 public class TeData {
15
 public class TeData {
13
-    @TableId
16
+    @TableId(type = IdType.NONE)
14
     private Long id;
17
     private Long id;
18
+    @TableField("equipmentID")
15
     private String equipmentID;
19
     private String equipmentID;
20
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
16
     private Date stime;
21
     private Date stime;
22
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
17
     private Date etime;
23
     private Date etime;
18
     private String rotationxy;
24
     private String rotationxy;
19
 
25
 

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

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