# apijson-fastjson2 **Repository Path**: APIJSON/apijson-fastjson2 ## Basic Information - **Project Name**: apijson-fastjson2 - **Description**: 腾讯 APIJSON 的 fastjson2 插件,简化使用 - **Primary Language**: Java - **License**: Apache-2.0 - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2025-04-20 - **Last Updated**: 2025-04-21 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # apijson-fastjson2 [![](https://jitpack.io/v/APIJSON/apijson-fastjson2.svg)](https://jitpack.io/#APIJSON/apijson-fastjson2) 腾讯 [APIJSON](https://github.com/Tencent/APIJSON) 8.0.0+ 的 fastjson2 插件,简化使用。
A fastjson2 plugin for Tencent [APIJSON](https://github.com/Tencent/APIJSON) 8.0.0+.
## 添加依赖 ## Add Dependency ### Maven #### 1. 在 pom.xml 中添加 JitPack 仓库 #### 1. Add the JitPack repository to pom.xml ```xml jitpack.io https://jitpack.io ``` ![image](https://user-images.githubusercontent.com/5738175/167263399-339dad4f-2884-461e-9781-f2de6d100340.png)
#### 2. 在 pom.xml 中添加 apijson-fastjson2 依赖 #### 2. Add the apijson-fastjson2 dependency to pom.xml ```xml com.github.APIJSON apijson-fastjson2 LATEST ```

### Gradle #### 1. 在项目根目录 build.gradle 中最后添加 JitPack 仓库 #### 1. Add the JitPack repository in your root build.gradle at the end of repositories ```gradle allprojects { repositories { maven { url 'https://jitpack.io' } } } ```
#### 2. 在项目某个 module 目录(例如 `app`) build.gradle 中添加 apijson-fastjson2 依赖 #### 2. Add the apijson-fastjson2 dependency in one of your modules(such as `app`) ```gradle dependencies { implementation 'com.github.APIJSON:apijson-fastjson2:latest' } ```

## 初始化 ## Initialization #### 1.把所有 apijson.framework 中的解析类都替换成 apijson.fastjson2 的 #### 1.Replace all apijson.framework classes to that of apijson.fastjson2 what have same names ```java import apijson.fastjson2.APIJSONApplication; // apijson.framework.APIJSONApplication; public class DemoApplication { public static void main(String[] args) { // ... APIJSONApplication.init(); // ... } } ``` ```java import apijson.fastjson2.APIJSONController; // apijson.framework.APIJSONController; public class DemoController extends APIJSONController { // apijson.framework.APIJSONController } ``` ```java import apijson.fastjson2.APIJSONParser; // apijson.framework.APIJSONParser; public class DemoParser extends APIJSONParser { // apijson.framework.APIJSONParser } ``` ```java import apijson.fastjson2.APIJSONObjectParser; // apijson.framework.APIJSONObjectParser; public class DemoParser extends APIJSONObjectParser { // apijson.framework.APIJSONObjectParser } ``` ```java import apijson.fastjson2.APIJSONFunctionParser; // apijson.framework.APIJSONFunctionParser; public class DemoParser extends APIJSONFunctionParser { // apijson.framework.APIJSONFunctionParser } ``` ```java import apijson.fastjson2.APIJSONVerifier; // apijson.framework.APIJSONVerifier; public class DemoParser extends APIJSONVerifier { // apijson.framework.APIJSONVerifier } ``` ```java import apijson.fastjson2.APIJSONSQLConfig; // apijson.framework.APIJSONSQLConfig; public class DemoSQLConfig extends APIJSONSQLConfig { // apijson.framework.APIJSONSQLConfig } ``` ```java import apijson.fastjson2.APIJSONSQLExecutor; // apijson.framework.APIJSONSQLExecutor; public class DemoSQLExecutor extends APIJSONSQLExecutor { // apijson.framework.APIJSONSQLExecutor } ``` ...
参考 [APIJSONController](/src/main/java/apijson/fastjson2/APIJSONController.java) 的注释及 [APIJSONBoot](https://github.com/APIJSON/APIJSON-Demo/blob/master/APIJSON-Java-Server/APIJSONBoot) 的 [DemoController](https://github.com/APIJSON/APIJSON-Demo/blob/master/APIJSON-Java-Server/APIJSONBoot/src/main/java/apijson/boot/DemoController.java) 和 [DemoApplication](https://github.com/APIJSON/APIJSON-Demo/blob/master/APIJSON-Java-Server/APIJSONBoot/src/main/java/apijson/boot/DemoApplication.java)
See document in [APIJSONController](/src/main/java/apijson/fastjson2/APIJSONController.java) and [DemoController](https://github.com/APIJSON/APIJSON-Demo/blob/master/APIJSON-Java-Server/APIJSONBoot/src/main/java/apijson/boot/DemoController.java), [DemoApplication](https://github.com/APIJSON/APIJSON-Demo/blob/master/APIJSON-Java-Server/APIJSONBoot/src/main/java/apijson/boot/DemoApplication.java) in [APIJSONBoot](https://github.com/APIJSON/APIJSON-Demo/blob/master/APIJSON-Java-Server/APIJSONBoot)

有问题可以去 Tencent/APIJSON 提 issue
https://github.com/Tencent/APIJSON/issues/36

#### 点右上角 ⭐Star 支持一下,谢谢 ^_^ #### Please ⭐Star this project ^_^ https://github.com/APIJSON/apijson-fastjson2