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 1919import  static  apijson .framework .APIJSONConstant .USER_ ;
2020import  static  apijson .framework .APIJSONConstant .USER_ID ;
2121
22+ import  com .alibaba .fastjson .annotation .JSONField ;
23+ 
2224import  apijson .RequestMethod ;
2325import  apijson .framework .APIJSONSQLConfig ;
2426import  apijson .orm .AbstractSQLConfig ;
@@ -118,6 +120,8 @@ public String getDBVersion() {
118120}
119121return  null ;
120122}
123+ 
124+ @ JSONField (serialize  = false ) // 不在日志打印 账号/密码 等敏感信息,用了 UnitAuto 则一定要加 
121125@ Override 
122126public  String  getDBUri () {
123127if  (isMySQL ()) {
@@ -139,6 +143,8 @@ public String getDBUri() {
139143}
140144return  null ;
141145}
146+ 
147+ @ JSONField (serialize  = false ) // 不在日志打印 账号/密码 等敏感信息,用了 UnitAuto 则一定要加 
142148@ Override 
143149public  String  getDBAccount () {
144150if  (isMySQL ()) {
@@ -158,6 +164,8 @@ public String getDBAccount() {
158164}
159165return  null ;
160166}
167+ 
168+ @ JSONField (serialize  = false ) // 不在日志打印 账号/密码 等敏感信息,用了 UnitAuto 则一定要加 
161169@ Override 
162170public  String  getDBPassword () {
163171if  (isMySQL ()) {
Original file line number Diff line number Diff line change 1414
1515package  apijson .demo ;
1616
17+ import  com .alibaba .fastjson .annotation .JSONField ;
18+ 
1719import  apijson .framework .APIJSONSQLConfig ;
1820
1921
@@ -42,14 +44,20 @@ public class DemoSQLConfig extends APIJSONSQLConfig {
4244public  String  getDBVersion () {
4345return  "5.7.22" ; // "8.0.11"; // TODO 改成你自己的 MySQL 或 PostgreSQL 数据库版本号 // MYSQL 8 和 7 使用的 JDBC 配置不一样 
4446}
47+ 
48+ @ JSONField (serialize  = false ) // 不在日志打印 账号/密码 等敏感信息 
4549@ Override 
4650public  String  getDBUri () {
4751return  "jdbc:mysql://localhost:3306" ; // TODO 改成你自己的,TiDB 可以当成 MySQL 使用,默认端口为 4000 
4852}
53+ 
54+ @ JSONField (serialize  = false ) // 不在日志打印 账号/密码 等敏感信息 
4955@ Override 
5056public  String  getDBAccount () {
5157return  "root" ; // TODO 改成你自己的 
5258}
59+ 
60+ @ JSONField (serialize  = false ) // 不在日志打印 账号/密码 等敏感信息 
5361@ Override 
5462public  String  getDBPassword () {
5563return  "apijson" ; // TODO 改成你自己的,TiDB 可以当成 MySQL 使用, 默认密码为空字符串 "" 
Original file line number Diff line number Diff line change 1919import  static  apijson .framework .APIJSONConstant .USER_ ;
2020import  static  apijson .framework .APIJSONConstant .USER_ID ;
2121
22+ import  com .alibaba .fastjson .annotation .JSONField ;
23+ 
2224import  apijson .RequestMethod ;
2325import  apijson .framework .APIJSONSQLConfig ;
2426import  apijson .orm .AbstractSQLConfig ;
@@ -109,6 +111,8 @@ public String getDBVersion() {
109111}
110112return  null ;
111113}
114+ 
115+ @ JSONField (serialize  = false ) // 不在日志打印 账号/密码 等敏感信息,用了 UnitAuto 则一定要加 
112116@ Override 
113117public  String  getDBUri () {
114118if  (isMySQL ()) {
@@ -128,6 +132,8 @@ public String getDBUri() {
128132}
129133return  null ;
130134}
135+ 
136+ @ JSONField (serialize  = false ) // 不在日志打印 账号/密码 等敏感信息,用了 UnitAuto 则一定要加 
131137@ Override 
132138public  String  getDBAccount () {
133139if  (isMySQL ()) {
@@ -147,6 +153,8 @@ public String getDBAccount() {
147153}
148154return  null ;
149155}
156+ 
157+ @ JSONField (serialize  = false ) // 不在日志打印 账号/密码 等敏感信息,用了 UnitAuto 则一定要加 
150158@ Override 
151159public  String  getDBPassword () {
152160if  (isMySQL ()) {
                         You can’t perform that action at this time. 
           
                  
0 commit comments