Skip to content

Commit da12c0d

Browse files
committed
初始化提交
1 parent cb8e97a commit da12c0d

34 files changed

+2769
-20
lines changed

.gitignore

Lines changed: 34 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,39 @@
1-
# Compiled class file
2-
*.class
1+
HELP.md
2+
.gradle
3+
build/
4+
target/
35

4-
# Log file
5-
*.log
6+
!gradle/wrapper/gradle-wrapper.jar
7+
!**/src/main/**/build/
8+
!**/src/test/**/build/
69

7-
# BlueJ files
8-
*.ctxt
10+
### STS ###
11+
.apt_generated
12+
.classpath
13+
.factorypath
14+
.project
15+
.settings
16+
.springBeans
17+
.sts4-cache
18+
bin/
19+
!**/src/main/**/bin/
20+
!**/src/test/**/bin/
921

10-
# Mobile Tools for Java (J2ME)
11-
.mtj.tmp/
22+
### IntelliJ IDEA ###
23+
.idea
24+
*.iws
25+
*.iml
26+
*.ipr
27+
out/
28+
!**/src/main/**/out/
29+
!**/src/test/**/out/
1230

13-
# Package Files #
14-
*.jar
15-
*.war
16-
*.nar
17-
*.ear
18-
*.zip
19-
*.tar.gz
20-
*.rar
31+
### NetBeans ###
32+
/nbproject/private/
33+
/nbbuild/
34+
/dist/
35+
/nbdist/
36+
/.nb-gradle/
2137

22-
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
23-
hs_err_pid*
24-
replay_pid*
38+
### VS Code ###
39+
.vscode/

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
same "printed page" as the copyright notice for easier
187187
identification within third-party archives.
188188

