-
Notifications
You must be signed in to change notification settings - Fork 5
/
NsTest.java
162 lines (152 loc) · 5.14 KB
/
NsTest.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
package ai.bianjie.avatasdktest.evm;
import ai.bianjie.avatasdk.AvataClient;
import ai.bianjie.avatasdk.model.PublicResponse;
import ai.bianjie.avatasdk.model.evm.ns.*;
import ai.bianjie.avatasdktest.AvataClientTest;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
public class NsTest {
private AvataClient client;
@BeforeEach
public void init() {
client = AvataClientTest.getAvataClient();
}
@Test
//请求注册域名接口示例
void TestRegisterDomain() {
RegisterDomainReq req = new RegisterDomainReq();
req.setName("");
req.setOwner("");
req.setDuration(1);
req.setOperationId("registerdomain");
try {
PublicResponse res = client.evm.ns.registerDomain(req);
System.out.println(res.getData());
System.out.println("no ai.bianjie.avatasdk.exception");
} catch (Exception e) {
System.out.println(e);
e.printStackTrace();
}
}
@Test
//请求查询域名接口示例
void TestQueryDomain() {
QueryDomainReq req = new QueryDomainReq();
req.setName("");
try {
QueryDomainRes res =client.evm.ns.queryDomain(req);
System.out.println(res.getData());
System.out.println("no ai.bianjie.avatasdk.exception");
} catch (Exception e) {
System.out.println(e);
e.printStackTrace();
}
}
@Test
//请求查询用户域名接口示例
void TestQueryOwnerDomain() {
QueryOwnerDomainReq req = new QueryOwnerDomainReq();
req.setPageKey("");
req.setLimit("1");
req.setName("");
req.setTld("");
req.setCountTotal("1");
try {
QueryOwnerDomainRes res = client.evm.ns.queryOwnerDomain(req,
"");
System.out.println(res.getData());
System.out.println("no ai.bianjie.avatasdk.exception");
} catch (Exception e) {
System.out.println(e);
e.printStackTrace();
}
}
@Test
//请求转让域名接口示例
void TestTransferDomain() {
TransferDomainReq req = new TransferDomainReq();
req.setRecipient("");
req.setOperationId("transferDomian");
try {
PublicResponse res = client.evm.ns.transferDomain(req,
"",
"");
System.out.println(res.getData());
System.out.println("no ai.bianjie.avatasdk.exception");
} catch (Exception e) {
System.out.println(e);
e.printStackTrace();
}
}
@Test
//请求设置域名解析接口示例
void TestResolveDomain() {
ResolveDomainReq req = new ResolveDomainReq();
req.setResolveType(1);
ResolveDomainReq.AddrDTO addrDTO = new ResolveDomainReq.AddrDTO();
req.setAddrDTO(addrDTO);
addrDTO.setAddrValue("");
addrDTO.setBlockChain(1002);
//req.setResolveType(2);
//ResolveDomainReq.TextDTO textDTO = new ResolveDomainReq.TextDTO();
//req.setTextDTO(textDTO);
//textDTO.setKey("");
//textDTO.setTextValue("");
req.setOperationId("resolveDomain");
try {
PublicResponse res = client.evm.ns.resolveDomain(req,
"",
"");
System.out.println(res.getData());
System.out.println("no ai.bianjie.avatasdk.exception");
} catch (Exception e) {
System.out.println(e);
e.printStackTrace();
}
}
@Test
//设置查询域名解析接口示例
void TestQueryDomainResolves() {
QueryDomainResolvesReq req = new QueryDomainResolvesReq();
req.setResolveType(0);
try {
QueryDomainResolvesRes res = client.evm.ns.queryDomainResolves(
"", req);
System.out.println(res.getData());
System.out.println("no ai.bianjie.avatasdk.exception");
} catch (Exception e) {
System.out.println(e);
e.printStackTrace();
}
}
@Test
//设置域名反向解析接口示例
void TestReverseResolveDomain() {
ReverseResolveDomainReq req = new ReverseResolveDomainReq();
req.setName("");
req.setOperationId("");
try {
PublicResponse res = client.evm.ns.reverseResolveDomain(req,
"");
System.out.println(res.getData());
System.out.println("no ai.bianjie.avatasdk.exception");
} catch (Exception e) {
System.out.println(e);
e.printStackTrace();
}
}
@Test
// 查询域名反向解析接口示例
void TestQueryReverseResolveDomain() {
try {
QueryReverseResolveDomainRes res = client.evm.ns.queryReverseResolveDomain(
"");
System.out.println(res.getData());
System.out.println("no ai.bianjie.avatasdk.exception");
} catch (
Exception e) {
System.out.println(e);
e.printStackTrace();
}
}
}