Переглянути джерело

SysUser类id修改为Integer

yegang 2 роки тому
батько
коміт
957a4c614c

+ 1 - 1
src/main/java/com/sw/controller/TestController.java

@@ -31,7 +31,7 @@ public class TestController {
         return "test";
     }
     @RequestMapping("/get/{id}")
-    public String getUser(@PathVariable int id){
+    public Integer getUser(@PathVariable int id){
         SysUser user = sysUserService.getById(id);
         return user.getId();
     }

+ 1 - 1
src/main/java/com/sw/domain/SysUser.java

@@ -18,5 +18,5 @@ import java.io.Serializable;
 public class SysUser implements Serializable {
     private static final long serialVersionUID = 616589298019846813L;
 
-    private String id;
+    private Integer id;
 }

+ 1 - 1
src/test/java/com/sw/AddUserTest.java

@@ -24,7 +24,7 @@ public class AddUserTest {
     @Test
     public void addUser(){
         for (int i = 0;i < 1000; i++){
-            SysUser user = new SysUser("" + (i + 1));
+            SysUser user = new SysUser( + (i + 1));
             userDao.insert(user);
         }
     }