189-
Copyright [yyyy] [name of copyright owner]
189+
Copyright ©2025 APIJSON(https://github.com/APIJSON)
190190

191191
Licensed under the Apache License, Version 2.0 (the "License");
192192
you may not use this file except in compliance with the License.

README.md

Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
# apijson-jackson [![](https://jitpack.io/v/APIJSON/apijson-jackson.svg)](https://jitpack.io/#APIJSON/apijson-jackson)
2+
腾讯 [APIJSON](https://github.com/Tencent/APIJSON) 8.0.2+ 的 jackson 插件,简化使用。<br />
3+
A jackson plugin for Tencent [APIJSON](https://github.com/Tencent/APIJSON) 8.0.2+.<br />
4+
5+
6+
## 添加依赖
7+
## Add Dependency
8+
9+
### Maven
10+
#### 1. 在 pom.xml 中添加 JitPack 仓库
11+
#### 1. Add the JitPack repository to pom.xml
12+
```xml
13+
<repositories>
14+
<repository>
15+
<id>jitpack.io</id>
16+
<url>https://jitpack.io</url>
17+
</repository>
18+
</repositories>
19+
```
20+
21+
![image](https://user-images.githubusercontent.com/5738175/167263399-339dad4f-2884-461e-9781-f2de6d100340.png)
22+
23+
<br />
24+
25+
#### 2. 在 pom.xml 中添加 apijson-jackson 依赖
26+
#### 2. Add the apijson-jackson dependency to pom.xml
27+
```xml
28+
<dependency>
29+
<groupId>com.github.APIJSON</groupId>
30+
<artifactId>apijson-jackson</artifactId>
31+
<version>LATEST</version>
32+
</dependency>
33+
```
34+
35+
36+
<br />
37+
<br />
38+
39+
### Gradle
40+
#### 1. 在项目根目录 build.gradle 中最后添加 JitPack 仓库
41+
#### 1. Add the JitPack repository in your root build.gradle at the end of repositories
42+
```gradle
43+
allprojects {
44+
repositories {
45+
maven { url 'https://jitpack.io' }
46+
}
47+
}
48+
```
49+
<br />
50+
51+
#### 2. 在项目某个 module 目录(例如 `app`) build.gradle 中添加 apijson-jackson 依赖
52+
#### 2. Add the apijson-jackson dependency in one of your modules(such as `app`)
53+
```gradle
54+
dependencies {
55+
implementation 'com.github.APIJSON:apijson-jackson:latest'
56+
}
57+
```
58+
59+
<br />
60+
<br />
61+
62+
## 初始化
63+
## Initialization
64+
65+
#### 1.把所有 apijson.framework 中的解析类都替换成 apijson.jackson 的
66+
#### 1.Replace all apijson.framework classes to that of apijson.jackson what have same names
67+
68+
```java
69+
import apijson.jackson.APIJSONApplication; // apijson.framework.APIJSONApplication;
70+
71+
public class DemoApplication {
72+
public static void main(String[] args) {
73+
// ...
74+
APIJSONApplication.init();
75+
// ...
76+
}
77+
}
78+
```
79+
80+
```java
81+
import apijson.jackson.APIJSONController; // apijson.framework.APIJSONController;
82+
83+
public class DemoController extends APIJSONController<Long> { // apijson.framework.APIJSONController<Long, Map<String, Object>, List<Object>>
84+
}
85+
```
86+
87+
```java
88+
import apijson.jackson.APIJSONParser; // apijson.framework.APIJSONParser;
89+
90+
public class DemoParser extends APIJSONParser<Long> { // apijson.framework.APIJSONParser<Long, Map<String, Object>, List<Object>>
91+
}
92+
```
93+
94+
```java
95+
import apijson.jackson.APIJSONObjectParser; // apijson.framework.APIJSONObjectParser;
96+
97+
public class DemoParser extends APIJSONObjectParser<Long> { // apijson.framework.APIJSONObjectParser<Long, Map<String, Object>, List<Object>>
98+
}
99+
```
100+
101+
```java
102+
import apijson.jackson.APIJSONFunctionParser; // apijson.framework.APIJSONFunctionParser;
103+
104+
public class DemoParser extends APIJSONFunctionParser<Long> { // apijson.framework.APIJSONFunctionParser<Long, Map<String, Object>, List<Object>>
105+
}
106+
```
107+
108+
```java
109+
import apijson.jackson.APIJSONVerifier; // apijson.framework.APIJSONVerifier;
110+
111+
public class DemoParser extends APIJSONVerifier<Long> { // apijson.framework.APIJSONVerifier<Long, Map<String, Object>, List<Object>>
112+
}
113+
```
114+
115+
```java
116+
import apijson.jackson.APIJSONSQLConfig; // apijson.framework.APIJSONSQLConfig;
117+
118+
public class DemoSQLConfig extends APIJSONSQLConfig<Long> { // apijson.framework.APIJSONSQLConfig<Long, Map<String, Object>, List<Object>>
119+
}
120+
```
121+
122+
```java
123+
import apijson.jackson.APIJSONSQLExecutor; // apijson.framework.APIJSONSQLExecutor;
124+
125+
public class DemoSQLExecutor extends APIJSONSQLExecutor<Long> { // apijson.framework.APIJSONSQLExecutor<Long, Map<String, Object>, List<Object>>
126+
}
127+
```
128+
129+
...
130+
131+
<br />
132+
133+
134+
参考 [APIJSONController](/apijson/jackson/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) <br />
135+
136+
See document in [APIJSONController](/apijson/jackson/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)
137+
138+
<br />
139+
140+
<br />
141+
有问题可以去 Tencent/APIJSON 提 issue <br />
142+
https://github.com/Tencent/APIJSON/issues/36
143+
144+
<br /><br />
145+
146+
#### 点右上角 ⭐Star 支持一下,谢谢 ^_^
147+
#### Please ⭐Star this project ^_^
148+
https://github.com/APIJSON/apijson-jackson

pom.xml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4+
<modelVersion>4.0.0</modelVersion>
5+
6+
<groupId>apijson.jackson</groupId>
7+
<artifactId>apijson-jackson</artifactId>
8+
<version>1.0.0</version>
9+
<packaging>jar</packaging>
10+
11+
<name>apijson-jackson</name>
12+
<description>APIJSON plugin with Jackson to simplify the use of APIJSON</description>
13+
14+
<properties>
15+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
16+
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
17+
<java.version>1.8</java.version>
18+
<maven.compiler.encoding>UTF-8</maven.compiler.encoding>
19+
</properties>
20+
21+
<dependencies>
22+
<!-- JDK 17+, SpringBoot 3.0+ -->
23+
<dependency>
24+
<groupId>jakarta.servlet</groupId>
25+
<artifactId>jakarta.servlet-api</artifactId>
26+
<version>5.0.0</version>
27+
<scope>provided</scope>
28+
</dependency>
29+
30+
<!-- JDK 1.8~16, SpringBoot 1.4~2.7 -->
31+
<dependency>
32+
<groupId>javax.servlet</groupId>
33+
<artifactId>javax.servlet-api</artifactId>
34+
<version>4.0.1</version>
35+
<scope>provided</scope>
36+
</dependency>
37+
38+
<!-- 可使用 libs 目录的 apijson-orm.jar 来替代,两种方式二选一 -->
39+
<dependency>
40+
<groupId>com.github.Tencent</groupId>
41+
<artifactId>APIJSON</artifactId>
42+
<version>8.0.2</version>
43+
</dependency>
44+
<dependency>
45+
<groupId>com.github.APIJSON</groupId>
46+
<artifactId>apijson-framework</artifactId>
47+
<version>7.2.2</version>
48+
</dependency>
49+
<dependency>
50+
<groupId>com.fasterxml.jackson.core</groupId>
51+
<artifactId>jackson-databind</artifactId>
52+
<version>2.20.0</version>
53+
</dependency>
54+
</dependencies>
55+
56+
<build>
57+
<plugins>
58+
<plugin>
59+
<groupId>org.apache.maven.plugins</groupId>
60+
<artifactId>maven-compiler-plugin</artifactId>
61+
<version>3.12.1</version>
62+
<configuration>
63+
<source>1.8</source>
64+
<target>1.8</target>
65+
</configuration>
66+
</plugin>
67+
</plugins>
68+
</build>
69+
70+
<repositories>
71+
<!-- APIJSON 必须用到的托管平台 -->
72+
<repository>
73+
<id>jitpack.io</id>
74+
<url>https://jitpack.io</url>
75+
</repository>
76+
</repositories>
77+
78+
</project>

0 commit comments

Comments
 (0)