mirror of
https://github.com/yanlongqi/jhinno-openapi-java-sdk.git
synced 2026-03-22 06:15:10 +08:00
Merge pull request #3 from yanlongqi/feat-20240604-springboot-starter
feat(新版发布): 开发Springboot-starter方便集成方调用,修复获取token本地时间和服务器时间有差异而导致的报错问题
This commit is contained in:
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>
|
||||
5
.idea/encodings.xml
generated
5
.idea/encodings.xml
generated
@@ -1,8 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Encoding">
|
||||
<file url="file://$PROJECT_DIR$/jhinno-openapi-java-sdk/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/jhinno-openapi-java-sdk/src/main/resources" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/jhinno-openapi-sdk-spring-boot-starter/src/main/java" charset="UTF-8" />
|
||||
<file url="file://$PROJECT_DIR$/jhinno-openapi-sdk-spring-boot-starter/src/main/resources" charset="UTF-8" />
|
||||
<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>
|
||||
5
.idea/misc.xml
generated
5
.idea/misc.xml
generated
@@ -1,3 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||
<component name="MavenProjectsManager">
|
||||
@@ -7,7 +8,5 @@
|
||||
</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>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_21" default="true" project-jdk-name="openjdk-21" project-jdk-type="JavaSDK" />
|
||||
</project>
|
||||
2
.idea/vcs.xml
generated
2
.idea/vcs.xml
generated
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
<mapping directory="" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
209
.idea/workspace.xml
generated
Normal file
209
.idea/workspace.xml
generated
Normal file
@@ -0,0 +1,209 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="AutoImportSettings">
|
||||
<option name="autoReloadType" value="SELECTIVE" />
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="f56ca05b-44c8-4e8a-9296-ce5820371bc0" name="Changes" comment="">
|
||||
<change afterPath="$PROJECT_DIR$/jhinno-openapi-java-sdk/pom.xml" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/jhinno-openapi-sdk-spring-boot-starter/pom.xml" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/jhinno-openapi-sdk-spring-boot-starter/src/main/java/com/jhinno/sdk/openapi/autoconfigure/JHOpenapiClientAutoConfigure.java" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/jhinno-openapi-sdk-spring-boot-starter/src/main/java/com/jhinno/sdk/openapi/autoconfigure/JHOpenapiExecutionAutoconfigure.java" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/jhinno-openapi-sdk-spring-boot-starter/src/main/java/com/jhinno/sdk/openapi/autoconfigure/JHOpenapiProperties.java" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/jhinno-openapi-sdk-spring-boot-starter/src/main/java/com/jhinno/sdk/openapi/constant/CommonConstants.java" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/jhinno-openapi-sdk-spring-boot-starter/src/main/resources/META-INF/spring.factories" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/jhinno-openapi-sdk-spring-boot-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/.gitignore" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/JavaSceneConfigState.xml" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/encodings.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/encodings.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/inspectionProfiles/Project_Default.xml" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/misc.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/misc.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/vcs.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/vcs.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/pom.xml" beforeDir="false" afterPath="$PROJECT_DIR$/pom.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/com/jhinno/sdk/openapi/ArgsException.java" beforeDir="false" afterPath="$PROJECT_DIR$/jhinno-openapi-java-sdk/src/main/java/com/jhinno/sdk/openapi/ArgsException.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/com/jhinno/sdk/openapi/ClientErrorCode.java" beforeDir="false" afterPath="$PROJECT_DIR$/jhinno-openapi-java-sdk/src/main/java/com/jhinno/sdk/openapi/ClientErrorCode.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/com/jhinno/sdk/openapi/ClientException.java" beforeDir="false" afterPath="$PROJECT_DIR$/jhinno-openapi-java-sdk/src/main/java/com/jhinno/sdk/openapi/ClientException.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/com/jhinno/sdk/openapi/CommonConstant.java" beforeDir="false" afterPath="$PROJECT_DIR$/jhinno-openapi-java-sdk/src/main/java/com/jhinno/sdk/openapi/CommonConstant.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/com/jhinno/sdk/openapi/ServiceException.java" beforeDir="false" afterPath="$PROJECT_DIR$/jhinno-openapi-java-sdk/src/main/java/com/jhinno/sdk/openapi/ServiceException.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/com/jhinno/sdk/openapi/api/JHApiExecution.java" beforeDir="false" afterPath="$PROJECT_DIR$/jhinno-openapi-java-sdk/src/main/java/com/jhinno/sdk/openapi/api/JHApiExecution.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/com/jhinno/sdk/openapi/api/PageResult.java" beforeDir="false" afterPath="$PROJECT_DIR$/jhinno-openapi-java-sdk/src/main/java/com/jhinno/sdk/openapi/api/PageResult.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/com/jhinno/sdk/openapi/api/ResponseResult.java" beforeDir="false" afterPath="$PROJECT_DIR$/jhinno-openapi-java-sdk/src/main/java/com/jhinno/sdk/openapi/api/ResponseResult.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/com/jhinno/sdk/openapi/api/TokenInfo.java" beforeDir="false" afterPath="$PROJECT_DIR$/jhinno-openapi-java-sdk/src/main/java/com/jhinno/sdk/openapi/api/TokenInfo.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/com/jhinno/sdk/openapi/api/app/AppInfo.java" beforeDir="false" afterPath="$PROJECT_DIR$/jhinno-openapi-java-sdk/src/main/java/com/jhinno/sdk/openapi/api/app/AppInfo.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/com/jhinno/sdk/openapi/api/app/AppPathConstant.java" beforeDir="false" afterPath="$PROJECT_DIR$/jhinno-openapi-java-sdk/src/main/java/com/jhinno/sdk/openapi/api/app/AppPathConstant.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/com/jhinno/sdk/openapi/api/app/AppStartRequest.java" beforeDir="false" afterPath="$PROJECT_DIR$/jhinno-openapi-java-sdk/src/main/java/com/jhinno/sdk/openapi/api/app/AppStartRequest.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/com/jhinno/sdk/openapi/api/app/AppStartedInfo.java" beforeDir="false" afterPath="$PROJECT_DIR$/jhinno-openapi-java-sdk/src/main/java/com/jhinno/sdk/openapi/api/app/AppStartedInfo.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/com/jhinno/sdk/openapi/api/app/JHAppApiExecution.java" beforeDir="false" afterPath="$PROJECT_DIR$/jhinno-openapi-java-sdk/src/main/java/com/jhinno/sdk/openapi/api/app/JHAppApiExecution.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/com/jhinno/sdk/openapi/api/app/SessionInfo.java" beforeDir="false" afterPath="$PROJECT_DIR$/jhinno-openapi-java-sdk/src/main/java/com/jhinno/sdk/openapi/api/app/SessionInfo.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/com/jhinno/sdk/openapi/api/auth/AuthPathConstant.java" beforeDir="false" afterPath="$PROJECT_DIR$/jhinno-openapi-java-sdk/src/main/java/com/jhinno/sdk/openapi/api/auth/AuthPathConstant.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/com/jhinno/sdk/openapi/api/data/DataPathConstant.java" beforeDir="false" afterPath="$PROJECT_DIR$/jhinno-openapi-java-sdk/src/main/java/com/jhinno/sdk/openapi/api/data/DataPathConstant.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/com/jhinno/sdk/openapi/api/data/JHDataApiExecution.java" beforeDir="false" afterPath="$PROJECT_DIR$/jhinno-openapi-java-sdk/src/main/java/com/jhinno/sdk/openapi/api/data/JHDataApiExecution.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/com/jhinno/sdk/openapi/api/data/SpoolerDataInfo.java" beforeDir="false" afterPath="$PROJECT_DIR$/jhinno-openapi-java-sdk/src/main/java/com/jhinno/sdk/openapi/api/data/SpoolerDataInfo.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/com/jhinno/sdk/openapi/api/file/FileInfo.java" beforeDir="false" afterPath="$PROJECT_DIR$/jhinno-openapi-java-sdk/src/main/java/com/jhinno/sdk/openapi/api/file/FileInfo.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/com/jhinno/sdk/openapi/api/file/FilePathConstant.java" beforeDir="false" afterPath="$PROJECT_DIR$/jhinno-openapi-java-sdk/src/main/java/com/jhinno/sdk/openapi/api/file/FilePathConstant.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/com/jhinno/sdk/openapi/api/file/JHFileApiExecution.java" beforeDir="false" afterPath="$PROJECT_DIR$/jhinno-openapi-java-sdk/src/main/java/com/jhinno/sdk/openapi/api/file/JHFileApiExecution.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/com/jhinno/sdk/openapi/api/job/JHJobApiExecution.java" beforeDir="false" afterPath="$PROJECT_DIR$/jhinno-openapi-java-sdk/src/main/java/com/jhinno/sdk/openapi/api/job/JHJobApiExecution.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/com/jhinno/sdk/openapi/api/job/JobActionEnum.java" beforeDir="false" afterPath="$PROJECT_DIR$/jhinno-openapi-java-sdk/src/main/java/com/jhinno/sdk/openapi/api/job/JobActionEnum.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/com/jhinno/sdk/openapi/api/job/JobHistoryInfo.java" beforeDir="false" afterPath="$PROJECT_DIR$/jhinno-openapi-java-sdk/src/main/java/com/jhinno/sdk/openapi/api/job/JobHistoryInfo.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/com/jhinno/sdk/openapi/api/job/JobInfo.java" beforeDir="false" afterPath="$PROJECT_DIR$/jhinno-openapi-java-sdk/src/main/java/com/jhinno/sdk/openapi/api/job/JobInfo.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/com/jhinno/sdk/openapi/api/job/JobPathConstant.java" beforeDir="false" afterPath="$PROJECT_DIR$/jhinno-openapi-java-sdk/src/main/java/com/jhinno/sdk/openapi/api/job/JobPathConstant.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/com/jhinno/sdk/openapi/api/job/JobStatusEnum.java" beforeDir="false" afterPath="$PROJECT_DIR$/jhinno-openapi-java-sdk/src/main/java/com/jhinno/sdk/openapi/api/job/JobStatusEnum.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/com/jhinno/sdk/openapi/api/job/JobsActionEnum.java" beforeDir="false" afterPath="$PROJECT_DIR$/jhinno-openapi-java-sdk/src/main/java/com/jhinno/sdk/openapi/api/job/JobsActionEnum.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/com/jhinno/sdk/openapi/api/job/PageJobInfo.java" beforeDir="false" afterPath="$PROJECT_DIR$/jhinno-openapi-java-sdk/src/main/java/com/jhinno/sdk/openapi/api/job/PageJobInfo.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/com/jhinno/sdk/openapi/api/job/StageInfo.java" beforeDir="false" afterPath="$PROJECT_DIR$/jhinno-openapi-java-sdk/src/main/java/com/jhinno/sdk/openapi/api/job/StageInfo.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/com/jhinno/sdk/openapi/api/organization/AddUpdateDepartment.java" beforeDir="false" afterPath="$PROJECT_DIR$/jhinno-openapi-java-sdk/src/main/java/com/jhinno/sdk/openapi/api/organization/AddUpdateDepartment.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/com/jhinno/sdk/openapi/api/organization/AddUpdateUserInfo.java" beforeDir="false" afterPath="$PROJECT_DIR$/jhinno-openapi-java-sdk/src/main/java/com/jhinno/sdk/openapi/api/organization/AddUpdateUserInfo.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/com/jhinno/sdk/openapi/api/organization/DepartmentPathConstant.java" beforeDir="false" afterPath="$PROJECT_DIR$/jhinno-openapi-java-sdk/src/main/java/com/jhinno/sdk/openapi/api/organization/DepartmentPathConstant.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/com/jhinno/sdk/openapi/api/organization/JHDepartmentApiExecution.java" beforeDir="false" afterPath="$PROJECT_DIR$/jhinno-openapi-java-sdk/src/main/java/com/jhinno/sdk/openapi/api/organization/JHDepartmentApiExecution.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/com/jhinno/sdk/openapi/api/organization/JHUserApiExecution.java" beforeDir="false" afterPath="$PROJECT_DIR$/jhinno-openapi-java-sdk/src/main/java/com/jhinno/sdk/openapi/api/organization/JHUserApiExecution.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/com/jhinno/sdk/openapi/api/organization/UpdateUserPasswordType.java" beforeDir="false" afterPath="$PROJECT_DIR$/jhinno-openapi-java-sdk/src/main/java/com/jhinno/sdk/openapi/api/organization/UpdateUserPasswordType.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/com/jhinno/sdk/openapi/api/organization/UserInfo.java" beforeDir="false" afterPath="$PROJECT_DIR$/jhinno-openapi-java-sdk/src/main/java/com/jhinno/sdk/openapi/api/organization/UserInfo.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/com/jhinno/sdk/openapi/api/organization/UserPathConstant.java" beforeDir="false" afterPath="$PROJECT_DIR$/jhinno-openapi-java-sdk/src/main/java/com/jhinno/sdk/openapi/api/organization/UserPathConstant.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/com/jhinno/sdk/openapi/client/DefaultHttpClientConfig.java" beforeDir="false" afterPath="$PROJECT_DIR$/jhinno-openapi-java-sdk/src/main/java/com/jhinno/sdk/openapi/client/DefaultHttpClientConfig.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/com/jhinno/sdk/openapi/client/JHApiClient.java" beforeDir="false" afterPath="$PROJECT_DIR$/jhinno-openapi-java-sdk/src/main/java/com/jhinno/sdk/openapi/client/JHApiClient.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/test/java/com/jhinno/sdk/openapi/test/JHClientConfig.java" beforeDir="false" afterPath="$PROJECT_DIR$/jhinno-openapi-java-sdk/src/test/java/com/jhinno/sdk/openapi/test/JHClientConfig.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/test/java/com/jhinno/sdk/openapi/test/app/AppApiTest.java" beforeDir="false" afterPath="$PROJECT_DIR$/jhinno-openapi-java-sdk/src/test/java/com/jhinno/sdk/openapi/test/app/AppApiTest.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/test/java/com/jhinno/sdk/openapi/test/auth/AuthApiTest.java" beforeDir="false" afterPath="$PROJECT_DIR$/jhinno-openapi-java-sdk/src/test/java/com/jhinno/sdk/openapi/test/auth/AuthApiTest.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/test/java/com/jhinno/sdk/openapi/test/data/DataApiTest.java" beforeDir="false" afterPath="$PROJECT_DIR$/jhinno-openapi-java-sdk/src/test/java/com/jhinno/sdk/openapi/test/data/DataApiTest.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/test/java/com/jhinno/sdk/openapi/test/file/FileApiTest.java" beforeDir="false" afterPath="$PROJECT_DIR$/jhinno-openapi-java-sdk/src/test/java/com/jhinno/sdk/openapi/test/file/FileApiTest.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/test/java/com/jhinno/sdk/openapi/test/job/JobApiTest.java" beforeDir="false" afterPath="$PROJECT_DIR$/jhinno-openapi-java-sdk/src/test/java/com/jhinno/sdk/openapi/test/job/JobApiTest.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/test/java/com/jhinno/sdk/openapi/test/organization/DepartmentApiTest.java" beforeDir="false" afterPath="$PROJECT_DIR$/jhinno-openapi-java-sdk/src/test/java/com/jhinno/sdk/openapi/test/organization/DepartmentApiTest.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/test/java/com/jhinno/sdk/openapi/test/organization/UserApiTest.java" beforeDir="false" afterPath="$PROJECT_DIR$/jhinno-openapi-java-sdk/src/test/java/com/jhinno/sdk/openapi/test/organization/UserApiTest.java" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
||||
<option name="LAST_RESOLUTION" value="IGNORE" />
|
||||
</component>
|
||||
<component name="FileTemplateManagerImpl">
|
||||
<option name="RECENT_TEMPLATES">
|
||||
<list>
|
||||
<option value="Class" />
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
<component name="Git.Settings">
|
||||
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
||||
</component>
|
||||
<component name="MarkdownSettingsMigration">
|
||||
<option name="stateVersion" value="1" />
|
||||
</component>
|
||||
<component name="MavenImportPreferences">
|
||||
<option name="generalSettings">
|
||||
<MavenGeneralSettings>
|
||||
<option name="mavenHome" value="$PROJECT_DIR$/../../../Program Files/apache-maven-3.8.5" />
|
||||
</MavenGeneralSettings>
|
||||
</option>
|
||||
</component>
|
||||
<component name="ProjectColorInfo"><![CDATA[{
|
||||
"associatedIndex": 2
|
||||
}]]></component>
|
||||
<component name="ProjectId" id="2hPCZwckhZLgLVwKfxXQFZKQwSd" />
|
||||
<component name="ProjectViewState">
|
||||
<option name="openDirectoriesWithSingleClick" value="true" />
|
||||
<option name="showLibraryContents" value="true" />
|
||||
</component>
|
||||
<component name="PropertiesComponent"><![CDATA[{
|
||||
"keyToString": {
|
||||
"RunOnceActivity.OpenProjectViewOnStart": "true",
|
||||
"RunOnceActivity.ShowReadmeOnStart": "true",
|
||||
"WebServerToolWindowFactoryState": "false",
|
||||
"git-widget-placeholder": "feat-20240604-springboot-starter",
|
||||
"node.js.detected.package.eslint": "true",
|
||||
"node.js.detected.package.tslint": "true",
|
||||
"node.js.selected.package.eslint": "(autodetect)",
|
||||
"node.js.selected.package.tslint": "(autodetect)",
|
||||
"nodejs_package_manager_path": "npm",
|
||||
"settings.editor.selected.configurable": "MavenSettings",
|
||||
"vue.rearranger.settings.migration": "true"
|
||||
}
|
||||
}]]></component>
|
||||
<component name="RunAnythingCache">
|
||||
<option name="myCommands">
|
||||
<command value="mvn dependency:sources -DdownloadSources=true -DdownloadJavadocs=true" />
|
||||
</option>
|
||||
</component>
|
||||
<component name="RunManager" selected="JUnit.FileApiTest.testGetFileList">
|
||||
<configuration name="FileApiTest.testGetFileList" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
|
||||
<module name="jhinno-openapi-java-sdk" />
|
||||
<extension name="coverage">
|
||||
<pattern>
|
||||
<option name="PATTERN" value="com.jhinno.sdk.openapi.test.file.*" />
|
||||
<option name="ENABLED" value="true" />
|
||||
</pattern>
|
||||
</extension>
|
||||
<option name="PACKAGE_NAME" value="com.jhinno.sdk.openapi.test.file" />
|
||||
<option name="MAIN_CLASS_NAME" value="com.jhinno.sdk.openapi.test.file.FileApiTest" />
|
||||
<option name="METHOD_NAME" value="testGetFileList" />
|
||||
<option name="TEST_OBJECT" value="method" />
|
||||
<method v="2">
|
||||
<option name="Make" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
<configuration name="FileApiTest.testMkdir" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
|
||||
<module name="jhinno-openapi-java-sdk" />
|
||||
<extension name="coverage">
|
||||
<pattern>
|
||||
<option name="PATTERN" value="com.jhinno.sdk.openapi.test.file.*" />
|
||||
<option name="ENABLED" value="true" />
|
||||
</pattern>
|
||||
</extension>
|
||||
<option name="PACKAGE_NAME" value="com.jhinno.sdk.openapi.test.file" />
|
||||
<option name="MAIN_CLASS_NAME" value="com.jhinno.sdk.openapi.test.file.FileApiTest" />
|
||||
<option name="METHOD_NAME" value="testMkdir" />
|
||||
<option name="TEST_OBJECT" value="method" />
|
||||
<method v="2">
|
||||
<option name="Make" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
<configuration name="FileApiTest.testRenameFile" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
|
||||
<module name="jhinno-openapi-java-sdk" />
|
||||
<extension name="coverage">
|
||||
<pattern>
|
||||
<option name="PATTERN" value="com.jhinno.sdk.openapi.test.file.*" />
|
||||
<option name="ENABLED" value="true" />
|
||||
</pattern>
|
||||
</extension>
|
||||
<option name="PACKAGE_NAME" value="com.jhinno.sdk.openapi.test.file" />
|
||||
<option name="MAIN_CLASS_NAME" value="com.jhinno.sdk.openapi.test.file.FileApiTest" />
|
||||
<option name="METHOD_NAME" value="testRenameFile" />
|
||||
<option name="TEST_OBJECT" value="method" />
|
||||
<method v="2">
|
||||
<option name="Make" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
<recent_temporary>
|
||||
<list>
|
||||
<item itemvalue="JUnit.FileApiTest.testGetFileList" />
|
||||
<item itemvalue="JUnit.FileApiTest.testMkdir" />
|
||||
<item itemvalue="JUnit.FileApiTest.testRenameFile" />
|
||||
</list>
|
||||
</recent_temporary>
|
||||
</component>
|
||||
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
|
||||
<component name="TaskManager">
|
||||
<task active="true" id="Default" summary="Default task">
|
||||
<changelist id="f56ca05b-44c8-4e8a-9296-ce5820371bc0" name="Changes" comment="" />
|
||||
<created>1717486386547</created>
|
||||
<option name="number" value="Default" />
|
||||
<option name="presentableId" value="Default" />
|
||||
<updated>1717486386547</updated>
|
||||
<workItem from="1717486388258" duration="12165000" />
|
||||
</task>
|
||||
<servers />
|
||||
</component>
|
||||
<component name="TypeScriptGeneratedFilesManager">
|
||||
<option name="version" value="3" />
|
||||
</component>
|
||||
<component name="XDebuggerManager">
|
||||
<breakpoint-manager>
|
||||
<breakpoints>
|
||||
<line-breakpoint enabled="true" type="java-line">
|
||||
<url>file://$PROJECT_DIR$/jhinno-openapi-java-sdk/src/test/java/com/jhinno/sdk/openapi/test/file/FileApiTest.java</url>
|
||||
<line>52</line>
|
||||
<option name="timeStamp" value="9" />
|
||||
</line-breakpoint>
|
||||
</breakpoints>
|
||||
</breakpoint-manager>
|
||||
</component>
|
||||
</project>
|
||||
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.1</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.1</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
|
||||
*
|
||||
@@ -112,9 +135,9 @@ public class JHApiExecution {
|
||||
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;
|
||||
}
|
||||
@@ -7,7 +7,10 @@ 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 org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.time.DateFormatUtils;
|
||||
import org.apache.http.Header;
|
||||
import org.apache.http.HttpEntity;
|
||||
import org.apache.http.HttpResponse;
|
||||
import org.apache.http.HttpStatus;
|
||||
@@ -33,7 +36,12 @@ import java.nio.charset.StandardCharsets;
|
||||
import java.security.KeyManagementException;
|
||||
import java.security.KeyStoreException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.sql.Timestamp;
|
||||
import java.text.DateFormat;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
import java.util.TimeZone;
|
||||
@@ -47,9 +55,9 @@ import java.util.TimeZone;
|
||||
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;
|
||||
@@ -66,10 +74,14 @@ public class JHApiClient {
|
||||
* @param baseUrl 景行接口服务的基础地址
|
||||
* @param closeableHttpClient 可关闭的HTTP客户端
|
||||
*/
|
||||
private JHApiClient(CloseableHttpClient closeableHttpClient, String baseUrl) {
|
||||
private 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.requestConfig = RequestConfig.custom().setSocketTimeout(DefaultHttpClientConfig.SOCKET_TIMEOUT).setConnectTimeout(DefaultHttpClientConfig.CONNECT_TIMEOUT).setConnectionRequestTimeout(DefaultHttpClientConfig.CONNECTION_REQUEST_TIMEOUT).build();
|
||||
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));
|
||||
@@ -93,22 +105,23 @@ public class 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(DefaultHttpClientConfig.MAX_TOTAL, DefaultHttpClientConfig.MAX_PER_ROUT);
|
||||
return build(client, baseUrl, DefaultHttpClientConfig.SOCKET_TIMEOUT, DefaultHttpClientConfig.CONNECT_TIMEOUT, DefaultHttpClientConfig.CONNECTION_REQUEST_TIMEOUT);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -119,8 +132,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 +239,29 @@ public class JHApiClient {
|
||||
|
||||
}
|
||||
|
||||
|
||||
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.1</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.1</version>
|
||||
</parent>
|
||||
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.jhinno</groupId>
|
||||
<artifactId>jhinno-openapi-java-sdk</artifactId>
|
||||
<version>1.0.1</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.1</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