Skip to content

Commit 72021e9

Browse files
author
peggypig
committed
add ubill module
1 parent 958b4f4 commit 72021e9

16 files changed

Lines changed: 1194 additions & 0 deletions

pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
<module>ucloud-sdk-java-censor</module>
2525
<module>ucloud-sdk-java-ocr</module>
2626
<module>ucloud-sdk-java-usms</module>
27+
<module>ucloud-sdk-java-ubill</module>
2728
</modules>
2829

2930
<name>ucloud-sdk-java</name>

ucloud-sdk-java-ubill/pom.xml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<parent>
6+
<artifactId>ucloud-sdk-java</artifactId>
7+
<groupId>cn.ucloud</groupId>
8+
<version>0.8.2.8-release</version>
9+
</parent>
10+
<modelVersion>4.0.0</modelVersion>
11+
12+
<artifactId>ucloud-sdk-java-ubill</artifactId>
13+
14+
<dependencies>
15+
<dependency>
16+
<groupId>cn.ucloud</groupId>
17+
<artifactId>ucloud-sdk-java-common</artifactId>
18+
<version>0.8.2.8-release</version>
19+
</dependency>
20+
21+
22+
<dependency>
23+
<groupId>org.hibernate</groupId>
24+
<artifactId>hibernate-validator</artifactId>
25+
</dependency>
26+
27+
<dependency>
28+
<groupId>junit</groupId>
29+
<artifactId>junit</artifactId>
30+
<scope>test</scope>
31+
</dependency>
32+
33+
<dependency>
34+
<groupId>org.slf4j</groupId>
35+
<artifactId>slf4j-api</artifactId>
36+
</dependency>
37+
38+
<dependency>
39+
<groupId>org.slf4j</groupId>
40+
<artifactId>slf4j-simple</artifactId>
41+
<scope>provided</scope>
42+
</dependency>
43+
44+
<dependency>
45+
<groupId>org.skyscreamer</groupId>
46+
<artifactId>jsonassert</artifactId>
47+
<scope>test</scope>
48+
</dependency>
49+
</dependencies>
50+
</project>
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
package cn.ucloud.ubill.client;
2+
3+
import cn.ucloud.common.client.DefaultUcloudClient;
4+
import cn.ucloud.common.handler.UcloudHandler;
5+
import cn.ucloud.common.http.UcloudHttp;
6+
import cn.ucloud.common.http.UcloudHttpImpl;
7+
import cn.ucloud.common.pojo.UcloudConfig;
8+
import cn.ucloud.ubill.model.DescribeOrderDetailInfoParam;
9+
import cn.ucloud.ubill.model.DescribeOrderDetailInfoResult;
10+
import cn.ucloud.ubill.model.GetBillDataFileUrlParam;
11+
import cn.ucloud.ubill.model.GetBillDataFileUrlResult;
12+
13+
/**
14+
* @author: codezhang
15+
* @date: 2020/2/13 11:59 上午
16+
* @describe:
17+
**/
18+
public class DefaultUBillClient extends DefaultUcloudClient implements UBillClient {
19+
20+
public DefaultUBillClient(UcloudConfig config) {
21+
super(config);
22+
}
23+
24+
@Override
25+
public DescribeOrderDetailInfoResult describeOrderDetailInfo(DescribeOrderDetailInfoParam param) throws Exception {
26+
UcloudHttp http = new UcloudHttpImpl(DescribeOrderDetailInfoResult.class);
27+
return (DescribeOrderDetailInfoResult) http.doPost(param, config, null);
28+
}
29+
30+
@Override
31+
public void describeOrderDetailInfo(DescribeOrderDetailInfoParam param, UcloudHandler<DescribeOrderDetailInfoResult> handler, Boolean... asyncFlag) {
32+
UcloudHttp http = new UcloudHttpImpl(DescribeOrderDetailInfoResult.class);
33+
try {
34+
http.doPost(param, config, handler, asyncFlag);
35+
} catch (Exception e) {
36+
}
37+
}
38+
39+
@Override
40+
public GetBillDataFileUrlResult getBillDataFileUrl(GetBillDataFileUrlParam param) throws Exception {
41+
UcloudHttp http = new UcloudHttpImpl(GetBillDataFileUrlResult.class);
42+
return (GetBillDataFileUrlResult) http.doPost(param, config, null);
43+
}
44+
45+
@Override
46+
public void getBillDataFileUrl(GetBillDataFileUrlParam param, UcloudHandler<GetBillDataFileUrlResult> handler, Boolean... asyncFlag) {
47+
UcloudHttp http = new UcloudHttpImpl(GetBillDataFileUrlResult.class);
48+
try {
49+
http.doPost(param, config, handler, asyncFlag);
50+
} catch (Exception e) {
51+
}
52+
}
53+
}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
package cn.ucloud.ubill.client;
2+
3+
import cn.ucloud.common.client.UcloudClient;
4+
import cn.ucloud.common.handler.UcloudHandler;
5+
import cn.ucloud.ubill.model.DescribeOrderDetailInfoParam;
6+
import cn.ucloud.ubill.model.DescribeOrderDetailInfoResult;
7+
import cn.ucloud.ubill.model.GetBillDataFileUrlParam;
8+
import cn.ucloud.ubill.model.GetBillDataFileUrlResult;
9+
10+
/**
11+
* @author: codezhang
12+
* @date: 2020/2/13 10:12 上午
13+
* @describe:
14+
**/
15+
public interface UBillClient extends UcloudClient {
16+
17+
/**
18+
* 获取订单信息
19+
* @param param 获取订单信息参数对象
20+
* @return 订单信息
21+
* @throws Exception
22+
*/
23+
DescribeOrderDetailInfoResult describeOrderDetailInfo(DescribeOrderDetailInfoParam param) throws Exception;
24+
25+
/**
26+
* 获取订单信息(回调)
27+
* @param param 获取订单信息参数对象
28+
* @param handler 回调接口
29+
* @param asyncFlag 是否异步
30+
*/
31+
void describeOrderDetailInfo(DescribeOrderDetailInfoParam param, UcloudHandler<DescribeOrderDetailInfoResult> handler,
32+
Boolean... asyncFlag);
33+
34+
/**
35+
* 生成账单数据文件下载的 url
36+
* @param param 参数对象
37+
* @return 结果对象
38+
* @throws Exception
39+
*/
40+
GetBillDataFileUrlResult getBillDataFileUrl(GetBillDataFileUrlParam param) throws Exception;
41+
42+
/**
43+
* 生成账单数据文件下载的 url(回调)
44+
* @param param 参数对象
45+
* @param handler 回调接口
46+
* @param asyncFlag 是否异步
47+
*/
48+
void getBillDataFileUrl(GetBillDataFileUrlParam param, UcloudHandler<GetBillDataFileUrlResult> handler,
49+
Boolean... asyncFlag);
50+
}

0 commit comments

Comments
 (0)