mirror of
https://github.com/yanlongqi/jhinno-openapi-java-sdk.git
synced 2026-03-22 06:15:10 +08:00
Compare commits
13 Commits
release-1.
...
release-1.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
40df7537d1 | ||
|
|
94599f04f0 | ||
|
|
646fb869dc | ||
|
|
1dafc6dac8 | ||
|
|
193e7b4fc2 | ||
|
|
ec7d38f9dc | ||
|
|
dda983c9e8 | ||
|
|
cb765320ab | ||
|
|
2ab5c20fb5 | ||
|
|
51c068c28d | ||
|
|
f3cb13703a | ||
|
|
78ff3feb90 | ||
|
|
1ff758a31a |
5
.gitignore
vendored
5
.gitignore
vendored
@@ -4,10 +4,7 @@ target/
|
||||
!**/src/test/**/target/
|
||||
|
||||
### IntelliJ IDEA ###
|
||||
.idea/modules.xml
|
||||
.idea/jarRepositories.xml
|
||||
.idea/compiler.xml
|
||||
.idea/libraries/
|
||||
/.idea/
|
||||
*.iws
|
||||
*.iml
|
||||
*.ipr
|
||||
|
||||
8
.idea/.gitignore
generated
vendored
8
.idea/.gitignore
generated
vendored
@@ -1,8 +0,0 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
||||
6
.idea/JavaSceneConfigState.xml
generated
6
.idea/JavaSceneConfigState.xml
generated
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="SmartInputSourceJavaSceneConfigState">
|
||||
<option name="customChineseScenes" value="{"capsLockState":false,"code":";ArgsException(errorMessage);setUserNameCn(userNameCn)","enable":true,"languageType":"CHINESE","name":"自定义中文切换","tip":""}" />
|
||||
</component>
|
||||
</project>
|
||||
8
.idea/encodings.xml
generated
8
.idea/encodings.xml
generated
@@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Encoding">
|
||||
<file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/src/main/resources" charset="UTF-8" />
|
||||
<file url="PROJECT" charset="UTF-8" />
|
||||
</component>
|
||||
</project>
|
||||
8
.idea/inspectionProfiles/Project_Default.xml
generated
8
.idea/inspectionProfiles/Project_Default.xml
generated
@@ -1,8 +0,0 @@
|
||||
<component name="InspectionProjectProfileManager">
|
||||
<profile version="1.0">
|
||||
<option name="myName" value="Project Default" />
|
||||
<inspection_tool class="JavadocDeclaration" enabled="true" level="WARNING" enabled_by_default="true">
|
||||
<option name="ADDITIONAL_TAGS" value="date" />
|
||||
</inspection_tool>
|
||||
</profile>
|
||||
</component>
|
||||
13
.idea/misc.xml
generated
13
.idea/misc.xml
generated
@@ -1,13 +0,0 @@
|
||||
<project version="4">
|
||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||
<component name="MavenProjectsManager">
|
||||
<option name="originalFiles">
|
||||
<list>
|
||||
<option value="$PROJECT_DIR$/pom.xml" />
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/out" />
|
||||
</component>
|
||||
</project>
|
||||
124
.idea/uiDesigner.xml
generated
124
.idea/uiDesigner.xml
generated
@@ -1,124 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Palette2">
|
||||
<group name="Swing">
|
||||
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.svg" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
|
||||
</item>
|
||||
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.svg" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
|
||||
</item>
|
||||
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.svg" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
|
||||
</item>
|
||||
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.svg" removable="false" auto-create-binding="false" can-attach-label="true">
|
||||
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
|
||||
</item>
|
||||
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
|
||||
<initial-values>
|
||||
<property name="text" value="Button" />
|
||||
</initial-values>
|
||||
</item>
|
||||
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
|
||||
<initial-values>
|
||||
<property name="text" value="RadioButton" />
|
||||
</initial-values>
|
||||
</item>
|
||||
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
|
||||
<initial-values>
|
||||
<property name="text" value="CheckBox" />
|
||||
</initial-values>
|
||||
</item>
|
||||
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.svg" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
|
||||
<initial-values>
|
||||
<property name="text" value="Label" />
|
||||
</initial-values>
|
||||
</item>
|
||||
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
||||
<preferred-size width="150" height="-1" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
||||
<preferred-size width="150" height="-1" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
||||
<preferred-size width="150" height="-1" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.svg" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.svg" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.svg" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.svg" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
|
||||
<preferred-size width="200" height="200" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.svg" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
|
||||
<preferred-size width="200" height="200" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.svg" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.svg" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
|
||||
</item>
|
||||
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.svg" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
|
||||
<preferred-size width="-1" height="20" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.svg" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
|
||||
</item>
|
||||
</group>
|
||||
</component>
|
||||
</project>
|
||||
6
.idea/vcs.xml
generated
6
.idea/vcs.xml
generated
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
222
README.md
222
README.md
@@ -1,27 +1,31 @@
|
||||
# Jhinno OpenAPI SDK for Java
|
||||
# 1. Jhinno OpenAPI SDK for Java
|
||||
|
||||
针对Java的景行API SDK使Java开发人员能够轻松使用景行API接口。您可以在几分钟内开始通过Maven或jar文件使用它。
|
||||
|
||||
- [仓库地址:https://github.com/yanlongqi/jhinno-openapi-java-sdk](https://github.com/yanlongqi/jhinno-openapi-java-sdk)
|
||||
- [开发文档:https://jhinno-sdk-doc.yuchat.top/apidocs](https://jhinno-sdk-doc.yuchat.top/apidocs)
|
||||
- [最新jar包:jhinno-openapi-java-sdk-1.0.0.jar](https://jhinno-jenkins.yuchat.top/job/jhinno-openapi-java-sdk/lastSuccessfulBuild/artifact/target/jhinno-openapi-java-sdk-1.0.0.jar)
|
||||
- [最新源码包:jhinno-openapi-java-sdk-1.0.0-sources.jar](https://jhinno-jenkins.yuchat.top/job/jhinno-openapi-java-sdk/lastSuccessfulBuild/artifact/target/jhinno-openapi-java-sdk-1.0.0-sources.jar)
|
||||
- [jar包下载:https://github.com/yanlongqi/jhinno-openapi-java-sdk/releases](https://github.com/yanlongqi/jhinno-openapi-java-sdk/releases)
|
||||
|
||||
## 必要条件
|
||||
## 1.1 必要条件
|
||||
|
||||
- Java 1.8 or later
|
||||
- Maven
|
||||
|
||||
## 支持的Appform的版本
|
||||
## 1.2 支持的Appform的版本
|
||||
|
||||
1. JH_Appform_6.0_Release
|
||||
2. JH_Appform_6.0_SP1_Release
|
||||
3. JH_Appform_6.1_Release
|
||||
|
||||
## 安装
|
||||
# 2. 快速开始
|
||||
|
||||
建议在您的项目中使用Jhinno OpenAPI SDK for Java的方法是从Maven中使用它。导入方法如下:
|
||||
## 2.1 SpringBoot
|
||||
|
||||
方法一:通过Maven仓库安装
|
||||
### 2.1.1 安装
|
||||
|
||||
建议在您的项目中使用Jhinno OpenAPI SDK for Java的方法是从Maven中使用它。:
|
||||
|
||||
#### 方法一:通过Maven仓库安装
|
||||
|
||||
> 添加仓库地址(改方案为备用方案,后续会上传至Maven中央仓库,目前不影响正常使用)
|
||||
|
||||
@@ -36,68 +40,204 @@
|
||||
</repositories>
|
||||
```
|
||||
|
||||
添加依赖
|
||||
#### 方法二:通过命令将jar包导入本地Maven仓库
|
||||
|
||||
```shell
|
||||
|
||||
# SDK Client的jar包的导入,其中<path-to-dir>为jar的路径,<path-to-dir>为jar包路径
|
||||
mvn org.apache.maven.plugins:maven-install-plugin:3.1.1:install-file -Dfile="<path-to-dir>/jhinno-openapi-java-sdk-1.0.0.jar" -Dsources="<path-to-dir>/jhinno-openapi-java-sdk-1.0.0-sources.jar"
|
||||
# 例如
|
||||
mvn org.apache.maven.plugins:maven-install-plugin:3.1.1:install-file -Dfile="E:/下载/jhinno-openapi-java-sdk-1.0.0.jar" -Dsources="E:/下载/jhinno-openapi-java-sdk-1.0.0-sources.jar"
|
||||
|
||||
# SDK SpringBoot Starter的jar包的导入,其中<path-to-dir>为jar的路径,<path-to-dir>为jar包路径
|
||||
mvn org.apache.maven.plugins:maven-install-plugin:3.1.1:install-file -Dfile="<path-to-dir>/jhinno-openapi-sdk-spring-boot-starter-x.x.x.jar" -Dsources="<path-to-dir>/jhinno-openapi-sdk-spring-boot-starter-x.x.x-sources.jar"
|
||||
# 例如
|
||||
mvn org.apache.maven.plugins:maven-install-plugin:3.1.1:install-file -Dfile="E:/下载/jhinno-openapi-sdk-spring-boot-starter-1.0.1.jar" -Dsources="E:/下载/jhinno-openapi-sdk-spring-boot-starter-1.0.1-sources.jar"
|
||||
```
|
||||
|
||||
> 注:
|
||||
> - jhinno-openapi-java-sdk-x.x.x.jar 为SDK的jar包。
|
||||
> - jhinno-openapi-java-sdk-x.x.x-sources.jar 为源码包,添加可方便查看SDK代码的注释。
|
||||
> - jhinno-openapi-sdk-spring-boot-starter-x.x.x.jar 为SDK的spring-boot-starter的jar包。
|
||||
> - jhinno-openapi-sdk-spring-boot-starter-1.0.1-sources.jar 为SDK的spring-boot-starter的源码包。
|
||||
|
||||
### 2.1.2 引入`jhinno-openapi-sdk-spring-boot-starter`坐标
|
||||
|
||||
```xml
|
||||
|
||||
<dependency>
|
||||
<groupId>com.jhinno</groupId>
|
||||
<artifactId>jhinno-openapi-java-sdk</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<artifactId>jhinno-openapi-sdk-spring-boot-starter</artifactId>
|
||||
<version>1.0.1</version>
|
||||
</dependency>
|
||||
```
|
||||
|
||||
方法二:通过命令将jar包导入本地Maven仓库
|
||||
### 2.1.3 配置
|
||||
|
||||
在SpringBoot的`application.properties`或`application.yml`里面配置
|
||||
|
||||
#### 2.1.3.1 application.yaml
|
||||
|
||||
```yaml
|
||||
jhinno:
|
||||
openapi:
|
||||
server-url: https://{appform服务器的地址}/appform
|
||||
used-server-time: true
|
||||
```
|
||||
|
||||
#### 2.1.3.2 application.properties
|
||||
|
||||
```properties
|
||||
jhinno.openapi.server-url=https://{appform服务器的地址}/appform
|
||||
jhinno.openapi.used-server-time=true
|
||||
```
|
||||
|
||||
> 注:
|
||||
> - 其中`jhinno.openapi.server-url`为景行接口服务的BaseUrl;
|
||||
> - `jhinno.openapi.used-server-time`是否获取服务器时间来请求token,关闭可提高获取token的时间,但打开有可能因为服务器时间不准确而导致token获取失败的问题。
|
||||
> - 更多配置见`com.jhinno.sdk.openapi.autoconfigure.JHOpenapiProperties`源码。
|
||||
|
||||
### 2.1.4 使用
|
||||
|
||||
在`com.jhinno.sdk.openapi.api`包下面对应`app`、`data`、`file`、`job`、`organization`这几个子包,分别代表景行`Appform`
|
||||
的应用、作业数据、文件、作业操作、组织等接口资源。开发者只需要使用接口的执行器(`JHxxxApiExecution`
|
||||
)即可使用资源,如:`JHFileApiExecution`
|
||||
|
||||
```java
|
||||
public class DemoUserSDK {
|
||||
|
||||
/**
|
||||
* 注入要调用的执行器
|
||||
*/
|
||||
@Autowired
|
||||
private JHFileApiExecution fileApiExecution;
|
||||
|
||||
void contextLoads() {
|
||||
|
||||
// 调用执行其中想要调用的方法
|
||||
List<FileInfo> list = fileApiExecution.getFileList("jhadmin", "$HOME");
|
||||
System.out.println(list);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## 2.2 Spring
|
||||
|
||||
### 2.2.1 安装
|
||||
|
||||
建议在您的项目中使用Jhinno OpenAPI SDK for Java的方法是从Maven中使用它。:
|
||||
|
||||
#### 方法一:通过Maven仓库安装
|
||||
|
||||
> 添加仓库地址(改方案为备用方案,后续会上传至Maven中央仓库,目前不影响正常使用)
|
||||
|
||||
```xml
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>jhinno-nexus</id>
|
||||
<name>jhinno-nexus</name>
|
||||
<url>https://jhinno-nexus.yuchat.top/repository/maven-releases</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
```
|
||||
|
||||
#### 方法二:通过命令将jar包导入本地Maven仓库
|
||||
|
||||
```shell
|
||||
# 其中<path-to-dir>为jar的路径,<path-to-dir>为jar包路径
|
||||
|
||||
# SDK Client的jar包的导入,其中<path-to-dir>为jar的路径,<path-to-dir>为jar包路径
|
||||
mvn org.apache.maven.plugins:maven-install-plugin:3.1.1:install-file -Dfile="<path-to-dir>/jhinno-openapi-java-sdk-1.0.0.jar" -Dsources="<path-to-dir>/jhinno-openapi-java-sdk-1.0.0-sources.jar"
|
||||
# 例如
|
||||
mvn org.apache.maven.plugins:maven-install-plugin:3.1.1:install-file -Dfile="E:/下载/jhinno-openapi-java-sdk-1.0.0.jar" -Dsources="E:/下载/jhinno-openapi-java-sdk-1.0.0-sources.jar"
|
||||
```
|
||||
|
||||
> 注:
|
||||
> 注:
|
||||
> - jhinno-openapi-java-sdk-x.x.x.jar 为SDK的jar包。
|
||||
> - jhinno-openapi-java-sdk-x.x.x-sources.jar 为源码包,添加可方便查看SDK代码的注释。
|
||||
|
||||
然后在`pom.xml`添加
|
||||
### 2.2.2 引入`jhinno-openapi-java-sdk`坐标
|
||||
|
||||
```xml
|
||||
|
||||
<dependency>
|
||||
<groupId>com.jhinno</groupId>
|
||||
<artifactId>jhinno-openapi-java-sdk</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<version>1.0.1</version>
|
||||
</dependency>
|
||||
```
|
||||
|
||||
方法三:直接在`pom.xml`引用jar(改方法可能会出现一些莫名其妙的问题,所以不建议使用)
|
||||
### 2.2.3 配置
|
||||
|
||||
spring.xml添加以下内容
|
||||
|
||||
```xml
|
||||
<!-- 其中{path-to-file}为jar的位置 -->
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<beans>
|
||||
<bean id="apiClient" class="com.jhinno.sdk.openapi.client.JHApiClient">
|
||||
<property name="baseUrl" value="https://172.17.0.5/appform"/>
|
||||
</bean>
|
||||
<bean id="appApiExecution" class="com.jhinno.sdk.openapi.api.app.JHAppApiExecution">
|
||||
<constructor-arg ref="apiClient"/>
|
||||
</bean>
|
||||
<bean id="dataApiExecution" class="com.jhinno.sdk.openapi.api.data.JHDataApiExecution">
|
||||
<constructor-arg ref="apiClient"/>
|
||||
</bean>
|
||||
<bean id="fileApiExecution" class="com.jhinno.sdk.openapi.api.file.JHFileApiExecution">
|
||||
<constructor-arg ref="apiClient"/>
|
||||
</bean>
|
||||
<bean id="jhJobApiExecution" class="com.jhinno.sdk.openapi.api.job.JHJobApiExecution">
|
||||
<constructor-arg ref="apiClient"/>
|
||||
</bean>
|
||||
<bean id="departmentApiExecution" class="com.jhinno.sdk.openapi.api.organization.JHDepartmentApiExecution">
|
||||
<constructor-arg ref="apiClient"/>
|
||||
</bean>
|
||||
<bean id="userApiExecution" class="com.jhinno.sdk.openapi.api.organization.JHUserApiExecution">
|
||||
<constructor-arg ref="apiClient"/>
|
||||
</bean>
|
||||
</beans>
|
||||
```
|
||||
|
||||
### 2.2.4 使用
|
||||
|
||||
在`com.jhinno.sdk.openapi.api`包下面对应`app`、`data`、`file`、`job`、`organization`这几个子包,分别代表景行`Appform`
|
||||
的应用、作业数据、文件、作业操作、组织等接口资源。开发者只需要使用接口的执行器(`JHxxxApiExecution`
|
||||
)即可使用资源,如:`JHAppApiExecution`
|
||||
|
||||
```java
|
||||
public class DemoUserSDK {
|
||||
|
||||
/**
|
||||
* 注入要调用的执行器
|
||||
*/
|
||||
@Autowired
|
||||
private JHFileApiExecution fileApiExecution;
|
||||
|
||||
void contextLoads() {
|
||||
|
||||
// 调用执行其中想要调用的方法
|
||||
List<FileInfo> list = fileApiExecution.getFileList("jhadmin", "$HOME");
|
||||
System.out.println(list);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## 2.3 普通java项目
|
||||
|
||||
### 2.3.1 安装
|
||||
|
||||
- 同 2.2.1 安装一样
|
||||
|
||||
### 2.3.2 引入`jhinno-openapi-java-sdk`坐标
|
||||
```xml
|
||||
|
||||
<dependency>
|
||||
<groupId>com.jhinno</groupId>
|
||||
<artifactId>jhinno-openapi-java-sdk</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>{path-to-file}</systemPath>
|
||||
<version>1.0.1</version>
|
||||
</dependency>
|
||||
```
|
||||
|
||||
例如
|
||||
|
||||
```xml
|
||||
<!-- 其中{path-to-file}为jar的位置 -->
|
||||
<dependency>
|
||||
<groupId>com.jhinno</groupId>
|
||||
<artifactId>jhinno-openapi-java-sdk</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>D:/jar/jhinno-openapi-java-sdk-1.0.0.jar</systemPath>
|
||||
</dependency>
|
||||
```
|
||||
|
||||
## 使用
|
||||
### 2.3.3 使用
|
||||
|
||||
在`com.jhinno.sdk.openapi.api`包下面对应`app`、`data`、`file`、`job`、`organization`这几个子包,分别代表景行`Appform`
|
||||
的应用、作业数据、文件、作业操作、组织等接口资源。开发者只需要使用接口的执行器(`JHxxxApiExecution`
|
||||
@@ -137,7 +277,7 @@ public class DemoUserSDK {
|
||||
|
||||
```
|
||||
|
||||
## 支持SDK的扩展
|
||||
# 3. 支持SDK的扩展
|
||||
|
||||
如果是基于景行定制的接口,本SDK没有包含这些方法,因此您可以基于`JHApiExecution`快速进行扩展,具体的扩展步骤如下:
|
||||
|
||||
@@ -170,7 +310,7 @@ public class JHAppApiExecution extends JHApiExecution {
|
||||
|
||||
```
|
||||
|
||||
## 构建
|
||||
# 4. 构建
|
||||
|
||||
一旦您检出代码,就可以使用Maven构建它。使用以下命令进行构建:
|
||||
|
||||
@@ -178,17 +318,17 @@ public class JHAppApiExecution extends JHApiExecution {
|
||||
mvn clean package -DskipTests -P product
|
||||
```
|
||||
|
||||
## 代码贡献
|
||||
# 5. 代码贡献
|
||||
|
||||
- 代码必须格式化,使用IDEA自带的格式即可;
|
||||
- 请求路径必须放在一个单独的const类中统一维护,具体可参考现有代码提交;
|
||||
- 封装新的接口是需要继承`JHApiExecution`,调用父类的辅助方法辅助封装;
|
||||
|
||||
## 作者
|
||||
# 6. 作者
|
||||
|
||||
- [yanlongqi](https://github.com/yanlongqi)
|
||||
|
||||
## 支持
|
||||
# 7. 支持
|
||||
|
||||
- 电话(同微信):18794888087
|
||||
- 邮箱:lqyan@jhinno.com
|
||||
170
jhinno-openapi-java-sdk/pom.xml
Normal file
170
jhinno-openapi-java-sdk/pom.xml
Normal file
@@ -0,0 +1,170 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>jhinno-openapi-java-sdk</artifactId>
|
||||
<version>1.0.2</version>
|
||||
<packaging>jar</packaging>
|
||||
<name>Jhinno OpenAPI SDK for Java</name>
|
||||
<description>The Jhinno OpenAPI SDK for Java used for accessing Jhinno OpenApi Service</description>
|
||||
<url>http://jhinno.com</url>
|
||||
|
||||
<parent>
|
||||
<groupId>com.jhinno</groupId>
|
||||
<artifactId>jhinno-openapi-java-sdk-parent</artifactId>
|
||||
<version>1.0.2</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<artifactId>httpclient</artifactId>
|
||||
<version>4.5.13</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>commons-codec</groupId>
|
||||
<artifactId>commons-codec</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<artifactId>httpmime</artifactId>
|
||||
<version>4.5.13</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>commons-logging</groupId>
|
||||
<artifactId>commons-logging</artifactId>
|
||||
<version>1.2</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>commons-codec</groupId>
|
||||
<artifactId>commons-codec</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-core</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-databind</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-all</artifactId>
|
||||
<version>5.8.25</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<scope>provided</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<distributionManagement>
|
||||
<repository>
|
||||
<id>jhinno-releases</id>
|
||||
<url>http://192.168.87.22:8081/repository/maven-releases</url>
|
||||
</repository>
|
||||
</distributionManagement>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<source>${maven.compiler.source}</source>
|
||||
<target>${maven.compiler.target}</target>
|
||||
<encoding>${project.build.sourceEncoding}</encoding>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok-maven-plugin</artifactId>
|
||||
<version>1.18.0.0</version>
|
||||
<configuration>
|
||||
<encoding>UTF-8</encoding>
|
||||
<sourceDirectory>src/main/java</sourceDirectory>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<configuration>
|
||||
<sourcepath>target/generated-sources/delombok</sourcepath>
|
||||
<encoding>${project.build.sourceEncoding}</encoding>
|
||||
<docencoding>${project.build.sourceEncoding}</docencoding>
|
||||
<charset>${project.build.sourceEncoding}</charset>
|
||||
<doclint>none</doclint>
|
||||
<tags>
|
||||
<tag>
|
||||
<name>date</name>
|
||||
<placement>X</placement>
|
||||
</tag>
|
||||
</tags>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-source-plugin</artifactId>
|
||||
<version>3.3.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>attach-sources</id>
|
||||
<goals>
|
||||
<goal>jar-no-fork</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<developers>
|
||||
<developer>
|
||||
<id>lqyan</id>
|
||||
<name>lqyan</name>
|
||||
<email>lqyan@jhinno.com</email>
|
||||
</developer>
|
||||
</developers>
|
||||
|
||||
<licenses>
|
||||
<license>
|
||||
<name>The Apache License, Version 2.0</name>
|
||||
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
|
||||
</license>
|
||||
</licenses>
|
||||
|
||||
</project>
|
||||
@@ -1,7 +1,5 @@
|
||||
package com.jhinno.sdk.openapi;
|
||||
|
||||
import org.omg.CosNaming.NamingContextPackage.NotFound;
|
||||
|
||||
/**
|
||||
* 客户端错误相关常亮的定义
|
||||
*
|
||||
@@ -37,4 +37,9 @@ public class CommonConstant {
|
||||
* 字符逗号
|
||||
*/
|
||||
public static final String NORMAL_CHARACTER_COMMA = ",";
|
||||
|
||||
/**
|
||||
* 是否使用服务器的时间
|
||||
*/
|
||||
public static final boolean DEFAULT_IS_USED_SERVER_TIME = false;
|
||||
}
|
||||
@@ -51,6 +51,12 @@ public class JHApiExecution {
|
||||
private int tokenResidueTime = CommonConstant.DEFAULT_TOKEN_RESIDUE_TIME;
|
||||
|
||||
|
||||
/**
|
||||
* 是否使用服务器时间,开启可能会导致请求过慢,但是不会太慢,默认token会有缓存
|
||||
*/
|
||||
private boolean isUsedServerTime = CommonConstant.DEFAULT_IS_USED_SERVER_TIME;
|
||||
|
||||
|
||||
/**
|
||||
* 获取一个执行器的实例
|
||||
*
|
||||
@@ -93,6 +99,23 @@ public class JHApiExecution {
|
||||
this.tokenResidueTime = tokenResidueTime;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 是否使用服务器时间
|
||||
*/
|
||||
public boolean isUsedServerTime() {
|
||||
return isUsedServerTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置是否使用服务器时间
|
||||
*
|
||||
* @param usedServerTime 是否使用服务器时间
|
||||
*/
|
||||
public void setUsedServerTime(boolean usedServerTime) {
|
||||
isUsedServerTime = usedServerTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户的Token
|
||||
*
|
||||
@@ -109,12 +132,12 @@ public class JHApiExecution {
|
||||
// 防止因为服务器时间的问题二导致token不可用,可以通过此配置提前获取token
|
||||
int tokenEffectiveTime = (tokenTimeout - tokenResidueTime) * 60 * 1000;
|
||||
// 如果是强制获取、用户令牌为空、用户令牌过期等,则获取令牌
|
||||
if (isForce || tokenInfo == null || System.currentTimeMillis() - tokenInfo.getCurrentTimestamp() < tokenEffectiveTime) {
|
||||
if (isForce || tokenInfo == null || System.currentTimeMillis() - tokenInfo.getCurrentTimestamp() > tokenEffectiveTime) {
|
||||
Map<String, Object> params = new HashMap<>(2);
|
||||
params.put("timeout", tokenTimeout);
|
||||
|
||||
long currentTimeMillis = isUsedServerTime ? jhApiClient.requestTimeMillis() : System.currentTimeMillis();
|
||||
AES aes = new AES(CommonConstant.DEFAULT_AES_KEY.getBytes());
|
||||
String base64 = aes.encryptBase64(String.format("%s,%s", username, System.currentTimeMillis()));
|
||||
String base64 = aes.encryptBase64(String.format("%s,%s", username, currentTimeMillis));
|
||||
params.put("username", base64);
|
||||
String url = JHApiClient.getUrl(AuthPathConstant.AUTH_TOKEN_PATH, params);
|
||||
Map<String, String> token = get(url, new TypeReference<ResponseResult<Map<String, String>>>() {
|
||||
@@ -24,5 +24,9 @@ public class AuthPathConstant {
|
||||
*/
|
||||
public static final String AUTH_REGISTER = "/ws/api/auth/register";
|
||||
|
||||
/**
|
||||
* 测试服务器是否可用
|
||||
*/
|
||||
public static final String PING = "/ws/api/ping";
|
||||
|
||||
}
|
||||
@@ -49,5 +49,10 @@ public class FileInfo {
|
||||
*/
|
||||
private Boolean execute;
|
||||
|
||||
/**
|
||||
* 是否软连接
|
||||
*/
|
||||
private Boolean link;
|
||||
|
||||
|
||||
}
|
||||
@@ -20,17 +20,17 @@ public class DefaultHttpClientConfig {
|
||||
|
||||
|
||||
/**
|
||||
* 默认socket连接超时的时间(单位:秒)
|
||||
* 默认socket连接超时的时间(单位:毫秒)
|
||||
*/
|
||||
public static final int SOCKET_TIMEOUT = 5000;
|
||||
|
||||
/**
|
||||
* 默认连接超时的时间(单位:秒)
|
||||
* 默认连接超时的时间(单位:毫秒)
|
||||
*/
|
||||
public static final int CONNECT_TIMEOUT = 5000;
|
||||
|
||||
/**
|
||||
* 默认请求超时的时间(单位:秒)
|
||||
* 默认请求超时的时间(单位:毫秒)
|
||||
*/
|
||||
public static final int CONNECTION_REQUEST_TIMEOUT = 5000;
|
||||
}
|
||||
@@ -3,11 +3,15 @@ package com.jhinno.sdk.openapi.client;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import com.fasterxml.jackson.databind.DeserializationFeature;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.jhinno.sdk.openapi.ArgsException;
|
||||
import com.jhinno.sdk.openapi.ClientErrorCode;
|
||||
import com.jhinno.sdk.openapi.ClientException;
|
||||
import com.jhinno.sdk.openapi.api.auth.AuthPathConstant;
|
||||
import lombok.Data;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.http.Header;
|
||||
import org.apache.http.HttpEntity;
|
||||
import org.apache.http.HttpResponse;
|
||||
import org.apache.http.HttpStatus;
|
||||
@@ -33,6 +37,7 @@ import java.nio.charset.StandardCharsets;
|
||||
import java.security.KeyManagementException;
|
||||
import java.security.KeyStoreException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
@@ -44,15 +49,16 @@ import java.util.TimeZone;
|
||||
* @author yanlongqi
|
||||
* @date 2024/1/29 10:31
|
||||
*/
|
||||
@Data
|
||||
public class JHApiClient {
|
||||
|
||||
/**
|
||||
* 基础的请求URL地址
|
||||
* 基础的请求URL地址
|
||||
* <p>
|
||||
* 如:<a href="https://192.168.3.12/appform">https://192.168.3.12/appform</a>
|
||||
* 如:https://192.168.3.12/appform
|
||||
* </p>
|
||||
*/
|
||||
private final String baseUrl;
|
||||
private String baseUrl;
|
||||
|
||||
|
||||
/**
|
||||
@@ -60,26 +66,10 @@ public class JHApiClient {
|
||||
*/
|
||||
private ObjectMapper mapper;
|
||||
|
||||
/**
|
||||
* 初始化一个JHApiClient的实例,可使用自定义的客户端
|
||||
*
|
||||
* @param baseUrl 景行接口服务的基础地址
|
||||
* @param closeableHttpClient 可关闭的HTTP客户端
|
||||
*/
|
||||
private JHApiClient(CloseableHttpClient closeableHttpClient, String baseUrl) {
|
||||
this.baseUrl = baseUrl.endsWith("/") ? baseUrl.substring(0, baseUrl.length() - 1) : baseUrl;
|
||||
this.closeableHttpClient = closeableHttpClient;
|
||||
this.requestConfig = RequestConfig.custom().setSocketTimeout(DefaultHttpClientConfig.SOCKET_TIMEOUT).setConnectTimeout(DefaultHttpClientConfig.CONNECT_TIMEOUT).setConnectionRequestTimeout(DefaultHttpClientConfig.CONNECTION_REQUEST_TIMEOUT).build();
|
||||
mapper = new ObjectMapper();
|
||||
mapper.setTimeZone(TimeZone.getTimeZone("GMT+8"));
|
||||
mapper.setDateFormat(new SimpleDateFormat(DatePattern.NORM_DATETIME_PATTERN));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* HTTP的连接客户端
|
||||
*/
|
||||
private final CloseableHttpClient closeableHttpClient;
|
||||
private CloseableHttpClient closeableHttpClient;
|
||||
|
||||
|
||||
/**
|
||||
@@ -87,28 +77,69 @@ public class JHApiClient {
|
||||
*/
|
||||
private RequestConfig requestConfig;
|
||||
|
||||
private int socketTimeout = DefaultHttpClientConfig.SOCKET_TIMEOUT;
|
||||
private int connectTimeout = DefaultHttpClientConfig.CONNECT_TIMEOUT;
|
||||
private int connectRequestTimeout = DefaultHttpClientConfig.CONNECTION_REQUEST_TIMEOUT;
|
||||
private int maxTotal = DefaultHttpClientConfig.MAX_TOTAL;
|
||||
private int maxPerRout = DefaultHttpClientConfig.MAX_PER_ROUT;
|
||||
/**
|
||||
* 初始化一个JHApiClient的实例,可使用自定义的客户端
|
||||
*
|
||||
* @param baseUrl 景行接口服务的基础地址
|
||||
* @param closeableHttpClient 可关闭的HTTP客户端
|
||||
*/
|
||||
public JHApiClient(CloseableHttpClient closeableHttpClient, String baseUrl, int socketTimeout, int connectTimeout, int connectRequestTimeout) {
|
||||
this.baseUrl = baseUrl.endsWith("/") ? baseUrl.substring(0, baseUrl.length() - 1) : baseUrl;
|
||||
this.closeableHttpClient = closeableHttpClient;
|
||||
this.socketTimeout = socketTimeout;
|
||||
this.connectTimeout = connectTimeout;
|
||||
this.connectRequestTimeout = connectRequestTimeout;
|
||||
clientInit();
|
||||
}
|
||||
|
||||
public JHApiClient() {
|
||||
closeableHttpClient = createHttpClients(maxTotal, maxPerRout);
|
||||
clientInit();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 初始化客户端
|
||||
*/
|
||||
public void clientInit(){
|
||||
this.requestConfig = RequestConfig.custom()
|
||||
.setSocketTimeout(socketTimeout)
|
||||
.setConnectTimeout(connectTimeout)
|
||||
.setConnectionRequestTimeout(connectRequestTimeout)
|
||||
.build();
|
||||
mapper = new ObjectMapper();
|
||||
mapper.setTimeZone(TimeZone.getTimeZone("GMT+8"));
|
||||
mapper.setDateFormat(new SimpleDateFormat(DatePattern.NORM_DATETIME_PATTERN));
|
||||
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过最大连接数和服务每次能并行接收的请求数量构建一个JHApiClient实例
|
||||
*
|
||||
* @param maxTotal 最大连接数
|
||||
* @param maxPerRout 服务每次能并行接收的请求数量
|
||||
* @param baseUrl 景行接口服务的基础地址
|
||||
* @param baseUrl 景行接口服务的基础地址 如: http://192.168.3.4/appform
|
||||
* @return JHApiClient的实例
|
||||
*/
|
||||
public static JHApiClient build(int maxTotal, int maxPerRout, String baseUrl) {
|
||||
return build(createHttpClients(maxTotal, maxPerRout), baseUrl);
|
||||
public static JHApiClient build(String baseUrl, int maxTotal, int maxPerRout, int socketTimeout, int connectTimeout, int connectRequestTimeout) {
|
||||
return build(createHttpClients(maxTotal, maxPerRout), baseUrl, socketTimeout, connectTimeout, connectRequestTimeout);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过{@link DefaultHttpClientConfig}默认配置的最大连接数和服务每次能并行接收的请求数量构建一个JHApiClient实例
|
||||
* <p>
|
||||
*
|
||||
* @param baseUrl 景行接口服务的基础地址
|
||||
* @param baseUrl 景行接口服务的基础地址,如: http://192.168.3.4/appform
|
||||
* @return JHApiClient的实例
|
||||
*/
|
||||
public static JHApiClient build(String baseUrl) {
|
||||
return build(createHttpClients(DefaultHttpClientConfig.MAX_TOTAL, DefaultHttpClientConfig.MAX_PER_ROUT), baseUrl);
|
||||
CloseableHttpClient client = createHttpClients(com.jhinno.sdk.openapi.client.DefaultHttpClientConfig.MAX_TOTAL, com.jhinno.sdk.openapi.client.DefaultHttpClientConfig.MAX_PER_ROUT);
|
||||
return build(client, baseUrl, com.jhinno.sdk.openapi.client.DefaultHttpClientConfig.SOCKET_TIMEOUT, com.jhinno.sdk.openapi.client.DefaultHttpClientConfig.CONNECT_TIMEOUT, com.jhinno.sdk.openapi.client.DefaultHttpClientConfig.CONNECTION_REQUEST_TIMEOUT);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -119,8 +150,8 @@ public class JHApiClient {
|
||||
* @param baseUrl 景行接口服务的基础地址
|
||||
* @return JHApiClient的实例
|
||||
*/
|
||||
public static JHApiClient build(CloseableHttpClient httpClient, String baseUrl) {
|
||||
return new JHApiClient(httpClient, baseUrl);
|
||||
public static JHApiClient build(CloseableHttpClient httpClient, String baseUrl, int socketTimeout, int connectTimeout, int connectRequestTimeout) {
|
||||
return new JHApiClient(httpClient, baseUrl, socketTimeout, connectTimeout, connectRequestTimeout);
|
||||
}
|
||||
|
||||
|
||||
@@ -226,6 +257,34 @@ public class JHApiClient {
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 请求服务器的时间戳
|
||||
*
|
||||
* @return 服务器的时间戳
|
||||
*/
|
||||
public Long requestTimeMillis() {
|
||||
HttpGet httpGet = new HttpGet(getUrl(AuthPathConstant.PING));
|
||||
httpGet.setConfig(requestConfig);
|
||||
try {
|
||||
HttpResponse response = closeableHttpClient.execute(httpGet);
|
||||
Header header = response.getFirstHeader("Date");
|
||||
if (header == null) {
|
||||
return null;
|
||||
}
|
||||
String value = header.getValue();
|
||||
if (StringUtils.isBlank(value)) {
|
||||
return null;
|
||||
}
|
||||
return DatePattern.HTTP_DATETIME_FORMAT.parse(value).getTime();
|
||||
} catch (IOException e) {
|
||||
throw new ClientException(e.getMessage());
|
||||
} catch (ParseException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送请求
|
||||
*
|
||||
@@ -13,6 +13,6 @@ public class JHClientConfig {
|
||||
/**
|
||||
* 初始化JHApi客户端
|
||||
*/
|
||||
public static final JHApiClient client = JHApiClient.build("https://192.168.87.25/appform");
|
||||
public static final JHApiClient client = JHApiClient.build("https://172.17.0.5/appform");
|
||||
|
||||
}
|
||||
@@ -50,7 +50,7 @@ public class FileApiTest {
|
||||
*/
|
||||
@Test
|
||||
public void testGetFileList() {
|
||||
List<FileInfo> fileList = execution.getFileList("lqyan", "$HOME");
|
||||
List<FileInfo> fileList = execution.getFileList("jhadmin", "$HOME");
|
||||
ConsoleTable consoleTable = ConsoleTable.create();
|
||||
consoleTable.setSBCMode(false);
|
||||
consoleTable.addHeader("fileName", "fileType", "owner", "read", "write", "execute", "path");
|
||||
@@ -65,7 +65,7 @@ public class FileApiTest {
|
||||
*/
|
||||
@Test
|
||||
public void testMkdir() {
|
||||
System.out.println(execution.mkdir("jhadmin", "$HOME/test", true));
|
||||
System.out.println(execution.mkdir("jhadmin", "$HOMEtest1", true));
|
||||
}
|
||||
|
||||
|
||||
136
jhinno-openapi-sdk-spring-boot-starter/pom.xml
Normal file
136
jhinno-openapi-sdk-spring-boot-starter/pom.xml
Normal file
@@ -0,0 +1,136 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>jhinno-openapi-sdk-spring-boot-starter</artifactId>
|
||||
<version>1.0.2</version>
|
||||
<packaging>jar</packaging>
|
||||
<name>Jhinno OpenAPI SDK for Java SpringBoot Starter</name>
|
||||
<description>The Jhinno OpenAPI SDK for Java used for accessing Jhinno OpenApi Service</description>
|
||||
<url>http://jhinno.com</url>
|
||||
|
||||
<parent>
|
||||
<groupId>com.jhinno</groupId>
|
||||
<artifactId>jhinno-openapi-java-sdk-parent</artifactId>
|
||||
<version>1.0.2</version>
|
||||
</parent>
|
||||
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.jhinno</groupId>
|
||||
<artifactId>jhinno-openapi-java-sdk</artifactId>
|
||||
<version>1.0.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-autoconfigure</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-configuration-processor</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<scope>provided</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
|
||||
</dependencies>
|
||||
|
||||
<distributionManagement>
|
||||
<repository>
|
||||
<id>jhinno-releases</id>
|
||||
<url>http://192.168.87.22:8081/repository/maven-releases</url>
|
||||
</repository>
|
||||
</distributionManagement>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<source>${maven.compiler.source}</source>
|
||||
<target>${maven.compiler.target}</target>
|
||||
<encoding>${project.build.sourceEncoding}</encoding>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok-maven-plugin</artifactId>
|
||||
<version>1.18.0.0</version>
|
||||
<configuration>
|
||||
<encoding>UTF-8</encoding>
|
||||
<sourceDirectory>src/main/java</sourceDirectory>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<version>3.6.3</version>
|
||||
<configuration>
|
||||
<sourcepath>target/generated-sources/delombok</sourcepath>
|
||||
<encoding>${project.build.sourceEncoding}</encoding>
|
||||
<docencoding>${project.build.sourceEncoding}</docencoding>
|
||||
<charset>${project.build.sourceEncoding}</charset>
|
||||
<doclint>none</doclint>
|
||||
<tags>
|
||||
<tag>
|
||||
<name>date</name>
|
||||
<placement>X</placement>
|
||||
</tag>
|
||||
</tags>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-source-plugin</artifactId>
|
||||
<version>3.3.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>attach-sources</id>
|
||||
<goals>
|
||||
<goal>jar-no-fork</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<developers>
|
||||
<developer>
|
||||
<id>lqyan</id>
|
||||
<name>lqyan</name>
|
||||
<email>lqyan@jhinno.com</email>
|
||||
</developer>
|
||||
</developers>
|
||||
|
||||
<licenses>
|
||||
<license>
|
||||
<name>The Apache License, Version 2.0</name>
|
||||
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
|
||||
</license>
|
||||
</licenses>
|
||||
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.jhinno.sdk.openapi.autoconfigure;
|
||||
|
||||
import com.jhinno.sdk.openapi.client.JHApiClient;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* openapi客户端自动配置
|
||||
* @author yanlongqi
|
||||
* @date 2024/6/4 16:01
|
||||
*/
|
||||
@Configuration
|
||||
@EnableConfigurationProperties(JHOpenapiProperties.class)
|
||||
public class JHOpenapiClientAutoConfigure {
|
||||
|
||||
|
||||
@Bean
|
||||
@ConditionalOnMissingBean
|
||||
public JHApiClient jhApiClient(JHOpenapiProperties properties){
|
||||
return JHApiClient.build(
|
||||
properties.getServerUrl(),
|
||||
properties.getMaxTotal(),
|
||||
properties.getMaxPerRout(),
|
||||
properties.getSocketTimeout(),
|
||||
properties.getConnectTimeout(),
|
||||
properties.getConnectRequestTimeout()
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
package com.jhinno.sdk.openapi.autoconfigure;
|
||||
|
||||
import com.jhinno.sdk.openapi.api.JHApiExecution;
|
||||
import com.jhinno.sdk.openapi.api.app.JHAppApiExecution;
|
||||
import com.jhinno.sdk.openapi.api.data.JHDataApiExecution;
|
||||
import com.jhinno.sdk.openapi.api.file.JHFileApiExecution;
|
||||
import com.jhinno.sdk.openapi.api.job.JHJobApiExecution;
|
||||
import com.jhinno.sdk.openapi.api.organization.JHDepartmentApiExecution;
|
||||
import com.jhinno.sdk.openapi.api.organization.JHUserApiExecution;
|
||||
import com.jhinno.sdk.openapi.client.JHApiClient;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* openapi执行器自动配置
|
||||
*
|
||||
* @author yanlongqi
|
||||
* @date 2024/6/4 17:27
|
||||
*/
|
||||
@Configuration
|
||||
@RequiredArgsConstructor
|
||||
public class JHOpenapiExecutionAutoconfigure {
|
||||
|
||||
|
||||
private final JHOpenapiProperties properties;
|
||||
private final JHApiClient client;
|
||||
|
||||
@Bean
|
||||
public JHAppApiExecution appApiExecution() {
|
||||
JHAppApiExecution execution = new JHAppApiExecution(client);
|
||||
execution.setTokenTimeout(properties.getTokenTimeout());
|
||||
execution.setTokenResidueTime(properties.getTokenResidueTime());
|
||||
execution.setUsedServerTime(properties.isUsedServerTime());
|
||||
return execution;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public JHDataApiExecution dataApiExecution() {
|
||||
JHDataApiExecution execution = new JHDataApiExecution(client);
|
||||
execution.setTokenTimeout(properties.getTokenTimeout());
|
||||
execution.setTokenResidueTime(properties.getTokenResidueTime());
|
||||
execution.setUsedServerTime(properties.isUsedServerTime());
|
||||
return execution;
|
||||
}
|
||||
|
||||
|
||||
@Bean
|
||||
public JHFileApiExecution fileApiExecution() {
|
||||
JHFileApiExecution execution = new JHFileApiExecution(client);
|
||||
execution.setTokenTimeout(properties.getTokenTimeout());
|
||||
execution.setTokenResidueTime(properties.getTokenResidueTime());
|
||||
execution.setUsedServerTime(properties.isUsedServerTime());
|
||||
return execution;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public JHJobApiExecution jobApiExecution() {
|
||||
JHJobApiExecution execution = new JHJobApiExecution(client);
|
||||
execution.setTokenTimeout(properties.getTokenTimeout());
|
||||
execution.setTokenResidueTime(properties.getTokenResidueTime());
|
||||
execution.setUsedServerTime(properties.isUsedServerTime());
|
||||
return execution;
|
||||
}
|
||||
|
||||
|
||||
@Bean
|
||||
public JHDepartmentApiExecution departmentApiExecution() {
|
||||
JHDepartmentApiExecution execution = new JHDepartmentApiExecution(client);
|
||||
execution.setTokenTimeout(properties.getTokenTimeout());
|
||||
execution.setTokenResidueTime(properties.getTokenResidueTime());
|
||||
execution.setUsedServerTime(properties.isUsedServerTime());
|
||||
return execution;
|
||||
}
|
||||
|
||||
|
||||
@Bean
|
||||
public JHUserApiExecution userApiExecution() {
|
||||
JHUserApiExecution execution = new JHUserApiExecution(client);
|
||||
execution.setTokenTimeout(properties.getTokenTimeout());
|
||||
execution.setTokenResidueTime(properties.getTokenResidueTime());
|
||||
execution.setUsedServerTime(properties.isUsedServerTime());
|
||||
return execution;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.jhinno.sdk.openapi.autoconfigure;
|
||||
|
||||
import com.jhinno.sdk.openapi.CommonConstant;
|
||||
import com.jhinno.sdk.openapi.client.DefaultHttpClientConfig;
|
||||
import com.jhinno.sdk.openapi.constant.CommonConstants;
|
||||
import lombok.Data;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
|
||||
/**
|
||||
* @author yanlongqi
|
||||
* @date 2024/6/4 16:03
|
||||
*/
|
||||
@Data
|
||||
@ConfigurationProperties(prefix = CommonConstants.CONFIG_PREFIX)
|
||||
public class JHOpenapiProperties {
|
||||
|
||||
/**
|
||||
* 接口服务的BaseURL, 列如:https://192.168.87.20/appform
|
||||
*/
|
||||
private String serverUrl;
|
||||
|
||||
/**
|
||||
* 设置连接池的最大连接数,默认{@link DefaultHttpClientConfig#MAX_TOTAL}
|
||||
*/
|
||||
private int maxTotal = DefaultHttpClientConfig.MAX_TOTAL;
|
||||
|
||||
|
||||
/**
|
||||
* 设置服务每次能并行接收的请求数量,默认{@link DefaultHttpClientConfig#MAX_PER_ROUT}
|
||||
*/
|
||||
private int maxPerRout = DefaultHttpClientConfig.MAX_PER_ROUT;
|
||||
|
||||
/**
|
||||
* 设置服务socket连接超时的时间(单位:毫秒),默认{@link DefaultHttpClientConfig#SOCKET_TIMEOUT}
|
||||
*/
|
||||
private int socketTimeout = DefaultHttpClientConfig.SOCKET_TIMEOUT;
|
||||
|
||||
/**
|
||||
* 设置服务连接超时的时间(单位:毫秒),默认{@link DefaultHttpClientConfig#CONNECT_TIMEOUT}
|
||||
*/
|
||||
private int connectTimeout = DefaultHttpClientConfig.CONNECT_TIMEOUT;
|
||||
|
||||
|
||||
/**
|
||||
* 设置服务请求超时的时间(单位:毫秒),默认{@link DefaultHttpClientConfig#CONNECTION_REQUEST_TIMEOUT}
|
||||
*/
|
||||
private int connectRequestTimeout = DefaultHttpClientConfig.CONNECTION_REQUEST_TIMEOUT;
|
||||
|
||||
|
||||
/**
|
||||
* token的超时时间(单位:分钟)
|
||||
*/
|
||||
private int tokenTimeout = CommonConstant.DEFAULT_TOKEN_EFFECTIVE_TIME;
|
||||
|
||||
/**
|
||||
* token提前获取的时间(单位:分钟)
|
||||
*/
|
||||
private int tokenResidueTime = CommonConstant.DEFAULT_TOKEN_RESIDUE_TIME;
|
||||
|
||||
|
||||
/**
|
||||
* 是否使用服务器时间
|
||||
*/
|
||||
private boolean usedServerTime = CommonConstant.DEFAULT_IS_USED_SERVER_TIME;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.jhinno.sdk.openapi.constant;
|
||||
|
||||
/**
|
||||
* @author yanlongqi
|
||||
* @date 2024/6/4 16:12
|
||||
*/
|
||||
public class CommonConstants {
|
||||
|
||||
|
||||
/**
|
||||
* 配置的前缀
|
||||
*/
|
||||
public static final String CONFIG_PREFIX = "jhinno.openapi";
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
|
||||
com.jhinno.sdk.openapi.autoconfigure.JHOpenapiClientAutoConfigure,\
|
||||
com.jhinno.sdk.openapi.autoconfigure.JHOpenapiExecutionAutoconfigure
|
||||
@@ -0,0 +1,2 @@
|
||||
com.jhinno.sdk.openapi.autoconfigure.JHOpenapiClientAutoConfigure
|
||||
com.jhinno.sdk.openapi.autoconfigure.JHOpenapiExecutionAutoconfigure
|
||||
143
pom.xml
143
pom.xml
@@ -5,10 +5,10 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>com.jhinno</groupId>
|
||||
<artifactId>jhinno-openapi-java-sdk</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<packaging>jar</packaging>
|
||||
<name>Jhinno OpenAPI SDK for Java</name>
|
||||
<artifactId>jhinno-openapi-java-sdk-parent</artifactId>
|
||||
<version>1.0.2</version>
|
||||
<packaging>pom</packaging>
|
||||
<name>Jhinno OpenAPI SDK for Java parent</name>
|
||||
<description>The Jhinno OpenAPI SDK for Java used for accessing Jhinno OpenApi Service</description>
|
||||
<url>http://jhinno.com</url>
|
||||
|
||||
@@ -21,70 +21,12 @@
|
||||
<maven.test.skip>true</maven.test.skip>
|
||||
</properties>
|
||||
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>2.7.18</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.13.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<artifactId>httpclient</artifactId>
|
||||
<version>4.5.13</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>commons-codec</groupId>
|
||||
<artifactId>commons-codec</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<artifactId>httpmime</artifactId>
|
||||
<version>4.5.13</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>commons-codec</groupId>
|
||||
<artifactId>commons-codec</artifactId>
|
||||
<version>1.15</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-core</artifactId>
|
||||
<version>2.15.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-databind</artifactId>
|
||||
<version>2.15.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-all</artifactId>
|
||||
<version>5.8.25</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>1.18.28</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.13.2</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<distributionManagement>
|
||||
<repository>
|
||||
@@ -93,70 +35,11 @@
|
||||
</repository>
|
||||
</distributionManagement>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.6.2</version>
|
||||
<configuration>
|
||||
<source>${maven.compiler.source}</source>
|
||||
<target>${maven.compiler.target}</target>
|
||||
<encoding>${project.build.sourceEncoding}</encoding>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<modules>
|
||||
<module>jhinno-openapi-java-sdk</module>
|
||||
<module>jhinno-openapi-sdk-spring-boot-starter</module>
|
||||
</modules>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>3.3.0</version>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok-maven-plugin</artifactId>
|
||||
<version>1.18.0.0</version>
|
||||
<configuration>
|
||||
<encoding>UTF-8</encoding>
|
||||
<sourceDirectory>src/main/java</sourceDirectory>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<version>3.6.3</version>
|
||||
<configuration>
|
||||
<sourcepath>target/generated-sources/delombok</sourcepath>
|
||||
<encoding>${project.build.sourceEncoding}</encoding>
|
||||
<docencoding>${project.build.sourceEncoding}</docencoding>
|
||||
<charset>${project.build.sourceEncoding}</charset>
|
||||
<doclint>none</doclint>
|
||||
<tags>
|
||||
<tag>
|
||||
<name>date</name>
|
||||
<placement>X</placement>
|
||||
</tag>
|
||||
</tags>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-source-plugin</artifactId>
|
||||
<version>3.3.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>attach-sources</id>
|
||||
<goals>
|
||||
<goal>jar-no-fork</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<developers>
|
||||
<developer>
|
||||
|
||||
Reference in New Issue
Block a user