diff --git a/sql/mysql.sql b/sql/mysql.sql index ffe39c3f..8a7c1bfb 100644 --- a/sql/mysql.sql +++ b/sql/mysql.sql @@ -513,6 +513,7 @@ CREATE TABLE `user` ( `username` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `roleId` int NOT NULL, + `pushKey` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci default null, `createTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `updateTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, PRIMARY KEY (`id`) USING BTREE, diff --git a/sql/update.sql b/sql/update.sql index 43413552..b575f0f1 100644 --- a/sql/update.sql +++ b/sql/update.sql @@ -57,4 +57,8 @@ alter table stream_push change createStamp createTime varchar(50) default null; +alter table user + add pushKey varchar(50) default null; + + diff --git a/src/main/java/com/genersoft/iot/vmp/storager/dao/UserMapper.java b/src/main/java/com/genersoft/iot/vmp/storager/dao/UserMapper.java index addb27d0..cc35789c 100644 --- a/src/main/java/com/genersoft/iot/vmp/storager/dao/UserMapper.java +++ b/src/main/java/com/genersoft/iot/vmp/storager/dao/UserMapper.java @@ -10,13 +10,14 @@ import java.util.List; @Repository public interface UserMapper { - @Insert("INSERT INTO user (username, password, roleId, createTime, updateTime) VALUES" + - "('${username}', '${password}', '${role.id}', '${createTime}', '${updateTime}')") + @Insert("INSERT INTO user (username, password, roleId, pushKey, createTime, updateTime) VALUES" + + "('${username}', '${password}', '${role.id}', '${pushKey}', '${createTime}', '${updateTime}')") int add(User user); @Update(value = {"