Skip to content

Commit

Permalink
SQLConfig 内把所有 AbstractSQLConfig 改成 SQLConfig;优化 Verifier 的注释
Browse files Browse the repository at this point in the history
  • Loading branch information
TommyLemon committed Dec 10, 2023
1 parent c085ab5 commit 886099f
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 18 deletions.
10 changes: 5 additions & 5 deletions APIJSONORM/src/main/java/apijson/orm/SQLConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,19 +50,19 @@ public interface SQLConfig<T extends Object> {

Parser<T> getParser();

AbstractSQLConfig setParser(Parser<T> parser);
SQLConfig setParser(Parser<T> parser);

ObjectParser getObjectParser();

AbstractSQLConfig setObjectParser(ObjectParser objectParser);
SQLConfig setObjectParser(ObjectParser objectParser);

int getVersion();

AbstractSQLConfig setVersion(int version);
SQLConfig setVersion(int version);

String getTag();

AbstractSQLConfig setTag(String tag);
SQLConfig setTag(String tag);

boolean isMySQL();
boolean isPostgreSQL();
Expand Down Expand Up @@ -243,7 +243,7 @@ default int[] getDBVersionNums() {
String getTablePath();

Map<String, String> getKeyMap();
AbstractSQLConfig setKeyMap(Map<String, String> keyMap);
SQLConfig setKeyMap(Map<String, String> keyMap);

List<String> getRaw();
SQLConfig setRaw(List<String> raw);
Expand Down
35 changes: 22 additions & 13 deletions APIJSONORM/src/main/java/apijson/orm/Verifier.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ public interface Verifier<T> {

/**验证权限是否通过
* @param config
* @param visitor
* @return
* @throws Exception
*/
Expand All @@ -37,12 +36,10 @@ public interface Verifier<T> {
void verifyRole(SQLConfig config, String table, RequestMethod method, String role) throws Exception;

/**登录校验
* @param config
* @throws Exception
*/
void verifyLogin() throws Exception;
/**管理员角色校验
* @param config
* @throws Exception
*/
void verifyAdmin() throws Exception;
Expand All @@ -67,24 +64,36 @@ public interface Verifier<T> {
void verifyRepeat(String table, String key, Object value, long exceptId) throws Exception;

/**验证请求参数的数据和结构
* @param table
* @param key
* @param value
* @param exceptId 不包含id
* @param method
* @param name
* @param target
* @param request
* @param maxUpdateCount
* @param globalDatabase
* @param globalSchema
* @param creator
* @return
* @throws Exception
*/
JSONObject verifyRequest(RequestMethod method, String name, JSONObject target, JSONObject request,
int maxUpdateCount, String globalDatabase, String globalSchema, SQLCreator creator) throws Exception;

/**验证返回结果的数据和结构
* @param table
* @param key
* @param value
* @param exceptId 不包含id
* @param method
* @param name
* @param target
* @param response
* @param database
* @param schema
* @param creator
* @param callback
* @return
* @throws Exception
*/
JSONObject verifyResponse(RequestMethod method, String name, JSONObject target, JSONObject response,
String database, String schema, SQLCreator creator, OnParseCallback callback) throws Exception;
JSONObject verifyResponse(
RequestMethod method, String name, JSONObject target, JSONObject response,
String database, String schema, SQLCreator creator, OnParseCallback callback
) throws Exception;


@NotNull
Expand Down

0 comments on commit 886099f

Please sign in to comment.