This repository has been archived by the owner on Jan 19, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from bjchen2/master
finish user pojo
- Loading branch information
Showing
7 changed files
with
106 additions
and
165 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
package com.wizzstudio.substitute.enums; | ||
|
||
public enum Gender { | ||
//男 | ||
MALE, | ||
//女 | ||
FAMALE, | ||
//不限 | ||
NO_LIMITED | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
package com.wizzstudio.substitute.enums; | ||
|
||
public enum Role { | ||
//普通用户 | ||
ROLE_USER, | ||
//一级管理员 | ||
ROLE_ADMIN_1, | ||
//二级管理员 | ||
ROLE_ADMIN_2 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.wizzstudio.substitute.util; | ||
|
||
import java.util.Random; | ||
|
||
/** | ||
* 用于生成唯一主键 | ||
* Created By Cx On 2018/10/25 22:16 | ||
*/ | ||
public class KeyUtil { | ||
|
||
/** | ||
* 生成用户唯一主键 | ||
* synchronized关键字,防止多线程冲突 | ||
*/ | ||
public static synchronized String getUserUniqueKey() { | ||
final char[] words = {'A','a','B','b','C','c','D','d','E','e','F','f','G','g','H','h','I','i','J','j','K','k','L','l','M','m','N','n','O','o','P','p','Q','q','R','r','S','s','T','t','U','u','V','v','W','w','X','x','Y','y','Z','z','0','1','2','3','4','5','6','7','8','9'}; | ||
int length = words.length; | ||
Random random = new Random(); | ||
//生成一个四位的随机数 | ||
StringBuilder key = new StringBuilder(); | ||
for (int i = 0; i < 6; i++){ | ||
key.append(words[random.nextInt(words.length)]); | ||
} | ||
return key.toString(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,42 @@ | ||
#服务器端口 | ||
server.port=8001 | ||
################ database | ||
#spring.datasource.type=com.alibaba.druid.pool.DruidDataSource | ||
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/test | ||
################ database start ################ | ||
##数据库配置 | ||
spring.datasource.url=jdbc:mysql://120.78.131.71:3333/substitute?characterEncoding=utf8&useSSL=false | ||
spring.datasource.driver-class-name=com.mysql.jdbc.Driver | ||
spring.datasource.username=kikyou | ||
spring.datasource.password=kikyou | ||
spring.datasource.username=substitute | ||
spring.datasource.password=substitute | ||
#显示并格式化JPA sql语句 | ||
spring.jpa.show-sql=true | ||
spring.jpa.properties.hibernate.format_sql=true | ||
spring.jpa.hibernate.ddl-auto=create | ||
################ | ||
################ | ||
################ | ||
#数据库连接池配置(需先在pom中引入druid数据库连接池) | ||
#初始化连接池大小,最大连接数,最小连接数 | ||
spring.datasource.druid.initial-size=5 | ||
spring.datasource.druid.min-idle=5 | ||
spring.datasource.druid.max-active=20 | ||
# 配置获取连接等待超时的时间 | ||
spring.datasource.druid.max-wait=60000 | ||
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 | ||
spring.datasource.druid.time-between-eviction-runs-millis=60000 | ||
# 配置一个连接在池中最小生存的时间,单位是毫秒 | ||
spring.datasource.druid.min-evictable-idle-time-millis=300000 | ||
################ database end ############ | ||
|
||
################ redis start ################ | ||
#该ip是内网ip,在服务器上用外网ip无法访问 | ||
#spring.redis.host=172.16.56.135 | ||
#spring.redis.port = 6666 | ||
##没有密码可以不写该属性 | ||
#spring.redis.password = 暂时没填,最后测试 | ||
## 连接池最大连接数 | ||
#spring.redis.jedis.pool.max-active=5000 | ||
## 连接池最大空闲连接数 | ||
#spring.redis.jedis.pool.max-idle=30000 | ||
## 连接池最小空闲连接数 | ||
#spring.redis.jedis.pool.min-idle=50 | ||
## 连接超时时间 | ||
#spring.redis.timeout= 20s | ||
## 连接池最大阻塞时间 | ||
#spring.redis.jedis.pool.max-wait=-1ms | ||
################ redis end ################### |