mirror of
https://github.com/yanlongqi/jhinno-openapi-java-sdk.git
synced 2026-03-22 06:15:10 +08:00
feat(会话连接): 支持会话连接支持获取 WEB 会话的URL
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>jhinno-openapi-java-sdk</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<version>2.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>
|
||||
@@ -14,7 +14,7 @@
|
||||
<parent>
|
||||
<groupId>com.jhinno</groupId>
|
||||
<artifactId>jhinno-openapi-java-sdk-parent</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<version>2.0.1</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
|
||||
@@ -86,12 +86,14 @@ public class JHAppApiExecution extends JHApiExecution {
|
||||
if (CollectionUtil.isEmpty(data)) {
|
||||
throw new ServiceException(path, 500, "获取到的会话信息为空");
|
||||
}
|
||||
|
||||
AppStartedInfo appStartedInfo = data.get(0);
|
||||
appStartedInfo.setWebSessionUrl(getWebSessionUrl(username, appStartedInfo.getDesktopId()));
|
||||
return appStartedInfo;
|
||||
}
|
||||
|
||||
String webSessionUrlPath = AppPathConstant.WEB_SESSION_URL_PATH.replace("{desktopId}", appStartedInfo.getDesktopId());
|
||||
public String getWebSessionUrl(String username, String desktopId) {
|
||||
String webSessionUrlPath = AppPathConstant.WEB_SESSION_URL_PATH.replace("{desktopId}", desktopId);
|
||||
String url = getJhApiClient().getUrl(webSessionUrlPath);
|
||||
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
AuthType authType = getAuthType();
|
||||
if (authType == AuthType.TOKEN_MODE) {
|
||||
@@ -103,9 +105,7 @@ public class JHAppApiExecution extends JHApiExecution {
|
||||
params.put(CommonConstant.CURRENT_TIME_MILLIS, currentTimeMillis);
|
||||
params.put(CommonConstant.SIGNATURE, getsSignature(username, currentTimeMillis));
|
||||
}
|
||||
url = JHApiClient.getUrl(url, params);
|
||||
appStartedInfo.setWebSessionUrl(url);
|
||||
return appStartedInfo;
|
||||
return JHApiClient.getUrl(url, params);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -298,7 +298,10 @@ public class JHAppApiExecution extends JHApiExecution {
|
||||
if (CollectionUtil.isEmpty(list)) {
|
||||
throw new ServiceException(path, 500, "获取到的会话信息为空");
|
||||
}
|
||||
return list.get(0);
|
||||
|
||||
AppStartedInfo appStartedInfo = list.get(0);
|
||||
appStartedInfo.setWebSessionUrl(getWebSessionUrl(username, sessionId));
|
||||
return appStartedInfo;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<parent>
|
||||
<groupId>com.jhinno</groupId>
|
||||
<artifactId>jhinno-openapi-java-sdk-parent</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<version>2.0.1</version>
|
||||
</parent>
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
<dependency>
|
||||
<groupId>com.jhinno</groupId>
|
||||
<artifactId>jhinno-openapi-java-sdk</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<version>2.0.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
||||
2
pom.xml
2
pom.xml
@@ -6,7 +6,7 @@
|
||||
|
||||
<groupId>com.jhinno</groupId>
|
||||
<artifactId>jhinno-openapi-java-sdk-parent</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<version>2.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>
|
||||
|
||||
Reference in New Issue
Block a user