@freelog/tools-lib 0.1.165 → 0.1.166

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.
@@ -1,113 +1,113 @@
1
- import FUtil from '../utils';
2
-
3
- // 创建节点
4
- export interface CreateParamsType {
5
- nodeName: string;
6
- nodeDomain: string;
7
- nodeTitle: string;
8
- }
9
-
10
- export function create(params: CreateParamsType) {
11
- // return FUtil.Axios.post('/v2/nodes', params);
12
- return FUtil.Request({
13
- method: 'POST',
14
- url: `/v2/nodes`,
15
- data: params,
16
- });
17
- }
18
-
19
- // 查看节点详情
20
- interface NodeDetailParamsType1 {
21
- nodeId: number;
22
- }
23
-
24
- interface NodeDetailParamsType2 {
25
- nodeName?: string;
26
- nodeDomain?: string;
27
- }
28
-
29
- export function details(params: NodeDetailParamsType1 | NodeDetailParamsType2) {
30
- if ((params as NodeDetailParamsType1).nodeId) {
31
- // return FUtil.Axios.get(`/v2/nodes/${(params as NodeDetailParamsType1).nodeId}`);
32
- return FUtil.Request({
33
- method: 'GET',
34
- url: `/v2/nodes/${(params as NodeDetailParamsType1).nodeId}`,
35
- // params: params,
36
- });
37
- }
38
- // return FUtil.Axios.get(`/v2/nodes/detail`, {
39
- // params,
40
- // });
41
- return FUtil.Request({
42
- method: 'GET',
43
- url: `/v2/nodes/detail`,
44
- params: params,
45
- });
46
- }
47
-
48
- // 查看节点列表
49
- interface NodesParamsType {
50
- skip?: number;
51
- limit?: number;
52
- status?: 0 | 1 | 2; // 0:正常 1:未审核 2:冻结
53
- projection?: string;
54
- nodeType?: 0 | 1;
55
- }
56
-
57
- export function nodes(params: NodesParamsType) {
58
- return FUtil.Request({
59
- method: 'GET',
60
- url: `/v2/nodes`,
61
- params: params,
62
- });
63
- }
64
-
65
- // 示例节点
66
- interface SearchForClientParamsType {
67
- skip?: number;
68
- limit?: number;
69
- status?: 0 | 1 | 2; // 0:正常 1:未审核 2:冻结
70
- projection?: string;
71
- nodeType?: 0 | 1;
72
- }
73
-
74
- export function searchForClient(params: SearchForClientParamsType) {
75
- return FUtil.Request({
76
- method: 'GET',
77
- url: `/v2/nodes/searchForClient`,
78
- params: params,
79
- });
80
- }
81
-
82
- // 设置节点信息
83
- interface SetNodeInfoParamsType {
84
- nodeId: number;
85
- nodeLogo: string;
86
- nodeTitle: string;
87
- nodeShortDescription: string;
88
- // nodeVisibility: 1 | 2 | 3; // 可见性 1:公开 2:私密 3:暂停
89
- status: 1 | 2 | 8; // 可见性 1:公开 2:私密 3:暂停
90
- nodeSuspendInfo: string;
91
- }
92
-
93
- export function setNodeInfo(params: SetNodeInfoParamsType) {
94
- return FUtil.Request({
95
- method: 'POST',
96
- url: `/v2/nodes/setNodeInfo`,
97
- data: params,
98
- });
99
- }
100
-
101
- // 删除节点
102
- interface DeleteNodeParamsType {
103
- nodeId: number;
104
- }
105
-
106
- export function deleteNode({nodeId}: DeleteNodeParamsType) {
107
- return FUtil.Request({
108
- method: 'DELETE',
109
- url: `/v2/nodes/${nodeId}`,
110
- // params: params,
111
- });
112
- }
113
-
1
+ import FUtil from '../utils';
2
+
3
+ // 创建节点
4
+ export interface CreateParamsType {
5
+ nodeName: string;
6
+ nodeDomain: string;
7
+ nodeTitle: string;
8
+ }
9
+
10
+ export function create(params: CreateParamsType) {
11
+ // return FUtil.Axios.post('/v2/nodes', params);
12
+ return FUtil.Request({
13
+ method: 'POST',
14
+ url: `/v2/nodes`,
15
+ data: params,
16
+ });
17
+ }
18
+
19
+ // 查看节点详情
20
+ interface NodeDetailParamsType1 {
21
+ nodeId: number;
22
+ }
23
+
24
+ interface NodeDetailParamsType2 {
25
+ nodeName?: string;
26
+ nodeDomain?: string;
27
+ }
28
+
29
+ export function details(params: NodeDetailParamsType1 | NodeDetailParamsType2) {
30
+ if ((params as NodeDetailParamsType1).nodeId) {
31
+ // return FUtil.Axios.get(`/v2/nodes/${(params as NodeDetailParamsType1).nodeId}`);
32
+ return FUtil.Request({
33
+ method: 'GET',
34
+ url: `/v2/nodes/${(params as NodeDetailParamsType1).nodeId}`,
35
+ // params: params,
36
+ });
37
+ }
38
+ // return FUtil.Axios.get(`/v2/nodes/detail`, {
39
+ // params,
40
+ // });
41
+ return FUtil.Request({
42
+ method: 'GET',
43
+ url: `/v2/nodes/detail`,
44
+ params: params,
45
+ });
46
+ }
47
+
48
+ // 查看节点列表
49
+ interface NodesParamsType {
50
+ skip?: number;
51
+ limit?: number;
52
+ status?: 0 | 1 | 2; // 0:正常 1:未审核 2:冻结
53
+ projection?: string;
54
+ nodeType?: 0 | 1;
55
+ }
56
+
57
+ export function nodes(params: NodesParamsType) {
58
+ return FUtil.Request({
59
+ method: 'GET',
60
+ url: `/v2/nodes`,
61
+ params: params,
62
+ });
63
+ }
64
+
65
+ // 示例节点
66
+ interface SearchForClientParamsType {
67
+ skip?: number;
68
+ limit?: number;
69
+ status?: 0 | 1 | 2; // 0:正常 1:未审核 2:冻结
70
+ projection?: string;
71
+ nodeType?: 0 | 1;
72
+ }
73
+
74
+ export function searchForClient(params: SearchForClientParamsType) {
75
+ return FUtil.Request({
76
+ method: 'GET',
77
+ url: `/v2/nodes/searchForClient`,
78
+ params: params,
79
+ });
80
+ }
81
+
82
+ // 设置节点信息
83
+ interface SetNodeInfoParamsType {
84
+ nodeId: number;
85
+ nodeLogo: string;
86
+ nodeTitle: string;
87
+ nodeShortDescription: string;
88
+ // nodeVisibility: 1 | 2 | 3; // 可见性 1:公开 2:私密 3:暂停
89
+ status: 1 | 2 | 8; // 可见性 1:公开 2:私密 3:暂停
90
+ nodeSuspendInfo: string;
91
+ }
92
+
93
+ export function setNodeInfo(params: SetNodeInfoParamsType) {
94
+ return FUtil.Request({
95
+ method: 'POST',
96
+ url: `/v2/nodes/setNodeInfo`,
97
+ data: params,
98
+ });
99
+ }
100
+
101
+ // 删除节点
102
+ interface DeleteNodeParamsType {
103
+ nodeId: number;
104
+ }
105
+
106
+ export function deleteNode({nodeId}: DeleteNodeParamsType) {
107
+ return FUtil.Request({
108
+ method: 'DELETE',
109
+ url: `/v2/nodes/${nodeId}`,
110
+ // params: params,
111
+ });
112
+ }
113
+