@freelog/tools-lib 0.1.91 → 0.1.94
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +20 -20
- package/README.md +103 -103
- package/dist/service-API/activities.d.ts +12 -0
- package/dist/service-API/testQualifications.d.ts +11 -0
- package/dist/tools-lib.cjs.development.js +281 -675
- package/dist/tools-lib.cjs.development.js.map +1 -1
- package/dist/tools-lib.cjs.production.min.js +1 -1
- package/dist/tools-lib.cjs.production.min.js.map +1 -1
- package/dist/tools-lib.esm.js +281 -675
- package/dist/tools-lib.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +7 -7
- package/src/service-API/activities.ts +32 -0
- package/src/service-API/captcha.ts +30 -30
- package/src/service-API/collections.ts +81 -81
- package/src/service-API/contracts.ts +84 -84
- package/src/service-API/events.ts +18 -18
- package/src/service-API/nodes.ts +65 -65
- package/src/service-API/policies.ts +39 -39
- package/src/service-API/presentables.ts +282 -282
- package/src/service-API/storages.ts +345 -345
- package/src/service-API/testQualifications.ts +31 -0
- package/src/service-API/transactions.ts +109 -109
- package/src/service-API/user.ts +188 -188
- package/src/utils/axios.ts +142 -142
- package/src/utils/format.ts +89 -89
- package/src/utils/index.ts +18 -18
- package/src/utils/predefined.ts +37 -37
- package/src/utils/regexp.ts +52 -52
- package/src/utils/tools.ts +72 -72
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import FUtil from './utils';
|
|
2
|
-
import FServiceAPI from './service-API';
|
|
3
|
-
|
|
4
|
-
export {
|
|
5
|
-
FUtil,
|
|
6
|
-
FServiceAPI,
|
|
7
|
-
};
|
|
1
|
+
import FUtil from './utils';
|
|
2
|
+
import FServiceAPI from './service-API';
|
|
3
|
+
|
|
4
|
+
export {
|
|
5
|
+
FUtil,
|
|
6
|
+
FServiceAPI,
|
|
7
|
+
};
|
|
@@ -26,3 +26,35 @@ export function find4Client(params: Find4ClientParamsType) {
|
|
|
26
26
|
params: params,
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
|
+
|
|
30
|
+
// 列出广告
|
|
31
|
+
interface AdsListParamsType {
|
|
32
|
+
skip?: number;
|
|
33
|
+
limit?: number;
|
|
34
|
+
place: 1 | 2 | 3 | 4; // 投放位置 1:顶部公告栏 2:右侧浮窗 3:概览页 4:发现页
|
|
35
|
+
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export function adsList(params: AdsListParamsType) {
|
|
39
|
+
return FUtil.Request({
|
|
40
|
+
method: 'GET',
|
|
41
|
+
url: `/v2/activities/ads/list4Client`,
|
|
42
|
+
params: params,
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// 查询广告
|
|
47
|
+
interface AdsDetailsParamsType {
|
|
48
|
+
skip?: number;
|
|
49
|
+
limit?: number;
|
|
50
|
+
place: 1 | 2 | 3 | 4; // 投放位置 1:顶部公告栏 2:右侧浮窗 3:概览页 4:发现页
|
|
51
|
+
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export function adsDetails(params: AdsDetailsParamsType) {
|
|
55
|
+
return FUtil.Request({
|
|
56
|
+
method: 'GET',
|
|
57
|
+
url: `/v2/activities/ads/find4Client`,
|
|
58
|
+
params: params,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import FUtil from '../utils';
|
|
2
|
-
|
|
3
|
-
// 发送短信或邮件验证码
|
|
4
|
-
interface SendVerificationCodeParamsType {
|
|
5
|
-
loginName: string;
|
|
6
|
-
authCodeType: 'register' | 'resetPassword' | 'activateTransactionAccount' | 'updateTransactionAccountPwd' | 'updateMobileOrEmail';
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export function sendVerificationCode(params: SendVerificationCodeParamsType) {
|
|
10
|
-
return FUtil.Request({
|
|
11
|
-
method: 'POST',
|
|
12
|
-
url: `/v2/messages/send`,
|
|
13
|
-
data: params,
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
// 校验短信或邮件验证码
|
|
18
|
-
interface VerifyVerificationCodeParamsType {
|
|
19
|
-
authCode: string;
|
|
20
|
-
address: string;
|
|
21
|
-
authCodeType: 'register' | 'resetPassword' | 'activateTransactionAccount' | 'updateTransactionAccountPwd' | 'updateMobileOrEmail';
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export function verifyVerificationCode(params: VerifyVerificationCodeParamsType): Promise<any> {
|
|
25
|
-
return FUtil.Request({
|
|
26
|
-
method: 'GET',
|
|
27
|
-
url: `/v2/messages/verify`,
|
|
28
|
-
params: params,
|
|
29
|
-
});
|
|
30
|
-
}
|
|
1
|
+
import FUtil from '../utils';
|
|
2
|
+
|
|
3
|
+
// 发送短信或邮件验证码
|
|
4
|
+
interface SendVerificationCodeParamsType {
|
|
5
|
+
loginName: string;
|
|
6
|
+
authCodeType: 'register' | 'resetPassword' | 'activateTransactionAccount' | 'updateTransactionAccountPwd' | 'updateMobileOrEmail';
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function sendVerificationCode(params: SendVerificationCodeParamsType) {
|
|
10
|
+
return FUtil.Request({
|
|
11
|
+
method: 'POST',
|
|
12
|
+
url: `/v2/messages/send`,
|
|
13
|
+
data: params,
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// 校验短信或邮件验证码
|
|
18
|
+
interface VerifyVerificationCodeParamsType {
|
|
19
|
+
authCode: string;
|
|
20
|
+
address: string;
|
|
21
|
+
authCodeType: 'register' | 'resetPassword' | 'activateTransactionAccount' | 'updateTransactionAccountPwd' | 'updateMobileOrEmail';
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function verifyVerificationCode(params: VerifyVerificationCodeParamsType): Promise<any> {
|
|
25
|
+
return FUtil.Request({
|
|
26
|
+
method: 'GET',
|
|
27
|
+
url: `/v2/messages/verify`,
|
|
28
|
+
params: params,
|
|
29
|
+
});
|
|
30
|
+
}
|
|
@@ -1,81 +1,81 @@
|
|
|
1
|
-
import FUtil from '../utils';
|
|
2
|
-
|
|
3
|
-
// 收藏资源
|
|
4
|
-
interface CollectResourceParamsType {
|
|
5
|
-
resourceId: string;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export function collectResource(params: CollectResourceParamsType) {
|
|
9
|
-
// return FUtil.Axios.post('/v2/collections/resources', params);
|
|
10
|
-
return FUtil.Request({
|
|
11
|
-
method: 'POST',
|
|
12
|
-
url: `/v2/collections/resources`,
|
|
13
|
-
data: params,
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
// 查看收藏的资源列表
|
|
18
|
-
interface CollectionResourcesParamsType {
|
|
19
|
-
skip?: number;
|
|
20
|
-
limit?: number;
|
|
21
|
-
keywords?: string;
|
|
22
|
-
resourceType?: string;
|
|
23
|
-
omitResourceType?: string;
|
|
24
|
-
resourceStatus?: 0 | 1 | 2;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export function collectionResources(params: CollectionResourcesParamsType) {
|
|
28
|
-
// return FUtil.Axios.get('/v2/collections/resources', {
|
|
29
|
-
// params
|
|
30
|
-
// });
|
|
31
|
-
return FUtil.Request({
|
|
32
|
-
method: 'GET',
|
|
33
|
-
url: `/v2/collections/resources`,
|
|
34
|
-
params: params,
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
// 删除收藏的资源
|
|
40
|
-
interface DeleteCollectResourceParamsType {
|
|
41
|
-
resourceId: string;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export function deleteCollectResource({resourceId}: DeleteCollectResourceParamsType) {
|
|
45
|
-
// return FUtil.Axios.delete(`/v2/collections/resources/${resourceId}`);
|
|
46
|
-
return FUtil.Request({
|
|
47
|
-
method: 'DELETE',
|
|
48
|
-
url: `/v2/collections/resources/${resourceId}`,
|
|
49
|
-
// params: params,
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
// 批量查询资源是否收藏
|
|
54
|
-
interface IsCollectedParamsType {
|
|
55
|
-
resourceIds: string;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export function isCollected(params: IsCollectedParamsType) {
|
|
59
|
-
// return FUtil.Axios.get('/v2/collections/resources/isCollected', {
|
|
60
|
-
// params
|
|
61
|
-
// });
|
|
62
|
-
return FUtil.Request({
|
|
63
|
-
method: 'GET',
|
|
64
|
-
url: `/v2/collections/resources/isCollected`,
|
|
65
|
-
params: params,
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
// 查询资源总收藏数量
|
|
70
|
-
interface CollectedCountParamsType {
|
|
71
|
-
resourceId: string;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
export function collectedCount({resourceId}: CollectedCountParamsType) {
|
|
75
|
-
// return FUtil.Axios.get(`/v2/collections/resources/${resourceId}/count`);
|
|
76
|
-
return FUtil.Request({
|
|
77
|
-
method: 'GET',
|
|
78
|
-
url: `/v2/collections/resources/${resourceId}/count`,
|
|
79
|
-
// params: params,
|
|
80
|
-
});
|
|
81
|
-
}
|
|
1
|
+
import FUtil from '../utils';
|
|
2
|
+
|
|
3
|
+
// 收藏资源
|
|
4
|
+
interface CollectResourceParamsType {
|
|
5
|
+
resourceId: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export function collectResource(params: CollectResourceParamsType) {
|
|
9
|
+
// return FUtil.Axios.post('/v2/collections/resources', params);
|
|
10
|
+
return FUtil.Request({
|
|
11
|
+
method: 'POST',
|
|
12
|
+
url: `/v2/collections/resources`,
|
|
13
|
+
data: params,
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// 查看收藏的资源列表
|
|
18
|
+
interface CollectionResourcesParamsType {
|
|
19
|
+
skip?: number;
|
|
20
|
+
limit?: number;
|
|
21
|
+
keywords?: string;
|
|
22
|
+
resourceType?: string;
|
|
23
|
+
omitResourceType?: string;
|
|
24
|
+
resourceStatus?: 0 | 1 | 2;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function collectionResources(params: CollectionResourcesParamsType) {
|
|
28
|
+
// return FUtil.Axios.get('/v2/collections/resources', {
|
|
29
|
+
// params
|
|
30
|
+
// });
|
|
31
|
+
return FUtil.Request({
|
|
32
|
+
method: 'GET',
|
|
33
|
+
url: `/v2/collections/resources`,
|
|
34
|
+
params: params,
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// 删除收藏的资源
|
|
40
|
+
interface DeleteCollectResourceParamsType {
|
|
41
|
+
resourceId: string;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export function deleteCollectResource({resourceId}: DeleteCollectResourceParamsType) {
|
|
45
|
+
// return FUtil.Axios.delete(`/v2/collections/resources/${resourceId}`);
|
|
46
|
+
return FUtil.Request({
|
|
47
|
+
method: 'DELETE',
|
|
48
|
+
url: `/v2/collections/resources/${resourceId}`,
|
|
49
|
+
// params: params,
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// 批量查询资源是否收藏
|
|
54
|
+
interface IsCollectedParamsType {
|
|
55
|
+
resourceIds: string;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export function isCollected(params: IsCollectedParamsType) {
|
|
59
|
+
// return FUtil.Axios.get('/v2/collections/resources/isCollected', {
|
|
60
|
+
// params
|
|
61
|
+
// });
|
|
62
|
+
return FUtil.Request({
|
|
63
|
+
method: 'GET',
|
|
64
|
+
url: `/v2/collections/resources/isCollected`,
|
|
65
|
+
params: params,
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// 查询资源总收藏数量
|
|
70
|
+
interface CollectedCountParamsType {
|
|
71
|
+
resourceId: string;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export function collectedCount({resourceId}: CollectedCountParamsType) {
|
|
75
|
+
// return FUtil.Axios.get(`/v2/collections/resources/${resourceId}/count`);
|
|
76
|
+
return FUtil.Request({
|
|
77
|
+
method: 'GET',
|
|
78
|
+
url: `/v2/collections/resources/${resourceId}/count`,
|
|
79
|
+
// params: params,
|
|
80
|
+
});
|
|
81
|
+
}
|
|
@@ -1,84 +1,84 @@
|
|
|
1
|
-
import FUtil from '../utils';
|
|
2
|
-
|
|
3
|
-
// 查看合同详情
|
|
4
|
-
interface ContractDetailsParamsType {
|
|
5
|
-
contractId: string;
|
|
6
|
-
isLoadPolicyInfo?: 0 | 1;
|
|
7
|
-
projection?: string;
|
|
8
|
-
isTranslate?: 0 | 1;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export function contractDetails({contractId, ...params}: ContractDetailsParamsType) {
|
|
12
|
-
return FUtil.Request({
|
|
13
|
-
method: 'GET',
|
|
14
|
-
url: `/v2/contracts/${contractId}`,
|
|
15
|
-
params: params,
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
// 查询合同分页列表
|
|
20
|
-
interface ContractsParamsType {
|
|
21
|
-
skip?: number;
|
|
22
|
-
limit?: number;
|
|
23
|
-
identityType: 1 | 2;
|
|
24
|
-
licensorId?: string;
|
|
25
|
-
licenseeId?: string;
|
|
26
|
-
subjectIds?: string;
|
|
27
|
-
subjectType?: 1 | 2 | 3;
|
|
28
|
-
isDefault?: number;
|
|
29
|
-
keywords?: string;
|
|
30
|
-
status?: 0 | 1 | 2; // 合同状态 0:生效中 1:已终止 2:异常的
|
|
31
|
-
authStatus?: 1 | 2 | 128; // 合同授权状态 1:正式授权 2:测试授权 128:未获得授权,多个通过'与'运算
|
|
32
|
-
order?: 'asc' | 'desc'; // asc:正序 desc:倒序
|
|
33
|
-
licenseeIdentityType?: number;
|
|
34
|
-
isLoadPolicyInfo?: 0 | 1;
|
|
35
|
-
isTranslate?: 0 | 1;
|
|
36
|
-
startDate?: string;
|
|
37
|
-
endDate?: string;
|
|
38
|
-
projection?: string;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export function contracts(params: ContractsParamsType) {
|
|
42
|
-
return FUtil.Request({
|
|
43
|
-
method: 'GET',
|
|
44
|
-
url: `/v2/contracts`,
|
|
45
|
-
params: params,
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
// 批量查询合同列表
|
|
50
|
-
interface BatchContractsParamsType {
|
|
51
|
-
contractIds?: string;
|
|
52
|
-
subjectIds?: string;
|
|
53
|
-
subjectType?: 1 | 2 | 3;
|
|
54
|
-
licenseeIdentityType?: 1 | 2 | 3;
|
|
55
|
-
licensorId?: string;
|
|
56
|
-
licenseeId?: string | number;
|
|
57
|
-
isLoadPolicyInfo?: 0 | 1;
|
|
58
|
-
projection?: string;
|
|
59
|
-
isTranslate?: 0 | 1;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export function batchContracts(params: BatchContractsParamsType) {
|
|
63
|
-
return FUtil.Request({
|
|
64
|
-
method: 'GET',
|
|
65
|
-
url: `/v2/contracts/list`,
|
|
66
|
-
params: params,
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
// 查看合同流转记录分页列表
|
|
71
|
-
interface TransitionRecordsParamsType {
|
|
72
|
-
contractId: string;
|
|
73
|
-
skip?: number;
|
|
74
|
-
limit?: number;
|
|
75
|
-
isTranslate?: 0 | 1;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
export function transitionRecords({contractId, ...params}: TransitionRecordsParamsType) {
|
|
79
|
-
return FUtil.Request({
|
|
80
|
-
method: 'GET',
|
|
81
|
-
url: `/v2/contracts/${contractId}/transitionRecords`,
|
|
82
|
-
params: params,
|
|
83
|
-
});
|
|
84
|
-
}
|
|
1
|
+
import FUtil from '../utils';
|
|
2
|
+
|
|
3
|
+
// 查看合同详情
|
|
4
|
+
interface ContractDetailsParamsType {
|
|
5
|
+
contractId: string;
|
|
6
|
+
isLoadPolicyInfo?: 0 | 1;
|
|
7
|
+
projection?: string;
|
|
8
|
+
isTranslate?: 0 | 1;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function contractDetails({contractId, ...params}: ContractDetailsParamsType) {
|
|
12
|
+
return FUtil.Request({
|
|
13
|
+
method: 'GET',
|
|
14
|
+
url: `/v2/contracts/${contractId}`,
|
|
15
|
+
params: params,
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// 查询合同分页列表
|
|
20
|
+
interface ContractsParamsType {
|
|
21
|
+
skip?: number;
|
|
22
|
+
limit?: number;
|
|
23
|
+
identityType: 1 | 2;
|
|
24
|
+
licensorId?: string;
|
|
25
|
+
licenseeId?: string;
|
|
26
|
+
subjectIds?: string;
|
|
27
|
+
subjectType?: 1 | 2 | 3;
|
|
28
|
+
isDefault?: number;
|
|
29
|
+
keywords?: string;
|
|
30
|
+
status?: 0 | 1 | 2; // 合同状态 0:生效中 1:已终止 2:异常的
|
|
31
|
+
authStatus?: 1 | 2 | 128; // 合同授权状态 1:正式授权 2:测试授权 128:未获得授权,多个通过'与'运算
|
|
32
|
+
order?: 'asc' | 'desc'; // asc:正序 desc:倒序
|
|
33
|
+
licenseeIdentityType?: number;
|
|
34
|
+
isLoadPolicyInfo?: 0 | 1;
|
|
35
|
+
isTranslate?: 0 | 1;
|
|
36
|
+
startDate?: string;
|
|
37
|
+
endDate?: string;
|
|
38
|
+
projection?: string;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export function contracts(params: ContractsParamsType) {
|
|
42
|
+
return FUtil.Request({
|
|
43
|
+
method: 'GET',
|
|
44
|
+
url: `/v2/contracts`,
|
|
45
|
+
params: params,
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// 批量查询合同列表
|
|
50
|
+
interface BatchContractsParamsType {
|
|
51
|
+
contractIds?: string;
|
|
52
|
+
subjectIds?: string;
|
|
53
|
+
subjectType?: 1 | 2 | 3;
|
|
54
|
+
licenseeIdentityType?: 1 | 2 | 3;
|
|
55
|
+
licensorId?: string;
|
|
56
|
+
licenseeId?: string | number;
|
|
57
|
+
isLoadPolicyInfo?: 0 | 1;
|
|
58
|
+
projection?: string;
|
|
59
|
+
isTranslate?: 0 | 1;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function batchContracts(params: BatchContractsParamsType) {
|
|
63
|
+
return FUtil.Request({
|
|
64
|
+
method: 'GET',
|
|
65
|
+
url: `/v2/contracts/list`,
|
|
66
|
+
params: params,
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// 查看合同流转记录分页列表
|
|
71
|
+
interface TransitionRecordsParamsType {
|
|
72
|
+
contractId: string;
|
|
73
|
+
skip?: number;
|
|
74
|
+
limit?: number;
|
|
75
|
+
isTranslate?: 0 | 1;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export function transitionRecords({contractId, ...params}: TransitionRecordsParamsType) {
|
|
79
|
+
return FUtil.Request({
|
|
80
|
+
method: 'GET',
|
|
81
|
+
url: `/v2/contracts/${contractId}/transitionRecords`,
|
|
82
|
+
params: params,
|
|
83
|
+
});
|
|
84
|
+
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import FUtil from '../utils';
|
|
2
|
-
|
|
3
|
-
// 批量获取授权策略列表
|
|
4
|
-
interface TransactionParamsType {
|
|
5
|
-
contractId: string;
|
|
6
|
-
eventId: string;
|
|
7
|
-
accountId: string;
|
|
8
|
-
transactionAmount: number;
|
|
9
|
-
password: string;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export function transaction({contractId, ...params}: TransactionParamsType) {
|
|
13
|
-
return FUtil.Request({
|
|
14
|
-
method: 'POST',
|
|
15
|
-
url: `/v2/contracts/${contractId}/events/payment`,
|
|
16
|
-
data: params,
|
|
17
|
-
});
|
|
18
|
-
}
|
|
1
|
+
import FUtil from '../utils';
|
|
2
|
+
|
|
3
|
+
// 批量获取授权策略列表
|
|
4
|
+
interface TransactionParamsType {
|
|
5
|
+
contractId: string;
|
|
6
|
+
eventId: string;
|
|
7
|
+
accountId: string;
|
|
8
|
+
transactionAmount: number;
|
|
9
|
+
password: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function transaction({contractId, ...params}: TransactionParamsType) {
|
|
13
|
+
return FUtil.Request({
|
|
14
|
+
method: 'POST',
|
|
15
|
+
url: `/v2/contracts/${contractId}/events/payment`,
|
|
16
|
+
data: params,
|
|
17
|
+
});
|
|
18
|
+
}
|
package/src/service-API/nodes.ts
CHANGED
|
@@ -1,65 +1,65 @@
|
|
|
1
|
-
import FUtil from '../utils';
|
|
2
|
-
|
|
3
|
-
// 创建节点
|
|
4
|
-
export interface CreateParamsType {
|
|
5
|
-
nodeName: string;
|
|
6
|
-
nodeDomain: string;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export function create(params: CreateParamsType) {
|
|
10
|
-
// return FUtil.Axios.post('/v2/nodes', params);
|
|
11
|
-
return FUtil.Request({
|
|
12
|
-
method: 'POST',
|
|
13
|
-
url: `/v2/nodes`,
|
|
14
|
-
data: params,
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
// 查看节点详情
|
|
19
|
-
interface NodeDetailParamsType1 {
|
|
20
|
-
nodeId: number;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
interface NodeDetailParamsType2 {
|
|
24
|
-
nodeName?: string;
|
|
25
|
-
nodeDomain?: string;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export function details(params: NodeDetailParamsType1 | NodeDetailParamsType2) {
|
|
29
|
-
if ((params as NodeDetailParamsType1).nodeId) {
|
|
30
|
-
// return FUtil.Axios.get(`/v2/nodes/${(params as NodeDetailParamsType1).nodeId}`);
|
|
31
|
-
return FUtil.Request({
|
|
32
|
-
method: 'GET',
|
|
33
|
-
url: `/v2/nodes/${(params as NodeDetailParamsType1).nodeId}`,
|
|
34
|
-
// params: params,
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
// return FUtil.Axios.get(`/v2/nodes/detail`, {
|
|
38
|
-
// params,
|
|
39
|
-
// });
|
|
40
|
-
return FUtil.Request({
|
|
41
|
-
method: 'GET',
|
|
42
|
-
url: `/v2/nodes/detail`,
|
|
43
|
-
params: params,
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
// 查看节点列表
|
|
48
|
-
interface NodesParamsType {
|
|
49
|
-
skip?: number;
|
|
50
|
-
limit?: number;
|
|
51
|
-
status?: 0 | 1 | 2; // 0:正常 1:未审核 2:冻结
|
|
52
|
-
projection?: string;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export function nodes(params: NodesParamsType) {
|
|
56
|
-
// return FUtil.Axios.get('/v2/nodes', {
|
|
57
|
-
// params
|
|
58
|
-
// });
|
|
59
|
-
return FUtil.Request({
|
|
60
|
-
method: 'GET',
|
|
61
|
-
url: `/v2/nodes`,
|
|
62
|
-
params: params,
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
|
|
1
|
+
import FUtil from '../utils';
|
|
2
|
+
|
|
3
|
+
// 创建节点
|
|
4
|
+
export interface CreateParamsType {
|
|
5
|
+
nodeName: string;
|
|
6
|
+
nodeDomain: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function create(params: CreateParamsType) {
|
|
10
|
+
// return FUtil.Axios.post('/v2/nodes', params);
|
|
11
|
+
return FUtil.Request({
|
|
12
|
+
method: 'POST',
|
|
13
|
+
url: `/v2/nodes`,
|
|
14
|
+
data: params,
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// 查看节点详情
|
|
19
|
+
interface NodeDetailParamsType1 {
|
|
20
|
+
nodeId: number;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
interface NodeDetailParamsType2 {
|
|
24
|
+
nodeName?: string;
|
|
25
|
+
nodeDomain?: string;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function details(params: NodeDetailParamsType1 | NodeDetailParamsType2) {
|
|
29
|
+
if ((params as NodeDetailParamsType1).nodeId) {
|
|
30
|
+
// return FUtil.Axios.get(`/v2/nodes/${(params as NodeDetailParamsType1).nodeId}`);
|
|
31
|
+
return FUtil.Request({
|
|
32
|
+
method: 'GET',
|
|
33
|
+
url: `/v2/nodes/${(params as NodeDetailParamsType1).nodeId}`,
|
|
34
|
+
// params: params,
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
// return FUtil.Axios.get(`/v2/nodes/detail`, {
|
|
38
|
+
// params,
|
|
39
|
+
// });
|
|
40
|
+
return FUtil.Request({
|
|
41
|
+
method: 'GET',
|
|
42
|
+
url: `/v2/nodes/detail`,
|
|
43
|
+
params: params,
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// 查看节点列表
|
|
48
|
+
interface NodesParamsType {
|
|
49
|
+
skip?: number;
|
|
50
|
+
limit?: number;
|
|
51
|
+
status?: 0 | 1 | 2; // 0:正常 1:未审核 2:冻结
|
|
52
|
+
projection?: string;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export function nodes(params: NodesParamsType) {
|
|
56
|
+
// return FUtil.Axios.get('/v2/nodes', {
|
|
57
|
+
// params
|
|
58
|
+
// });
|
|
59
|
+
return FUtil.Request({
|
|
60
|
+
method: 'GET',
|
|
61
|
+
url: `/v2/nodes`,
|
|
62
|
+
params: params,
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
|