Skip to content

Commit 32c2777

Browse files
committed
解决返回 database, schema 等信息
1 parent a46e24e commit 32c2777

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

APIJSONORM/src/main/java/apijson/JSONMap.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,8 @@ default JSONMap<M, L> setUserIdIn(List<Object> list) {
155155
String KEY_DROP = "@drop"; //丢弃,不返回,TODO 应该通过 fastjson 的 ignore 之类的机制来处理,避免导致下面的对象也不返回
156156
// String KEY_KEEP = "@keep"; //一定会返回,为 null 或 空对象时,会使用默认值(非空),解决其它对象因为不关联的第一个对为空导致也不返回
157157
String KEY_DEFULT = "@default"; //TODO 自定义默认值 { "@default":true },@default 可完全替代 @keep
158-
String KEY_NULL = "@null"; //TODO 值为 null 的键值对 "@null":"tag,pictureList",允许 is NULL 条件判断, SET tag = NULL 修改值为 NULL 等
159-
String KEY_CAST = "@cast"; //TODO 类型转换 cast(date AS DATE)
158+
String KEY_NULL = "@null"; //值为 null 的键值对 "@null":"tag,pictureList",允许 is NULL 条件判断, SET tag = NULL 修改值为 NULL 等
159+
String KEY_CAST = "@cast"; //类型转换 cast(date AS DATE)
160160

161161
String KEY_ROLE = "@role"; //角色,拥有对某些数据的某些操作的权限
162162
String KEY_DATABASE = "@database"; //数据库类型,默认为MySQL

APIJSONORM/src/main/java/apijson/orm/AbstractParser.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -594,6 +594,13 @@ public M parseResponse(M request) {
594594

595595
requestObject = error == null ? extendSuccessResult(requestObject, warn, isRoot) : extendErrorResult(requestObject, error, requestMethod, getRequestURL(), isRoot);
596596

597+
// FIXME 暂时先直接移除,后续排查是在哪里 put 进来
598+
requestObject.remove(KEY_DATABASE);
599+
requestObject.remove(KEY_DATASOURCE);
600+
requestObject.remove(KEY_NAMESPACE);
601+
requestObject.remove(KEY_CATALOG);
602+
requestObject.remove(KEY_SCHEMA);
603+
597604
M res = (globalFormat != null && globalFormat) && JSONResponse.isSuccess(requestObject) ? JSONResponse.format(requestObject) : requestObject;
598605

599606
long endTime = System.currentTimeMillis();

0 commit comments

Comments
 (0)