From fcd79b9864b2dc2478bf3f660fae257af0844937 Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: Fri, 8 Jul 2022 11:20:29 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=A8=E6=88=B7=E8=A1=A8=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E6=8E=A8=E6=B5=81=E9=89=B4=E6=9D=83KEY?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sql/mysql.sql | 1 + sql/update.sql | 4 ++++ .../com/genersoft/iot/vmp/storager/dao/UserMapper.java | 5 +++-- .../com/genersoft/iot/vmp/storager/dao/dto/User.java | 9 +++++++++ 4 files changed, 17 insertions(+), 2 deletions(-) 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 = {"