GeezerVison is showing github.com — Java:APIJSONFinal 升级 APIJSON, apijson-framework, apijson-column 的 jar… · lfmeng/APIJSON-Demo@2d28ea7
File tree
Expand file treeCollapse file tree
Open diff view settings
APIJSON-Java-Server/APIJSONFinal
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboard Collapse file
Copy file name to clipboard Collapse file
Copy file name to clipboard Collapse file
Copy file name to clipboard Collapse file
Copy file name to clipboardExpand all lines: APIJSON-Java-Server/APIJSONFinal/pom.xml +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
23 | 23 | </dependency> |
24 | 24 |
|
25 | 25 | <!-- 可使用 libs 目录的 apijson-orm.jar 和 apijson-framework.jar 来替代,两种方式二选一 <<<<<<<<<< --> |
26 | | - <dependency> |
| 26 | + <!-- <dependency> |
27 | 27 | <groupId>com.github.Tencent</groupId> |
28 | 28 | <artifactId>APIJSON</artifactId> |
29 | 29 | <version>4.7.2</version> |
|
32 | 32 | <groupId>com.github.APIJSON</groupId> |
33 | 33 | <artifactId>apijson-framework</artifactId> |
34 | 34 | <version>4.7.2</version> |
35 | | - </dependency> |
| 35 | + </dependency> --> |
36 | 36 | <!-- 可使用 libs 目录的 apijson-orm.jar 和 apijson-framework.jar 来替代,两种方式二选一 >>>>>>>>>> --> |
37 | 37 |
|
38 | 38 | <!-- 需要用的数据库 JDBC 驱动 --> |
|
Collapse file
Copy file name to clipboardExpand all lines: APIJSON-Java-Server/APIJSONFinal/src/main/java/apijson/demo/DemoFunctionParser.java +5-6Lines changed: 5 additions & 6 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
14 | 14 |
|
15 | 15 | package apijson.demo; |
16 | 16 |
|
17 | | -import com.alibaba.fastjson.JSONArray; |
18 | | -import com.alibaba.fastjson.JSONObject; |
19 | | - |
20 | 17 | import java.util.ArrayList; |
21 | 18 | import java.util.Arrays; |
22 | 19 | import java.util.Collection; |
23 | 20 |
|
24 | 21 | import javax.servlet.http.HttpSession; |
25 | 22 |
|
| 23 | +import com.alibaba.fastjson.JSONArray; |
| 24 | +import com.alibaba.fastjson.JSONObject; |
| 25 | + |
26 | 26 | import apijson.JSONResponse; |
27 | 27 | import apijson.NotNull; |
28 | 28 | import apijson.RequestMethod; |
29 | | -import apijson.RequestRole; |
30 | 29 | import apijson.StringUtil; |
31 | 30 | import apijson.framework.APIJSONFunctionParser; |
32 | 31 | import apijson.orm.JSONRequest; |
@@ -212,8 +211,8 @@ public JSONArray getIdList(@NotNull JSONObject current) { |
212 | 211 | */ |
213 | 212 | public Object verifyAccess(@NotNull JSONObject current) throws Exception { |
214 | 213 | long userId = current.getLongValue(JSONRequest.KEY_USER_ID); |
215 | | - RequestRole role = RequestRole.get(current.getString(JSONRequest.KEY_ROLE)); |
216 | | - if (role == RequestRole.OWNER && userId != DemoVerifier.getVisitorId(getSession())) { |
| 214 | + String role = current.getString(JSONRequest.KEY_ROLE); |
| 215 | + if (role == apijson.orm.AbstractVerifier.OWNER && userId != DemoVerifier.getVisitorId(getSession())) { |
217 | 216 | throw new IllegalAccessException("登录用户与角色OWNER不匹配!"); |
218 | 217 | } |
219 | 218 | return null; |
|
Collapse file
Copy file name to clipboardExpand all lines: APIJSON-Java-Server/APIJSONFinal/src/main/java/apijson/demo/DemoSQLConfig.java +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -70,7 +70,7 @@ public AbstractSQLConfig getSQLConfig(RequestMethod method, String database, Str |
70 | 70 | // } |
71 | 71 |
|
72 | 72 | @Override |
73 | | - public String getUserIdKey(String database, String schema, String table) { |
| 73 | + public String getUserIdKey(String database, String schema, String datasource, String table) { |
74 | 74 | return USER_.equals(table) || PRIVACY_.equals(table) ? ID : USER_ID; // id / userId |
75 | 75 | } |
76 | 76 |
|
|
Collapse file
Copy file name to clipboardExpand all lines: APIJSON-Java-Server/APIJSONFinal/src/main/java/apijson/demo/model/Privacy.java +3-3Lines changed: 3 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
14 | 14 |
|
15 | 15 | package apijson.demo.model; |
16 | 16 |
|
17 | | -import static apijson.RequestRole.ADMIN; |
18 | | -import static apijson.RequestRole.OWNER; |
19 | | -import static apijson.RequestRole.UNKNOWN; |
| 17 | +import static apijson.orm.AbstractVerifier.ADMIN; |
| 18 | +import static apijson.orm.AbstractVerifier.OWNER; |
| 19 | +import static apijson.orm.AbstractVerifier.UNKNOWN; |
20 | 20 |
|
21 | 21 | import com.alibaba.fastjson.annotation.JSONField; |
22 | 22 |
|
|
Collapse file
Copy file name to clipboardExpand all lines: APIJSON-Java-Server/APIJSONFinal/src/main/java/apijson/demo/model/User.java +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
14 | 14 |
|
15 | 15 | package apijson.demo.model; |
16 | 16 |
|
17 | | -import static apijson.RequestRole.ADMIN; |
18 | | -import static apijson.RequestRole.UNKNOWN; |
| 17 | +import static apijson.orm.AbstractVerifier.ADMIN; |
| 18 | +import static apijson.orm.AbstractVerifier.UNKNOWN; |
19 | 19 |
|
20 | 20 | import java.util.List; |
21 | 21 |
|
|
Collapse file
Copy file name to clipboardExpand all lines: APIJSON-Java-Server/APIJSONFinal/src/main/java/apijson/demo/model/Verify.java +6-6Lines changed: 6 additions & 6 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
14 | 14 |
|
15 | 15 | package apijson.demo.model; |
16 | 16 |
|
17 | | -import static apijson.RequestRole.ADMIN; |
18 | | -import static apijson.RequestRole.CIRCLE; |
19 | | -import static apijson.RequestRole.CONTACT; |
20 | | -import static apijson.RequestRole.LOGIN; |
21 | | -import static apijson.RequestRole.OWNER; |
22 | | -import static apijson.RequestRole.UNKNOWN; |
| 17 | +import static apijson.orm.AbstractVerifier.ADMIN; |
| 18 | +import static apijson.orm.AbstractVerifier.CIRCLE; |
| 19 | +import static apijson.orm.AbstractVerifier.CONTACT; |
| 20 | +import static apijson.orm.AbstractVerifier.LOGIN; |
| 21 | +import static apijson.orm.AbstractVerifier.OWNER; |
| 22 | +import static apijson.orm.AbstractVerifier.UNKNOWN; |
23 | 23 |
|
24 | 24 | import apijson.MethodAccess; |
25 | 25 | import apijson.framework.BaseModel; |
|