用户表增加推流鉴权KEY

pull/542/head
648540858 2022-07-08 11:20:29 +08:00
parent d7c293c867
commit fcd79b9864
4 changed files with 17 additions and 2 deletions

View File

@ -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,

View File

@ -57,4 +57,8 @@ alter table stream_push
change createStamp createTime varchar(50) default null;
alter table user
add pushKey varchar(50) default null;

View File

@ -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 = {" <script>" +
"UPDATE user " +
"SET updateTime='${updateTime}' " +
"<if test=\"pushKey != null\">, pushKey='${pushKey}'</if>" +
"<if test=\"role != null\">, roleId='${role.id}'</if>" +
"<if test=\"password != null\">, password='${password}'</if>" +
"<if test=\"username != null\">, username='${username}'</if>" +

View File

@ -7,6 +7,7 @@ public class User {
private String password;
private String createTime;
private String updateTime;
private String pushKey;
private Role role;
public int getId() {
@ -56,4 +57,12 @@ public class User {
public void setRole(Role role) {
this.role = role;
}
public String getPushKey() {
return pushKey;
}
public void setPushKey(String pushKey) {
this.pushKey = pushKey;
}
}