File tree Expand file tree Collapse file tree 3 files changed +24
-0
lines changed
APIJSONBoot/src/main/java/apijson/demo
APIJSONDemo/src/main/java/apijson/demo
APIJSONFinal/src/main/java/apijson/demo Expand file tree Collapse file tree 3 files changed +24
-0
lines changed Original file line number Diff line number Diff line change 19
19
import static apijson .framework .APIJSONConstant .USER_ ;
20
20
import static apijson .framework .APIJSONConstant .USER_ID ;
21
21
22
+ import com .alibaba .fastjson .annotation .JSONField ;
23
+
22
24
import apijson .RequestMethod ;
23
25
import apijson .framework .APIJSONSQLConfig ;
24
26
import apijson .orm .AbstractSQLConfig ;
@@ -118,6 +120,8 @@ public String getDBVersion() {
118
120
}
119
121
return null ;
120
122
}
123
+
124
+ @ JSONField (serialize = false ) // 不在日志打印 账号/密码 等敏感信息,用了 UnitAuto 则一定要加
121
125
@ Override
122
126
public String getDBUri () {
123
127
if (isMySQL ()) {
@@ -139,6 +143,8 @@ public String getDBUri() {
139
143
}
140
144
return null ;
141
145
}
146
+
147
+ @ JSONField (serialize = false ) // 不在日志打印 账号/密码 等敏感信息,用了 UnitAuto 则一定要加
142
148
@ Override
143
149
public String getDBAccount () {
144
150
if (isMySQL ()) {
@@ -158,6 +164,8 @@ public String getDBAccount() {
158
164
}
159
165
return null ;
160
166
}
167
+
168
+ @ JSONField (serialize = false ) // 不在日志打印 账号/密码 等敏感信息,用了 UnitAuto 则一定要加
161
169
@ Override
162
170
public String getDBPassword () {
163
171
if (isMySQL ()) {
Original file line number Diff line number Diff line change 14
14
15
15
package apijson .demo ;
16
16
17
+ import com .alibaba .fastjson .annotation .JSONField ;
18
+
17
19
import apijson .framework .APIJSONSQLConfig ;
18
20
19
21
@@ -42,14 +44,20 @@ public class DemoSQLConfig extends APIJSONSQLConfig {
42
44
public String getDBVersion () {
43
45
return "5.7.22" ; // "8.0.11"; // TODO 改成你自己的 MySQL 或 PostgreSQL 数据库版本号 // MYSQL 8 和 7 使用的 JDBC 配置不一样
44
46
}
47
+
48
+ @ JSONField (serialize = false ) // 不在日志打印 账号/密码 等敏感信息
45
49
@ Override
46
50
public String getDBUri () {
47
51
return "jdbc:mysql://localhost:3306" ; // TODO 改成你自己的,TiDB 可以当成 MySQL 使用,默认端口为 4000
48
52
}
53
+
54
+ @ JSONField (serialize = false ) // 不在日志打印 账号/密码 等敏感信息
49
55
@ Override
50
56
public String getDBAccount () {
51
57
return "root" ; // TODO 改成你自己的
52
58
}
59
+
60
+ @ JSONField (serialize = false ) // 不在日志打印 账号/密码 等敏感信息
53
61
@ Override
54
62
public String getDBPassword () {
55
63
return "apijson" ; // TODO 改成你自己的,TiDB 可以当成 MySQL 使用, 默认密码为空字符串 ""
Original file line number Diff line number Diff line change 19
19
import static apijson .framework .APIJSONConstant .USER_ ;
20
20
import static apijson .framework .APIJSONConstant .USER_ID ;
21
21
22
+ import com .alibaba .fastjson .annotation .JSONField ;
23
+
22
24
import apijson .RequestMethod ;
23
25
import apijson .framework .APIJSONSQLConfig ;
24
26
import apijson .orm .AbstractSQLConfig ;
@@ -109,6 +111,8 @@ public String getDBVersion() {
109
111
}
110
112
return null ;
111
113
}
114
+
115
+ @ JSONField (serialize = false ) // 不在日志打印 账号/密码 等敏感信息,用了 UnitAuto 则一定要加
112
116
@ Override
113
117
public String getDBUri () {
114
118
if (isMySQL ()) {
@@ -128,6 +132,8 @@ public String getDBUri() {
128
132
}
129
133
return null ;
130
134
}
135
+
136
+ @ JSONField (serialize = false ) // 不在日志打印 账号/密码 等敏感信息,用了 UnitAuto 则一定要加
131
137
@ Override
132
138
public String getDBAccount () {
133
139
if (isMySQL ()) {
@@ -147,6 +153,8 @@ public String getDBAccount() {
147
153
}
148
154
return null ;
149
155
}
156
+
157
+ @ JSONField (serialize = false ) // 不在日志打印 账号/密码 等敏感信息,用了 UnitAuto 则一定要加
150
158
@ Override
151
159
public String getDBPassword () {
152
160
if (isMySQL ()) {
You can’t perform that action at this time.
0 commit comments