« Back to Search  |  Reader Mode  |  Switch to Full Retro Site View Links: Stay in Reader  |  Retro Mode: ON  |  Original »
GitHub · Extracted in 704 ms

GitHub - APIJSON/apijson-gson: APIJSON 的 gson 插件,简化使用。A gson plugin for APIJSON.

Source: https://github.com/APIJSON/apijson-gson

Repository navigation

apijson-gson
Public

About

APIJSON 的 gson 插件,简化使用。A gson plugin for APIJSON.

github.com/APIJSON/APIJSON

Topics

apijson gson gson-adapter gson-converter gson-library gson-plugin gson2 json json-parser

Resources

Readme Apache-2.0 license Activity Custom properties

Stars

1 star

Watchers

0 watching

Forks

0 forks Report repository
Branches

Tags
Go to Branches page Go to Tags page

Latest commit

 

History


13 Commits
View commit history for this file.

Folders and files

Name Name Last commit message Last commit date
.github/ workflows .github/ workflows    
src/ main/ java/ apijson/ gson src/ main/ java/ apijson/ gson    
.gitignore .gitignore    
LICENSE LICENSE    
README.md README.md    
pom.xml pom.xml    

Repository files navigation

apijson-gson

APIJSON 8.0.2+ 的 gson 插件,简化使用。
A gson plugin for APIJSON 8.0.2+.

添加依赖

Add Dependency

Maven

1. 在 pom.xml 中添加 JitPack 仓库

1. Add the JitPack repository to pom.xml

	<repositories>
		<repository>
		    <id>jitpack.io</id>
		    <url>https://jitpack.io</url>
		</repository>
	</repositories>

2. 在 pom.xml 中添加 apijson-gson 依赖

2. Add the apijson-gson dependency to pom.xml

	<dependency>
	    <groupId>com.github.APIJSON</groupId>
	    <artifactId>apijson-gson</artifactId>
	    <version>LATEST</version>
	</dependency>


Gradle

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' }
		}
	}

2. 在项目某个 module 目录(例如 app) build.gradle 中添加 apijson-gson 依赖

2. Add the apijson-gson dependency in one of your modules(such as app)

	dependencies {
	        implementation 'com.github.APIJSON:apijson-gson:latest'
	}


初始化

Initialization

1.把所有 apijson.framework 中的解析类都替换成 apijson.gson 的

1.Replace all apijson.framework classes to that of apijson.gson what have same names

import apijson.gson.APIJSONApplication; // apijson.framework.APIJSONApplication;

public class DemoApplication {
    public static void main(String[] args) {
        // ...
        APIJSONApplication.init();
        // ...
    }
}
import apijson.gson.APIJSONController; // apijson.framework.APIJSONController;

public class DemoController extends APIJSONController<Long> { // apijson.framework.APIJSONController<Long, Map<String, Object>, List<Object>>
}
import apijson.gson.APIJSONParser; // apijson.framework.APIJSONParser;

public class DemoParser extends APIJSONParser<Long> { // apijson.framework.APIJSONParser<Long, Map<String, Object>, List<Object>>
}
import apijson.gson.APIJSONObjectParser; // apijson.framework.APIJSONObjectParser;

public class DemoParser extends APIJSONObjectParser<Long> { // apijson.framework.APIJSONObjectParser<Long, Map<String, Object>, List<Object>>
}
import apijson.gson.APIJSONFunctionParser; // apijson.framework.APIJSONFunctionParser;

public class DemoParser extends APIJSONFunctionParser<Long> { // apijson.framework.APIJSONFunctionParser<Long, Map<String, Object>, List<Object>>
}
import apijson.gson.APIJSONVerifier; // apijson.framework.APIJSONVerifier;

public class DemoParser extends APIJSONVerifier<Long> { // apijson.framework.APIJSONVerifier<Long, Map<String, Object>, List<Object>>
}
import apijson.gson.APIJSONSQLConfig; // apijson.framework.APIJSONSQLConfig;

public class DemoSQLConfig extends APIJSONSQLConfig<Long> { // apijson.framework.APIJSONSQLConfig<Long, Map<String, Object>, List<Object>>
}
import apijson.gson.APIJSONSQLExecutor; // apijson.framework.APIJSONSQLExecutor;

public class DemoSQLExecutor extends APIJSONSQLExecutor<Long> { // apijson.framework.APIJSONSQLExecutor<Long, Map<String, Object>, List<Object>>
}

...


参考 APIJSONController 的注释及 APIJSONBoot 的 DemoController 和 DemoApplication

See document in APIJSONController and DemoController , DemoApplication in APIJSONBoot



有问题可以去 APIJSON/APIJSON 提 issue
APIJSON/APIJSON#36



创作不易、坚持更难,点亮右上角 ⭐ Star 收藏/支持下吧,谢谢 ^_^

Please ⭐ Star this project ^_^

https://github.com/APIJSON/apijson-gson

About

APIJSON 的 gson 插件,简化使用。A gson plugin for APIJSON.

github.com/APIJSON/APIJSON

Topics

apijson gson gson-adapter gson-converter gson-library gson-plugin gson2 json json-parser

Resources

Readme Apache-2.0 license Activity Custom properties

Stars

1 star

Watchers

0 watching

Forks

0 forks Report repository

Releases

Packages

Contributors

Languages