腾讯 APIJSON 8.0.0+ 的 fastjson2 插件,简化使用。
A fastjson2 plugin for Tencent APIJSON 8.0.0+.
<repositories> <repository> <id>jitpack.io</id> <url>https://jitpack.io</url> </repository> </repositories>
<dependency> <groupId>com.github.APIJSON</groupId> <artifactId>apijson-fastjson2</artifactId> <version>LATEST</version> </dependency>1. 在项目根目录 build.gradle 中最后添加 JitPack 仓库 1. Add the JitPack repository in your root build.gradle at the end of repositories
allprojects { repositories { maven { url 'https://jitpack.io' } } }
app
) build.gradle 中添加 apijson-fastjson2 依赖 2. Add the apijson-fastjson2 dependency in one of your modules(such as app
)
dependencies { implementation 'com.github.APIJSON:apijson-fastjson2:latest' }1.把所有 apijson.framework 中的解析类都替换成 apijson.fastjson2 的 1.Replace all apijson.framework classes to that of apijson.fastjson2 what have same names
import apijson.fastjson2.APIJSONApplication; // apijson.framework.APIJSONApplication; public class DemoApplication { public static void main(String[] args) { // ... APIJSONApplication.init(); // ... } }
import apijson.fastjson2.APIJSONController; // apijson.framework.APIJSONController; public class DemoController extends APIJSONController<Long> { // apijson.framework.APIJSONController<Long, JSONObject, JSONArray> }
import apijson.fastjson2.APIJSONParser; // apijson.framework.APIJSONParser; public class DemoParser extends APIJSONParser<Long> { // apijson.framework.APIJSONParser<Long, JSONObject, JSONArray> }
import apijson.fastjson2.APIJSONObjectParser; // apijson.framework.APIJSONObjectParser; public class DemoParser extends APIJSONObjectParser<Long> { // apijson.framework.APIJSONObjectParser<Long, JSONObject, JSONArray> }
import apijson.fastjson2.APIJSONFunctionParser; // apijson.framework.APIJSONFunctionParser; public class DemoParser extends APIJSONFunctionParser<Long> { // apijson.framework.APIJSONFunctionParser<Long, JSONObject, JSONArray> }
import apijson.fastjson2.APIJSONVerifier; // apijson.framework.APIJSONVerifier; public class DemoParser extends APIJSONVerifier<Long> { // apijson.framework.APIJSONVerifier<Long, JSONObject, JSONArray> }
import apijson.fastjson2.APIJSONSQLConfig; // apijson.framework.APIJSONSQLConfig; public class DemoSQLConfig extends APIJSONSQLConfig<Long> { // apijson.framework.APIJSONSQLConfig<Long, JSONObject, JSONArray> }
import apijson.fastjson2.APIJSONSQLExecutor; // apijson.framework.APIJSONSQLExecutor; public class DemoSQLExecutor extends APIJSONSQLExecutor<Long> { // apijson.framework.APIJSONSQLExecutor<Long, JSONObject, JSONArray> }
...
参考 APIJSONController 的注释及 APIJSONBoot 的 DemoController 和 DemoApplication
See document in APIJSONController and DemoController, DemoApplication in APIJSONBoot
有问题可以去 Tencent/APIJSON 提 issue
https://github.com/APIJSON/apijson-fastjson2
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4