| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 1e5e587 commit d7c3115
4 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -332,22 +332,22 @@ else if (sqlConfig.isClickHouse()) { | |||
| 332 | 332 | } | |
| 333 | 333 | ||
| 334 | 334 | 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()); | ||
| 337 | 337 | } | |
| 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()); | ||
| 340 | 340 | } | |
| 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()); | ||
| 343 | 343 | } | |
| 344 | 344 | ||
| 345 | 345 | 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()); | ||
| 348 | 348 | } | |
| 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()); | ||
| 351 | 351 | } | |
| 352 | 352 | } | |
| 353 | 353 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -187,69 +187,69 @@ public AbstractParser<T> setRequest(JSONObject request) { | |||
| 187 | 187 | return this; | |
| 188 | 188 | } | |
| 189 | 189 | ||
| 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; | ||
| 193 | 193 | return this; | |
| 194 | 194 | } | |
| 195 | 195 | @Override | |
| 196 | - public Boolean getGlobleFormat() { | ||
| 197 | - return globleFormat; | ||
| 196 | + public Boolean getGlobalFormat() { | ||
| 197 | + return globalFormat; | ||
| 198 | 198 | } | |
| 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; | ||
| 202 | 202 | return this; | |
| 203 | 203 | } | |
| 204 | 204 | @Override | |
| 205 | - public String getGlobleRole() { | ||
| 206 | - return globleRole; | ||
| 205 | + public String getGlobalRole() { | ||
| 206 | + return globalRole; | ||
| 207 | 207 | } | |
| 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; | ||
| 211 | 211 | return this; | |
| 212 | 212 | } | |
| 213 | 213 | @Override | |
| 214 | - public String getGlobleDatabase() { | ||
| 215 | - return globleDatabase; | ||
| 214 | + public String getGlobalDatabase() { | ||
| 215 | + return globalDatabase; | ||
| 216 | 216 | } | |
| 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; | ||
| 220 | 220 | return this; | |
| 221 | 221 | } | |
| 222 | 222 | @Override | |
| 223 | - public String getGlobleSchema() { | ||
| 224 | - return globleSchema; | ||
| 223 | + public String getGlobalSchema() { | ||
| 224 | + return globalSchema; | ||
| 225 | 225 | } | |
| 226 | - protected String globleDatasource; | ||
| 226 | + protected String globalDatasource; | ||
| 227 | 227 | @Override | |
| 228 | - public String getGlobleDatasource() { | ||
| 229 | - return globleDatasource; | ||
| 228 | + public String getGlobalDatasource() { | ||
| 229 | + return globalDatasource; | ||
| 230 | 230 | } | |
| 231 | - public AbstractParser<T> setGlobleDatasource(String globleDatasource) { | ||
| 232 | - this.globleDatasource = globleDatasource; | ||
| 231 | + public AbstractParser<T> setGlobalDatasource(String globalDatasource) { | ||
| 232 | + this.globalDatasource = globalDatasource; | ||
| 233 | 233 | return this; | |
| 234 | 234 | } | |
| 235 | 235 | ||
| 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; | ||
| 239 | 239 | return this; | |
| 240 | 240 | } | |
| 241 | 241 | @Override | |
| 242 | - public Boolean getGlobleExplain() { | ||
| 243 | - return globleExplain; | ||
| 242 | + public Boolean getGlobalExplain() { | ||
| 243 | + return globalExplain; | ||
| 244 | 244 | } | |
| 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; | ||
| 248 | 248 | return this; | |
| 249 | 249 | } | |
| 250 | 250 | @Override | |
| 251 | - public String getGlobleCache() { | ||
| 252 | - return globleCache; | ||
| 251 | + public String getGlobalCache() { | ||
| 252 | + return globalCache; | ||
| 253 | 253 | } | |
| 254 | 254 | ||
| 255 | 255 | @Override | |
@@ -383,22 +383,22 @@ public JSONObject parseResponse(JSONObject request) { | |||
| 383 | 383 | } | |
| 384 | 384 | ||
| 385 | 385 | //必须在parseCorrectRequest后面,因为parseCorrectRequest可能会添加 @role | |
| 386 | - if (isNeedVerifyRole() && globleRole == null) { | ||
| 386 | + if (isNeedVerifyRole() && globalRole == null) { | ||
| 387 | 387 | try { | |
| 388 | - setGlobleRole(requestObject.getString(JSONRequest.KEY_ROLE)); | ||
| 388 | + setGlobalRole(requestObject.getString(JSONRequest.KEY_ROLE)); | ||
| 389 | 389 | requestObject.remove(JSONRequest.KEY_ROLE); | |
| 390 | 390 | } catch (Exception e) { | |
| 391 | 391 | return extendErrorResult(requestObject, e, requestMethod, getRequestURL(), isRoot); | |
| 392 | 392 | } | |
| 393 | 393 | } | |
| 394 | 394 | ||
| 395 | 395 | 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)); | ||
| 402 | 402 | ||
| 403 | 403 | requestObject.remove(JSONRequest.KEY_FORMAT); | |
| 404 | 404 | requestObject.remove(JSONRequest.KEY_DATABASE); | |
@@ -435,7 +435,7 @@ public JSONObject parseResponse(JSONObject request) { | |||
| 435 | 435 | ||
| 436 | 436 | requestObject = error == null ? extendSuccessResult(requestObject, isRoot) : extendErrorResult(requestObject, error, requestMethod, getRequestURL(), isRoot); | |
| 437 | 437 | ||
| 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; | ||
| 439 | 439 | ||
| 440 | 440 | long endTime = System.currentTimeMillis(); | |
| 441 | 441 | long duration = endTime - startTime; | |
@@ -493,8 +493,8 @@ public void onVerifyRole(@NotNull SQLConfig config) throws Exception { | |||
| 493 | 493 | ||
| 494 | 494 | if (isNeedVerifyRole()) { | |
| 495 | 495 | if (config.getRole() == null) { | |
| 496 | - if (globleRole != null) { | ||
| 497 | - config.setRole(globleRole); | ||
| 496 | + if (globalRole != null) { | ||
| 497 | + config.setRole(globalRole); | ||
| 498 | 498 | } else { | |
| 499 | 499 | config.setRole(getVisitor().getId() == null ? AbstractVerifier.UNKNOWN : AbstractVerifier.LOGIN); | |
| 500 | 500 | } | |
@@ -548,7 +548,7 @@ public JSONObject parseCorrectRequest(RequestMethod method, String tag, int vers | |||
| 548 | 548 | JSONObject target = wrapRequest(method, tag, object, true); | |
| 549 | 549 | ||
| 550 | 550 | //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); | ||
| 552 | 552 | } | |
| 553 | 553 | ||
| 554 | 554 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -118,13 +118,13 @@ JSONObject parseCorrectRequest(RequestMethod method, String tag, int version, St | |||
| 118 | 118 | Verifier<T> getVerifier(); | |
| 119 | 119 | ||
| 120 | 120 | ||
| 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(); | ||
| 128 | 128 | ||
| 129 | 129 | ||
| 130 | 130 | int getTransactionIsolation(); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -74,7 +74,7 @@ public interface Verifier<T> { | |||
| 74 | 74 | * @throws Exception | |
| 75 | 75 | */ | |
| 76 | 76 | 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; | ||
| 78 | 78 | ||
| 79 | 79 | /**验证返回结果的数据和结构 | |
| 80 | 80 | * @param table | |
| Back | FazBrowse Home | New Git URL |
0 commit comments