Skip to content

Commit 2a0c263

Browse files

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,35 @@ https://github.com/APIJSON/APIJSON-Demo/blob/master/APIJSON-Java-Server/APIJSONB
130130

131131
#### See document in [ColumnUtil](/src/main/java/apijson/column/ColumnUtil.java) and [DemoSQLConfig](https://github.com/APIJSON/APIJSON-Demo/blob/master/APIJSON-Java-Server/APIJSONBoot/src/main/java/apijson/demo/DemoSQLConfig.java), [DemoSQLExecutor](https://github.com/APIJSON/APIJSON-Demo/blob/master/APIJSON-Java-Server/APIJSONBoot/src/main/java/apijson/demo/DemoSQLExecutor.java) in [APIJSONBoot](https://github.com/APIJSON/APIJSON-Demo/blob/master/APIJSON-Java-Server/APIJSONBoot)
132132

133+
```java
134+
static {
135+
// 反选字段配置
136+
Map<String, List<String>> tableColumnMap = new HashMap<>();
137+
tableColumnMap.put("User", Arrays.asList(StringUtil.split("id,sex,name,tag,head,contactIdList,pictureList,date")));
138+
// 需要对应方法传参也是这样拼接才行,例如 ColumnUtil.compatInputColumn(column, getSQLDatabase() + "-" + getSQLSchema() + "-" + getTable(), getMethod());
139+
tableColumnMap.put("MYSQL-sys-Privacy", Arrays.asList(StringUtil.split("id,certified,phone,balance,_password,_payPassword")));
140+
ColumnUtil.VERSIONED_TABLE_COLUMN_MAP.put(null, tableColumnMap);
141+
142+
// 字段名映射配置 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
143+
Map<String, Map<String, String>> tableKeyColumnMap = new HashMap<>();
144+
145+
Map<String, String> userKeyColumnMap = new HashMap<>();
146+
userKeyColumnMap.put("gender", "sex");
147+
userKeyColumnMap.put("createTime", "date");
148+
tableKeyColumnMap.put("User", userKeyColumnMap);
149+
150+
Map<String, String> privacyKeyColumnMap = new HashMap<>();
151+
privacyKeyColumnMap.put("rest", "balance");
152+
// 需要对应方法传参也是这样拼接才行,例如 ColumnUtil.compatInputKey(super.getKey(key), getSQLDatabase() + "-" + getSQLSchema() + "-" + getTable(), getMethod());
153+
tableKeyColumnMap.put("MYSQL-sys-Privacy", privacyKeyColumnMap);
154+
155+
ColumnUtil.VERSIONED_KEY_COLUMN_MAP.put(null, tableKeyColumnMap);
156+
// 字段名映射配置 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
157+
158+
ColumnUtil.init();
159+
}
160+
```
161+
133162
<br />
134163
<br />
135164
<br />

0 commit comments

Comments
 (0)