mirror of
https://github.com/yanlongqi/jhinno-openapi-java-sdk.git
synced 2026-03-22 06:15:10 +08:00
Compare commits
4 Commits
release-2.
...
release-2.
| Author | SHA1 | Date | |
|---|---|---|---|
| 7096ec5175 | |||
|
|
4d70ec9bd6 | ||
|
|
0cdae4fba8 | ||
|
|
73691e1373 |
@@ -13,7 +13,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.jhinno</groupId>
|
<groupId>com.jhinno</groupId>
|
||||||
<artifactId>jhinno-openapi-java-sdk-parent</artifactId>
|
<artifactId>jhinno-openapi-java-sdk-parent</artifactId>
|
||||||
<version>2.0.6</version>
|
<version>2.0.8</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ public class JHJobApiExecution extends JHApiExecutionAbstract {
|
|||||||
params.put("status", status.getStatus());
|
params.put("status", status.getStatus());
|
||||||
}
|
}
|
||||||
if (CollectionUtil.isNotEmpty(condition)) {
|
if (CollectionUtil.isNotEmpty(condition)) {
|
||||||
params.put("condition", JsonUtil.objectToString(params));
|
params.put("condition", JsonUtil.objectToString(condition));
|
||||||
}
|
}
|
||||||
String path = JHApiClient.getUrl(JobPathConstant.JOB_PAGE_PATH, params);
|
String path = JHApiClient.getUrl(JobPathConstant.JOB_PAGE_PATH, params);
|
||||||
return execution.get(path, username, new TypeReference<ResponseResult<PageJobInfo>>() {
|
return execution.get(path, username, new TypeReference<ResponseResult<PageJobInfo>>() {
|
||||||
@@ -155,7 +155,7 @@ public class JHJobApiExecution extends JHApiExecutionAbstract {
|
|||||||
params.put("status", status.getStatus());
|
params.put("status", status.getStatus());
|
||||||
}
|
}
|
||||||
if (CollectionUtil.isNotEmpty(condition)) {
|
if (CollectionUtil.isNotEmpty(condition)) {
|
||||||
params.put("condition", JsonUtil.objectToString(params));
|
params.put("condition", JsonUtil.objectToString(condition));
|
||||||
}
|
}
|
||||||
|
|
||||||
String path = JHApiClient.getUrl(JobPathConstant.JOB_HISTORY_JOBS_PATH, params);
|
String path = JHApiClient.getUrl(JobPathConstant.JOB_HISTORY_JOBS_PATH, params);
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ public class JHClientConfig {
|
|||||||
public static final JHApiRequestHandler REQUEST_HANDLER = new JHApiRequestHandler() {
|
public static final JHApiRequestHandler REQUEST_HANDLER = new JHApiRequestHandler() {
|
||||||
@Override
|
@Override
|
||||||
public String getCurrentUserName() {
|
public String getCurrentUserName() {
|
||||||
return "yanlongqi";
|
return "lqyan";
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -2,12 +2,11 @@ package com.jhinno.sdk.openapi.test.job;
|
|||||||
|
|
||||||
import com.jhinno.sdk.openapi.api.job.*;
|
import com.jhinno.sdk.openapi.api.job.*;
|
||||||
import com.jhinno.sdk.openapi.test.JHClientConfig;
|
import com.jhinno.sdk.openapi.test.JHClientConfig;
|
||||||
|
import com.jhinno.sdk.openapi.utils.JsonUtil;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.*;
|
||||||
import java.util.HashMap;
|
import java.util.stream.Collectors;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 作业相关测试类
|
* 作业相关测试类
|
||||||
@@ -39,12 +38,35 @@ public class JobApiTest {
|
|||||||
System.out.println(execution.getJobFilesById("jhadmin", "42"));
|
System.out.println(execution.getJobFilesById("jhadmin", "42"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public Map<String, Object> getCondition(List<String> ids) {
|
||||||
|
List<Map<String, Object>> filterItem = ids.stream().map(t -> {
|
||||||
|
Map<String, Object> filterEnum = new HashMap<>();
|
||||||
|
filterEnum.put("field", "id");
|
||||||
|
filterEnum.put("operator", "eq");
|
||||||
|
filterEnum.put("ignoreCase", true);
|
||||||
|
filterEnum.put("value", t);
|
||||||
|
filterEnum.put("type", "string");
|
||||||
|
return filterEnum;
|
||||||
|
}).collect(Collectors.toList());
|
||||||
|
|
||||||
|
Map<String, Object> filters = new HashMap<>();
|
||||||
|
filters.put("type", "enum");
|
||||||
|
filters.put("operator", "contains");
|
||||||
|
filters.put("ignoreCase", true);
|
||||||
|
filters.put("logic", "or");
|
||||||
|
filters.put("field", "id");
|
||||||
|
filters.put("filters", filterItem);
|
||||||
|
return filters;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 测试分页查询作业列表
|
* 测试分页查询作业列表
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testGetJobPage() {
|
public void testGetJobPage() {
|
||||||
PageJobInfo pages = execution.getJobPage("jhadmin", 1, 5, null, JobStatusEnum.DONE, null);
|
List<String> ids = Arrays.asList("192", "187");
|
||||||
|
PageJobInfo pages = execution.getJobPage("lqyan", 1, 5, null, (JobStatusEnum) null, getCondition(ids));
|
||||||
System.out.println(pages);
|
System.out.println(pages);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -86,7 +108,7 @@ public class JobApiTest {
|
|||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testGetJobsByIds() {
|
public void testGetJobsByIds() {
|
||||||
System.out.println(execution.getJobsByIds("jhadmin", Arrays.asList("42", "41")));
|
System.out.println(JsonUtil.objectToString(execution.getJobsByIds("jhadmin", Arrays.asList("1591", "162"))));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>cim.jhinno</groupId>
|
<groupId>cim.jhinno</groupId>
|
||||||
<artifactId>jhinno-openapi-sdk-spring-boot-example</artifactId>
|
<artifactId>jhinno-openapi-sdk-spring-boot-example</artifactId>
|
||||||
<version>2.0.6</version>
|
<version>2.0.7</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<name>Jhinno OpenAPI SDK for Java SpringBoot Example</name>
|
<name>Jhinno OpenAPI SDK for Java SpringBoot Example</name>
|
||||||
<description>The Jhinno OpenAPI SDK for Java used for accessing Jhinno OpenApi Service</description>
|
<description>The Jhinno OpenAPI SDK for Java used for accessing Jhinno OpenApi Service</description>
|
||||||
@@ -22,7 +22,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.jhinno</groupId>
|
<groupId>com.jhinno</groupId>
|
||||||
<artifactId>jhinno-openapi-sdk-spring-boot-starter</artifactId>
|
<artifactId>jhinno-openapi-sdk-spring-boot-starter</artifactId>
|
||||||
<version>2.0.6</version>
|
<version>2.0.8</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.jhinno</groupId>
|
<groupId>com.jhinno</groupId>
|
||||||
<artifactId>jhinno-openapi-java-sdk-parent</artifactId>
|
<artifactId>jhinno-openapi-java-sdk-parent</artifactId>
|
||||||
<version>2.0.6</version>
|
<version>2.0.8</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|||||||
2
pom.xml
2
pom.xml
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
<groupId>com.jhinno</groupId>
|
<groupId>com.jhinno</groupId>
|
||||||
<artifactId>jhinno-openapi-java-sdk-parent</artifactId>
|
<artifactId>jhinno-openapi-java-sdk-parent</artifactId>
|
||||||
<version>2.0.6</version>
|
<version>2.0.8</version>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
<name>Jhinno OpenAPI SDK for Java parent</name>
|
<name>Jhinno OpenAPI SDK for Java parent</name>
|
||||||
<description>The Jhinno OpenAPI SDK for Java used for accessing Jhinno OpenApi Service</description>
|
<description>The Jhinno OpenAPI SDK for Java used for accessing Jhinno OpenApi Service</description>
|
||||||
|
|||||||
Reference in New Issue
Block a user