Skip to content

Commit d7c3115

Browse files
committed
拼错单词 globle 纠正为 global
1 parent 1e5e587 commit d7c3115

File tree

4 files changed

+65
-65
lines changed

4 files changed

+65
-65
lines changed

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -332,22 +332,22 @@ else if (sqlConfig.isClickHouse()) {
332332
}
333333

334334
if (isTable) {
335-
if (parser.getGlobleDatabase() != null && sqlRequest.get(JSONRequest.KEY_DATABASE) == null) {
336-
sqlRequest.put(JSONRequest.KEY_DATABASE, parser.getGlobleDatabase());
335+
if (parser.getGlobalDatabase() != null && sqlRequest.get(JSONRequest.KEY_DATABASE) == null) {
336+
sqlRequest.put(JSONRequest.KEY_DATABASE, parser.getGlobalDatabase());
337337
}
338-
if (parser.getGlobleSchema() != null && sqlRequest.get(JSONRequest.KEY_SCHEMA) == null) {
339-
sqlRequest.put(JSONRequest.KEY_SCHEMA, parser.getGlobleSchema());
338+
if (parser.getGlobalSchema() != null && sqlRequest.get(JSONRequest.KEY_SCHEMA) == null) {
339+
sqlRequest.put(JSONRequest.KEY_SCHEMA, parser.getGlobalSchema());
340340
}
341-
if (parser.getGlobleDatasource() != null && sqlRequest.get(JSONRequest.KEY_DATASOURCE) == null) {
342-
sqlRequest.put(JSONRequest.KEY_DATASOURCE, parser.getGlobleDatasource());
341+
if (parser.getGlobalDatasource() != null && sqlRequest.get(JSONRequest.KEY_DATASOURCE) == null) {
342+
sqlRequest.put(JSONRequest.KEY_DATASOURCE, parser.getGlobalDatasource());
343343
}
344344

345345
if (isSubquery == false) { //解决 SQL 语法报错,子查询不能 EXPLAIN
346-
if (parser.getGlobleExplain() != null && sqlRequest.get(JSONRequest.KEY_EXPLAIN) == null) {
347-
sqlRequest.put(JSONRequest.KEY_EXPLAIN, parser.getGlobleExplain());
346+
if (parser.getGlobalExplain() != null && sqlRequest.get(JSONRequest.KEY_EXPLAIN) == null) {
347+
sqlRequest.put(JSONRequest.KEY_EXPLAIN, parser.getGlobalExplain());
348348
}
349-
if (parser.getGlobleCache() != null && sqlRequest.get(JSONRequest.KEY_CACHE) == null) {
350-
sqlRequest.put(JSONRequest.KEY_CACHE, parser.getGlobleCache());
349+
if (parser.getGlobalCache() != null && sqlRequest.get(JSONRequest.KEY_CACHE) == null) {
350+
sqlRequest.put(JSONRequest.KEY_CACHE, parser.getGlobalCache());
351351
}
352352
}
353353
}

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

Lines changed: 47 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -187,69 +187,69 @@ public AbstractParser<T> setRequest(JSONObject request) {
187187
return this;
188188
}
189189

190-
protected Boolean globleFormat;
191-
public AbstractParser<T> setGlobleFormat(Boolean globleFormat) {
192-
this.globleFormat = globleFormat;
190+
protected Boolean globalFormat;
191+
public AbstractParser<T> setGlobalFormat(Boolean globalFormat) {
192+
this.globalFormat = globalFormat;
193193
return this;
194194
}
195195
@Override
196-
public Boolean getGlobleFormat() {
197-
return globleFormat;
196+
public Boolean getGlobalFormat() {
197+
return globalFormat;
198198
}
199-
protected String globleRole;
200-
public AbstractParser<T> setGlobleRole(String globleRole) {
201-
this.globleRole = globleRole;
199+
protected String globalRole;
200+
public AbstractParser<T> setGlobalRole(String globalRole) {
201+
this.globalRole = globalRole;
202202
return this;
203203
}
204204
@Override
205-
public String getGlobleRole() {
206-
return globleRole;
205+
public String getGlobalRole() {
206+
return globalRole;
207207
}
208-
protected String globleDatabase;
209-
public AbstractParser<T> setGlobleDatabase(String globleDatabase) {
210-
this.globleDatabase = globleDatabase;
208+
protected String globalDatabase;
209+
public AbstractParser<T> setGlobalDatabase(String globalDatabase) {
210+
this.globalDatabase = globalDatabase;
211211
return this;
212212
}
213213
@Override
214-
public String getGlobleDatabase() {
215-
return globleDatabase;
214+
public String getGlobalDatabase() {
215+
return globalDatabase;
216216
}
217-
protected String globleSchema;
218-
public AbstractParser<T> setGlobleSchema(String globleSchema) {
219-
this.globleSchema = globleSchema;
217+
protected String globalSchema;
218+
public AbstractParser<T> setGlobalSchema(String globalSchema) {
219+
this.globalSchema = globalSchema;
220220
return this;
221221
}
222222
@Override
223-
public String getGlobleSchema() {
224-
return globleSchema;
223+
public String getGlobalSchema() {
224+
return globalSchema;
225225
}
226-
protected String globleDatasource;
226+
protected String globalDatasource;
227227
@Override
228-
public String getGlobleDatasource() {
229-
return globleDatasource;
228+
public String getGlobalDatasource() {
229+
return globalDatasource;
230230
}
231-
public AbstractParser<T> setGlobleDatasource(String globleDatasource) {
232-
this.globleDatasource = globleDatasource;
231+
public AbstractParser<T> setGlobalDatasource(String globalDatasource) {
232+
this.globalDatasource = globalDatasource;
233233
return this;
234234
}
235235

236-
protected Boolean globleExplain;
237-
public AbstractParser<T> setGlobleExplain(Boolean globleExplain) {
238-
this.globleExplain = globleExplain;
236+
protected Boolean globalExplain;
237+
public AbstractParser<T> setGlobalExplain(Boolean globalExplain) {
238+
this.globalExplain = globalExplain;
239239
return this;
240240
}
241241
@Override
242-
public Boolean getGlobleExplain() {
243-
return globleExplain;
242+
public Boolean getGlobalExplain() {
243+
return globalExplain;
244244
}
245-
protected String globleCache;
246-
public AbstractParser<T> setGlobleCache(String globleCache) {
247-
this.globleCache = globleCache;
245+
protected String globalCache;
246+
public AbstractParser<T> setGlobalCache(String globalCache) {
247+
this.globalCache = globalCache;
248248
return this;
249249
}
250250
@Override
251-
public String getGlobleCache() {
252-
return globleCache;
251+
public String getGlobalCache() {
252+
return globalCache;
253253
}
254254

255255
@Override
@@ -383,22 +383,22 @@ public JSONObject parseResponse(JSONObject request) {
383383
}
384384

385385
//必须在parseCorrectRequest后面,因为parseCorrectRequest可能会添加 @role
386-
if (isNeedVerifyRole() && globleRole == null) {
386+
if (isNeedVerifyRole() && globalRole == null) {
387387
try {
388-
setGlobleRole(requestObject.getString(JSONRequest.KEY_ROLE));
388+
setGlobalRole(requestObject.getString(JSONRequest.KEY_ROLE));
389389
requestObject.remove(JSONRequest.KEY_ROLE);
390390
} catch (Exception e) {
391391
return extendErrorResult(requestObject, e, requestMethod, getRequestURL(), isRoot);
392392
}
393393
}
394394

395395
try {
396-
setGlobleFormat(requestObject.getBoolean(JSONRequest.KEY_FORMAT));
397-
setGlobleDatabase(requestObject.getString(JSONRequest.KEY_DATABASE));
398-
setGlobleSchema(requestObject.getString(JSONRequest.KEY_SCHEMA));
399-
setGlobleDatasource(requestObject.getString(JSONRequest.KEY_DATASOURCE));
400-
setGlobleExplain(requestObject.getBoolean(JSONRequest.KEY_EXPLAIN));
401-
setGlobleCache(requestObject.getString(JSONRequest.KEY_CACHE));
396+
setGlobalFormat(requestObject.getBoolean(JSONRequest.KEY_FORMAT));
397+
setGlobalDatabase(requestObject.getString(JSONRequest.KEY_DATABASE));
398+
setGlobalSchema(requestObject.getString(JSONRequest.KEY_SCHEMA));
399+
setGlobalDatasource(requestObject.getString(JSONRequest.KEY_DATASOURCE));
400+
setGlobalExplain(requestObject.getBoolean(JSONRequest.KEY_EXPLAIN));
401+
setGlobalCache(requestObject.getString(JSONRequest.KEY_CACHE));
402402

403403
requestObject.remove(JSONRequest.KEY_FORMAT);
404404
requestObject.remove(JSONRequest.KEY_DATABASE);
@@ -435,7 +435,7 @@ public JSONObject parseResponse(JSONObject request) {
435435

436436
requestObject = error == null ? extendSuccessResult(requestObject, isRoot) : extendErrorResult(requestObject, error, requestMethod, getRequestURL(), isRoot);
437437

438-
JSONObject res = (globleFormat != null && globleFormat) && JSONResponse.isSuccess(requestObject) ? new JSONResponse(requestObject) : requestObject;
438+
JSONObject res = (globalFormat != null && globalFormat) && JSONResponse.isSuccess(requestObject) ? new JSONResponse(requestObject) : requestObject;
439439

440440
long endTime = System.currentTimeMillis();
441441
long duration = endTime - startTime;
@@ -493,8 +493,8 @@ public void onVerifyRole(@NotNull SQLConfig config) throws Exception {
493493

494494
if (isNeedVerifyRole()) {
495495
if (config.getRole() == null) {
496-
if (globleRole != null) {
497-
config.setRole(globleRole);
496+
if (globalRole != null) {
497+
config.setRole(globalRole);
498498
} else {
499499
config.setRole(getVisitor().getId() == null ? AbstractVerifier.UNKNOWN : AbstractVerifier.LOGIN);
500500
}
@@ -548,7 +548,7 @@ public JSONObject parseCorrectRequest(RequestMethod method, String tag, int vers
548548
JSONObject target = wrapRequest(method, tag, object, true);
549549

550550
//JSONObject clone 浅拷贝没用,Structure.parse 会导致 structure 里面被清空,第二次从缓存里取到的就是 {}
551-
return getVerifier().verifyRequest(method, name, target, request, maxUpdateCount, getGlobleDatabase(), getGlobleSchema(), creator);
551+
return getVerifier().verifyRequest(method, name, target, request, maxUpdateCount, getGlobalDatabase(), getGlobalSchema(), creator);
552552
}
553553

554554

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,13 @@ JSONObject parseCorrectRequest(RequestMethod method, String tag, int version, St
118118
Verifier<T> getVerifier();
119119

120120

121-
Boolean getGlobleFormat();
122-
String getGlobleRole();
123-
String getGlobleDatabase();
124-
String getGlobleSchema();
125-
String getGlobleDatasource();
126-
Boolean getGlobleExplain();
127-
String getGlobleCache();
121+
Boolean getGlobalFormat();
122+
String getGlobalRole();
123+
String getGlobalDatabase();
124+
String getGlobalSchema();
125+
String getGlobalDatasource();
126+
Boolean getGlobalExplain();
127+
String getGlobalCache();
128128

129129

130130
int getTransactionIsolation();

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public interface Verifier<T> {
7474
* @throws Exception
7575
*/
7676
JSONObject verifyRequest(RequestMethod method, String name, JSONObject target, JSONObject request,
77-
int maxUpdateCount, String globleDatabase, String globleSchema, SQLCreator creator) throws Exception;
77+
int maxUpdateCount, String globalDatabase, String globalSchema, SQLCreator creator) throws Exception;
7878

7979
/**验证返回结果的数据和结构
8080
* @param table

0 commit comments

Comments
 (0)