dna-api 0.2.2 → 0.2.6
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/dist/index.d.ts +526 -107
- package/dist/index.js +3 -3
- package/dist/index.js.map +3 -3
- package/package.json +1 -1
- package/src/index.ts +802 -203
package/src/index.ts
CHANGED
|
@@ -1,27 +1,5 @@
|
|
|
1
1
|
import * as forge from "node-forge"
|
|
2
2
|
//#region const
|
|
3
|
-
const MAIN_URL = "https://dnabbs-api.yingxiong.com"
|
|
4
|
-
const LOGIN_URL = `${MAIN_URL}/user/sdkLogin`
|
|
5
|
-
const GET_RSA_PUBLIC_KEY_URL = `${MAIN_URL}/config/getRsaPublicKey`
|
|
6
|
-
const LOGIN_LOG_URL = `${MAIN_URL}/user/login/log`
|
|
7
|
-
const ROLE_LIST_URL = `${MAIN_URL}/role/list`
|
|
8
|
-
const ROLE_FOR_TOOL_URL = `${MAIN_URL}/role/defaultRoleForTool`
|
|
9
|
-
const ROLE_DETAIL_URL = `${MAIN_URL}/role/getCharDetail`
|
|
10
|
-
const WEAPON_DETAIL_URL = `${MAIN_URL}/weapon/detail`
|
|
11
|
-
const SHORT_NOTE_URL = `${MAIN_URL}/role/getShortNoteInfo`
|
|
12
|
-
const SIGN_CALENDAR_URL = `${MAIN_URL}/encourage/signin/show`
|
|
13
|
-
const GAME_SIGN_URL = `${MAIN_URL}/encourage/signin/signin`
|
|
14
|
-
const BBS_SIGN_URL = `${MAIN_URL}/user/signIn`
|
|
15
|
-
const HAVE_SIGN_IN_URL = `${MAIN_URL}/user/haveSignInNew`
|
|
16
|
-
const GET_TASK_PROCESS_URL = `${MAIN_URL}/encourage/level/getTaskProcess`
|
|
17
|
-
const GET_POST_LIST_URL = `${MAIN_URL}/forum/list`
|
|
18
|
-
const GET_POST_DETAIL_URL = `${MAIN_URL}/forum/getPostDetail`
|
|
19
|
-
const LIKE_POST_URL = `${MAIN_URL}/forum/like`
|
|
20
|
-
const SHARE_POST_URL = `${MAIN_URL}/encourage/level/shareTask`
|
|
21
|
-
const REPLY_POST_URL = `${MAIN_URL}/forum/comment/createComment`
|
|
22
|
-
const GET_GAME_CONFIG_URL = `${MAIN_URL}/config/getGameConfig`
|
|
23
|
-
const ANN_LIST_URL = `${MAIN_URL}/user/mine`
|
|
24
|
-
|
|
25
3
|
enum RespCode {
|
|
26
4
|
ERROR = -999,
|
|
27
5
|
OK_ZERO = 0,
|
|
@@ -37,10 +15,11 @@ const DNA_GAME_ID = 268
|
|
|
37
15
|
* DNA API类,用于与DNA游戏服务器交互
|
|
38
16
|
*/
|
|
39
17
|
export class DNAAPI {
|
|
40
|
-
public fetchFn
|
|
18
|
+
public fetchFn?: typeof fetch
|
|
41
19
|
public is_h5 = false
|
|
42
|
-
public
|
|
20
|
+
public RSA_PUBLIC_KEY =
|
|
43
21
|
"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDGpdbezK+eknQZQzPOjp8mr/dP+QHwk8CRkQh6C6qFnfLH3tiyl0pnt3dePuFDnM1PUXGhCkQ157ePJCQgkDU2+mimDmXh0oLFn9zuWSp+U8uLSLX3t3PpJ8TmNCROfUDWvzdbnShqg7JfDmnrOJz49qd234W84nrfTHbzdqeigQIDAQAB"
|
|
22
|
+
public BASE_URL = "https://dnabbs-api.yingxiong.com/"
|
|
44
23
|
|
|
45
24
|
/**
|
|
46
25
|
* 构造函数
|
|
@@ -57,9 +36,9 @@ export class DNAAPI {
|
|
|
57
36
|
public token = "",
|
|
58
37
|
options: { fetchFn?: typeof fetch; is_h5?: boolean; rsa_public_key?: string } = {},
|
|
59
38
|
) {
|
|
60
|
-
this.fetchFn = options.fetchFn
|
|
39
|
+
this.fetchFn = options.fetchFn
|
|
61
40
|
if (options.is_h5 !== undefined) this.is_h5 = options.is_h5
|
|
62
|
-
if (options.rsa_public_key !== undefined) this.
|
|
41
|
+
if (options.rsa_public_key !== undefined) this.RSA_PUBLIC_KEY = options.rsa_public_key
|
|
63
42
|
}
|
|
64
43
|
|
|
65
44
|
/**
|
|
@@ -67,18 +46,18 @@ export class DNAAPI {
|
|
|
67
46
|
* @returns RSA公钥(base64)
|
|
68
47
|
*/
|
|
69
48
|
async getRsaPublicKey() {
|
|
70
|
-
if (this.
|
|
71
|
-
return this.
|
|
49
|
+
if (this.RSA_PUBLIC_KEY) {
|
|
50
|
+
return this.RSA_PUBLIC_KEY
|
|
72
51
|
}
|
|
73
|
-
const res = await this._dna_request<{ key: string }>(
|
|
52
|
+
const res = await this._dna_request<{ key: string }>("config/getRsaPublicKey")
|
|
74
53
|
|
|
75
54
|
if (res.is_success && res.data) {
|
|
76
55
|
const key = res.data.key
|
|
77
56
|
if (typeof key === "string") {
|
|
78
|
-
this.
|
|
57
|
+
this.RSA_PUBLIC_KEY = key
|
|
79
58
|
}
|
|
80
59
|
}
|
|
81
|
-
return this.
|
|
60
|
+
return this.RSA_PUBLIC_KEY
|
|
82
61
|
}
|
|
83
62
|
|
|
84
63
|
/**
|
|
@@ -86,7 +65,7 @@ export class DNAAPI {
|
|
|
86
65
|
*/
|
|
87
66
|
async login(mobile: string, code: string) {
|
|
88
67
|
const data = { mobile, code, gameList: DNA_GAME_ID }
|
|
89
|
-
const res = await this._dna_request<DNALoginRes>(
|
|
68
|
+
const res = await this._dna_request<DNALoginRes>("user/sdkLogin", data, { sign: true, refer: true })
|
|
90
69
|
if (res.is_success && res.data) {
|
|
91
70
|
const data = res.data
|
|
92
71
|
if (typeof data.token === "string") {
|
|
@@ -100,14 +79,14 @@ export class DNAAPI {
|
|
|
100
79
|
* 获取登录日志
|
|
101
80
|
*/
|
|
102
81
|
async loginLog() {
|
|
103
|
-
return await this._dna_request<DNALoginRes>(
|
|
82
|
+
return await this._dna_request<DNALoginRes>("user/login/log")
|
|
104
83
|
}
|
|
105
84
|
|
|
106
85
|
/**
|
|
107
86
|
* 获取角色列表
|
|
108
87
|
*/
|
|
109
88
|
async getRoleList() {
|
|
110
|
-
return await this._dna_request<DNARoleListRes>(
|
|
89
|
+
return await this._dna_request<DNARoleListRes>("role/list")
|
|
111
90
|
}
|
|
112
91
|
|
|
113
92
|
/**
|
|
@@ -115,30 +94,30 @@ export class DNAAPI {
|
|
|
115
94
|
*/
|
|
116
95
|
async getDefaultRoleForTool() {
|
|
117
96
|
const data = { type: 1 }
|
|
118
|
-
return await this._dna_request<DNARoleForToolRes>(
|
|
97
|
+
return await this._dna_request<DNARoleForToolRes>("role/defaultRoleForTool", data, { sign: true, token: true, tokenSig: true })
|
|
119
98
|
}
|
|
120
99
|
|
|
121
100
|
/**
|
|
122
101
|
* 获取角色详情
|
|
123
102
|
*/
|
|
124
|
-
async
|
|
125
|
-
const data = { charId: char_id, charEid: char_eid, type: 1 }
|
|
126
|
-
return await this._dna_request<
|
|
103
|
+
async getCharDetail(char_id: string, char_eid: string, otherUserId?: string) {
|
|
104
|
+
const data = { charId: char_id, charEid: char_eid, type: 1, otherUserId } as any
|
|
105
|
+
return await this._dna_request<DNACharDetailRes>("role/getCharDetail", data)
|
|
127
106
|
}
|
|
128
107
|
|
|
129
108
|
/**
|
|
130
109
|
* 获取武器详情
|
|
131
110
|
*/
|
|
132
|
-
async getWeaponDetail(weapon_id: string) {
|
|
133
|
-
const data = { weaponId: weapon_id, type: 1 }
|
|
134
|
-
return await this._dna_request<
|
|
111
|
+
async getWeaponDetail(weapon_id: string, weapon_eid: string, otherUserId?: string) {
|
|
112
|
+
const data = { weaponId: weapon_id, weaponEid: weapon_eid, type: 1, otherUserId }
|
|
113
|
+
return await this._dna_request<DNAWeaponDetailRes>("role/getWeaponDetail", data)
|
|
135
114
|
}
|
|
136
115
|
|
|
137
116
|
/**
|
|
138
117
|
* 获取角色简讯
|
|
139
118
|
*/
|
|
140
119
|
async getShortNoteInfo() {
|
|
141
|
-
return await this._dna_request<DNARoleShortNoteRes>(
|
|
120
|
+
return await this._dna_request<DNARoleShortNoteRes>("role/getShortNoteInfo")
|
|
142
121
|
}
|
|
143
122
|
|
|
144
123
|
/**
|
|
@@ -146,7 +125,7 @@ export class DNAAPI {
|
|
|
146
125
|
*/
|
|
147
126
|
async haveSignIn() {
|
|
148
127
|
const data = { gameId: DNA_GAME_ID }
|
|
149
|
-
return await this._dna_request<DNAHaveSignInRes>(
|
|
128
|
+
return await this._dna_request<DNAHaveSignInRes>("user/haveSignInNew", data)
|
|
150
129
|
}
|
|
151
130
|
|
|
152
131
|
/**
|
|
@@ -154,7 +133,12 @@ export class DNAAPI {
|
|
|
154
133
|
*/
|
|
155
134
|
async signCalendar() {
|
|
156
135
|
const data = { gameId: DNA_GAME_ID }
|
|
157
|
-
return await this._dna_request<DNACalendarSignRes>(
|
|
136
|
+
return await this._dna_request<DNACalendarSignRes>("encourage/signin/show", data)
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/** ? */
|
|
140
|
+
async soulTask() {
|
|
141
|
+
return await this._dna_request("role/soul/task")
|
|
158
142
|
}
|
|
159
143
|
|
|
160
144
|
/**
|
|
@@ -166,7 +150,7 @@ export class DNAAPI {
|
|
|
166
150
|
periodId: period,
|
|
167
151
|
signinType: 1,
|
|
168
152
|
}
|
|
169
|
-
return await this._dna_request(
|
|
153
|
+
return await this._dna_request("encourage/signin/signin", data)
|
|
170
154
|
}
|
|
171
155
|
|
|
172
156
|
/**
|
|
@@ -174,7 +158,7 @@ export class DNAAPI {
|
|
|
174
158
|
*/
|
|
175
159
|
async bbsSign() {
|
|
176
160
|
const data = { gameId: DNA_GAME_ID }
|
|
177
|
-
return await this._dna_request(
|
|
161
|
+
return await this._dna_request("user/signIn", data)
|
|
178
162
|
}
|
|
179
163
|
|
|
180
164
|
/**
|
|
@@ -182,35 +166,309 @@ export class DNAAPI {
|
|
|
182
166
|
*/
|
|
183
167
|
async getTaskProcess() {
|
|
184
168
|
const data = { gameId: DNA_GAME_ID }
|
|
185
|
-
return await this._dna_request<DNATaskProcessRes>(
|
|
169
|
+
return await this._dna_request<DNATaskProcessRes>("encourage/level/getTaskProcess", data)
|
|
186
170
|
}
|
|
187
171
|
|
|
188
172
|
/**
|
|
189
173
|
* 获取帖子列表
|
|
174
|
+
* @param forumId 论坛ID
|
|
175
|
+
* @param pageIndex 页码
|
|
176
|
+
* @param pageSize 每页数量
|
|
177
|
+
* @param searchType 搜索类型 1:最新 2:热门
|
|
178
|
+
* @param timeType 时间类型 0:全部 1:今日 2:本周 3:本月
|
|
179
|
+
* @returns 帖子列表
|
|
190
180
|
*/
|
|
191
|
-
async getPostList() {
|
|
181
|
+
async getPostList(forumId: number = 48, pageIndex: number = 1, pageSize: number = 20, searchType: number = 1, timeType: number = 0) {
|
|
192
182
|
const data = {
|
|
193
|
-
forumId:
|
|
183
|
+
forumId: forumId,
|
|
194
184
|
gameId: DNA_GAME_ID,
|
|
195
|
-
pageIndex:
|
|
196
|
-
pageSize:
|
|
197
|
-
searchType:
|
|
198
|
-
timeType: 0
|
|
185
|
+
pageIndex: pageIndex,
|
|
186
|
+
pageSize: pageSize,
|
|
187
|
+
searchType: searchType, // 1:最新 2:热门
|
|
188
|
+
timeType: timeType, // 0:全部 1:今日 2:本周 3:本月
|
|
189
|
+
}
|
|
190
|
+
return await this._dna_request<DNAPostListRes>("forum/list", data)
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/** 管理员锁定帖子 */
|
|
194
|
+
async lockPost(post: { postId: number; gameId?: number; gameForumId: number; operateType: number }) {
|
|
195
|
+
const data = {
|
|
196
|
+
postId: post.postId,
|
|
197
|
+
gameId: post.gameId ?? DNA_GAME_ID,
|
|
198
|
+
gameForumId: post.gameForumId,
|
|
199
|
+
operateType: post.operateType,
|
|
200
|
+
}
|
|
201
|
+
return await this._dna_request("forum/moderator/postLock", data)
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/** 管理员移动帖子 */
|
|
205
|
+
async postDownOrUp(post: { postId: number; gameId?: number; gameForumId: number; operateType: number }) {
|
|
206
|
+
const data = {
|
|
207
|
+
postId: post.postId,
|
|
208
|
+
gameId: post.gameId ?? DNA_GAME_ID,
|
|
209
|
+
gameForumId: post.gameForumId,
|
|
210
|
+
operateType: post.operateType,
|
|
211
|
+
}
|
|
212
|
+
return await this._dna_request("forum/moderator/postDownOrUp", data)
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/** 管理员设精 */
|
|
216
|
+
async postElite(post: { postId: number; gameId?: number; gameForumId: number; operateType: number }) {
|
|
217
|
+
const data = {
|
|
218
|
+
postId: post.postId,
|
|
219
|
+
gameId: post.gameId ?? DNA_GAME_ID,
|
|
220
|
+
gameForumId: post.gameForumId,
|
|
221
|
+
operateType: post.operateType,
|
|
222
|
+
}
|
|
223
|
+
return await this._dna_request("forum/moderator/postElite", data)
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
/** 管理员隐藏帖子 */
|
|
227
|
+
async postHide(post: { postId: number; gameId?: number; gameForumId: number; operateType: number }) {
|
|
228
|
+
const data = {
|
|
229
|
+
postId: post.postId,
|
|
230
|
+
gameId: post.gameId ?? DNA_GAME_ID,
|
|
231
|
+
gameForumId: post.gameForumId,
|
|
232
|
+
operateType: post.operateType,
|
|
233
|
+
}
|
|
234
|
+
return await this._dna_request("forum/moderator/postHide", data)
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
/** 管理员设置权重 */
|
|
238
|
+
async reRank(post: { postId: number; gameId?: number; gameForumId: number }, weight: number) {
|
|
239
|
+
const data = {
|
|
240
|
+
postId: post.postId,
|
|
241
|
+
gameId: post.gameId ?? DNA_GAME_ID,
|
|
242
|
+
gameForumId: post.gameForumId,
|
|
243
|
+
weight: weight,
|
|
244
|
+
}
|
|
245
|
+
return await this._dna_request("forum/moderator/reRank", data)
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
/** 管理员设置强推 */
|
|
249
|
+
async strongRecommend(post: { postId: number; gameId?: number; gameForumId: number }, operateType = 1) {
|
|
250
|
+
const data = {
|
|
251
|
+
postId: post.postId,
|
|
252
|
+
gameId: post.gameId ?? DNA_GAME_ID,
|
|
253
|
+
gameForumId: post.gameForumId,
|
|
254
|
+
operateType: operateType,
|
|
255
|
+
}
|
|
256
|
+
return await this._dna_request("forum/moderator/setForceRecommend", data)
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
/** 管理员删帖 */
|
|
260
|
+
async adminDelete(post: { postId: number; gameId?: number; gameForumId: number }, content: string, reasonCode: number) {
|
|
261
|
+
const data = {
|
|
262
|
+
postId: post.postId,
|
|
263
|
+
gameId: post.gameId ?? DNA_GAME_ID,
|
|
264
|
+
gameForumId: post.gameForumId,
|
|
265
|
+
content: content,
|
|
266
|
+
reasonCode: reasonCode,
|
|
267
|
+
}
|
|
268
|
+
return await this._dna_request("forum/moderator/postDelete", data)
|
|
269
|
+
}
|
|
270
|
+
/** 管理员移动帖子 */
|
|
271
|
+
async adminMovePost(
|
|
272
|
+
post: { postId: number; gameId?: number; gameForumId: number },
|
|
273
|
+
newGameId: number,
|
|
274
|
+
newForumId: number,
|
|
275
|
+
newTopicIdStr: string,
|
|
276
|
+
) {
|
|
277
|
+
const data = {
|
|
278
|
+
postId: post.postId,
|
|
279
|
+
gameId: post.gameId ?? DNA_GAME_ID,
|
|
280
|
+
gameForumId: post.gameForumId,
|
|
281
|
+
newGameId: newGameId,
|
|
282
|
+
newForumId: newForumId,
|
|
283
|
+
newTopicIdStr: newTopicIdStr,
|
|
284
|
+
}
|
|
285
|
+
return await this._dna_request("forum/moderator/postMove", data)
|
|
286
|
+
}
|
|
287
|
+
/** ? */
|
|
288
|
+
async adminRefreshTime(post: { postId: number; gameId?: number; gameForumId: number }, refresh: number) {
|
|
289
|
+
const data = {
|
|
290
|
+
postId: post.postId,
|
|
291
|
+
gameId: post.gameId ?? DNA_GAME_ID,
|
|
292
|
+
gameForumId: post.gameForumId,
|
|
293
|
+
refresh: refresh,
|
|
294
|
+
}
|
|
295
|
+
return await this._dna_request("forum/moderator/setRefresh", data)
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
/** 黑名单 */
|
|
299
|
+
async blockList() {
|
|
300
|
+
return await this._dna_request("user/block/list")
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
/** 拉黑 */
|
|
304
|
+
async blockOther(blockPostId: number, blockUserId: string, type: number) {
|
|
305
|
+
const data = {
|
|
306
|
+
blockPostId: blockPostId,
|
|
307
|
+
blockUserId: blockUserId,
|
|
308
|
+
type: type,
|
|
309
|
+
}
|
|
310
|
+
return await this._dna_request("user/block/list", data)
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
/** ? */
|
|
314
|
+
async viewCommunity() {
|
|
315
|
+
return await this._dna_request("encourage/level/viewCommunity")
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
/** ? */
|
|
319
|
+
async viewCount() {
|
|
320
|
+
return await this._dna_request("forum/viewCount")
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
/** ? */
|
|
324
|
+
async receiveLog(periodId: number, pageIndex: number, pageSize: number) {
|
|
325
|
+
const data = {
|
|
326
|
+
periodId: periodId,
|
|
327
|
+
pageIndex: pageIndex,
|
|
328
|
+
pageSize: pageSize,
|
|
329
|
+
}
|
|
330
|
+
return await this._dna_request("encourage/signin/receiveLog", data)
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
/** 收藏 */
|
|
334
|
+
async collect(postId: number, toUserId: string, operateType = 1) {
|
|
335
|
+
const data = {
|
|
336
|
+
operateType: operateType,
|
|
337
|
+
postId: postId,
|
|
338
|
+
toUserId: toUserId,
|
|
199
339
|
}
|
|
200
|
-
return await this._dna_request
|
|
340
|
+
return await this._dna_request("forum/collect", data)
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
/** 删除评论 */
|
|
344
|
+
async commentDelete(
|
|
345
|
+
comment: { id: number; gameId: number; gameForumId: number },
|
|
346
|
+
entityType: number,
|
|
347
|
+
content: string,
|
|
348
|
+
reasonCode: number,
|
|
349
|
+
) {
|
|
350
|
+
const data = {
|
|
351
|
+
id: comment.id,
|
|
352
|
+
gameId: comment.gameId,
|
|
353
|
+
gameForumId: comment.gameForumId,
|
|
354
|
+
entityType: entityType,
|
|
355
|
+
content: content,
|
|
356
|
+
reasonCode: reasonCode,
|
|
357
|
+
}
|
|
358
|
+
return await this._dna_request("forum/collect", data)
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
/** 推荐列表 */
|
|
362
|
+
async recommendList(recIndex: number, newIndex: number, size: number, history: number, gameId = DNA_GAME_ID) {
|
|
363
|
+
const data = {
|
|
364
|
+
gameId: gameId,
|
|
365
|
+
recIndex: recIndex,
|
|
366
|
+
newIndex: newIndex,
|
|
367
|
+
size: size,
|
|
368
|
+
history: history,
|
|
369
|
+
}
|
|
370
|
+
return await this._dna_request("forum/recommend/list", data)
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
/** 举报 */
|
|
374
|
+
async report(
|
|
375
|
+
{ commentId = 0, postId = 0, replyId = 0 }: { commentId?: number; postId?: number; replyId?: number },
|
|
376
|
+
reportReason = 1,
|
|
377
|
+
reportType = 1,
|
|
378
|
+
) {
|
|
379
|
+
const data = {
|
|
380
|
+
commentId: commentId,
|
|
381
|
+
postId: postId,
|
|
382
|
+
replyId: replyId,
|
|
383
|
+
reportReason: reportReason,
|
|
384
|
+
reportType: reportType,
|
|
385
|
+
}
|
|
386
|
+
return await this._dna_request<DNAPostListRes>("forum/recommend/list", data)
|
|
387
|
+
}
|
|
388
|
+
/** 搜索帖子 */
|
|
389
|
+
async searchPost(keyword: number, pageIndex: number, pageSize: number, gameId = DNA_GAME_ID, searchType = 1) {
|
|
390
|
+
const data = {
|
|
391
|
+
gameId: gameId,
|
|
392
|
+
keyword: keyword,
|
|
393
|
+
pageIndex: pageIndex,
|
|
394
|
+
pageSize: pageSize,
|
|
395
|
+
searchType: searchType,
|
|
396
|
+
}
|
|
397
|
+
return await this._dna_request<DNAPostListRes>("forum/searchPost", data)
|
|
398
|
+
}
|
|
399
|
+
/** 搜索帖子 */
|
|
400
|
+
async searchTopic(keyword: number, pageIndex: number, pageSize = 20, gameId = DNA_GAME_ID) {
|
|
401
|
+
const data = {
|
|
402
|
+
gameId: gameId,
|
|
403
|
+
keyword: keyword,
|
|
404
|
+
pageIndex: pageIndex,
|
|
405
|
+
pageSize: pageSize,
|
|
406
|
+
}
|
|
407
|
+
return await this._dna_request<DNAPostListRes>("config/searchTopic", data)
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
/** 搜索帖子 */
|
|
411
|
+
async searchUser(keyword: number, pageIndex: number, pageSize: number) {
|
|
412
|
+
const data = {
|
|
413
|
+
keyword: keyword,
|
|
414
|
+
pageIndex: pageIndex,
|
|
415
|
+
pageSize: pageSize,
|
|
416
|
+
}
|
|
417
|
+
return await this._dna_request<DNAPostListRes>("user/searchUser", data)
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
/**
|
|
421
|
+
* 获取帖子列表
|
|
422
|
+
* @param topicId 主题ID
|
|
423
|
+
* @param pageIndex 页码
|
|
424
|
+
* @param pageSize 每页数量
|
|
425
|
+
* @param searchType 搜索类型 1:最新 2:热门
|
|
426
|
+
* @param timeType 时间类型 0:全部 1:今日 2:本周 3:本月
|
|
427
|
+
* @returns 帖子列表
|
|
428
|
+
*/
|
|
429
|
+
async getPostsByTopic(
|
|
430
|
+
topicId: number = 177,
|
|
431
|
+
pageIndex: number = 1,
|
|
432
|
+
pageSize: number = 20,
|
|
433
|
+
searchType: number = 1,
|
|
434
|
+
timeType: number = 0,
|
|
435
|
+
) {
|
|
436
|
+
const data = {
|
|
437
|
+
topicId: topicId,
|
|
438
|
+
gameId: DNA_GAME_ID,
|
|
439
|
+
pageIndex: pageIndex,
|
|
440
|
+
pageSize: pageSize,
|
|
441
|
+
searchType: searchType, // 1:最新 2:热门
|
|
442
|
+
timeType: timeType, // 0:全部 1:今日 2:本周 3:本月
|
|
443
|
+
}
|
|
444
|
+
return await this._dna_request<DNAPostListRes>("forum/getPostByTopic", data)
|
|
201
445
|
}
|
|
202
446
|
|
|
203
447
|
/**
|
|
204
448
|
* 获取帖子详情
|
|
449
|
+
* @param post_id 帖子ID
|
|
450
|
+
* @returns 帖子详情
|
|
205
451
|
*/
|
|
206
452
|
async getPostDetail(post_id: string) {
|
|
207
453
|
const data = { postId: post_id }
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
454
|
+
return await this._dna_request<DNAPostDetailRes>("forum/getPostDetail", data)
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
/** 关注用户 */
|
|
458
|
+
async doFollow(userId: string, unfollow?: boolean) {
|
|
459
|
+
const data = {
|
|
460
|
+
followUserId: userId,
|
|
461
|
+
operateType: unfollow ? 0 : 1,
|
|
213
462
|
}
|
|
463
|
+
return await this._dna_request("user/followUser", data, { sign: true })
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
/** 获取关注状态 */
|
|
467
|
+
async getFollowState(userId: string) {
|
|
468
|
+
const data = {
|
|
469
|
+
followUserId: userId,
|
|
470
|
+
}
|
|
471
|
+
return await this._dna_request("user/isFollow", data)
|
|
214
472
|
}
|
|
215
473
|
|
|
216
474
|
/**
|
|
@@ -228,27 +486,38 @@ export class DNAAPI {
|
|
|
228
486
|
postType: post.postType,
|
|
229
487
|
toUserId: post.userId,
|
|
230
488
|
}
|
|
231
|
-
|
|
232
|
-
return await this._dna_request(LIKE_POST_URL, data)
|
|
233
|
-
} catch (e) {
|
|
234
|
-
console.error("do_like", e as Error)
|
|
235
|
-
return DNAApiResponse.err("请求皎皎角服务失败")
|
|
236
|
-
}
|
|
489
|
+
return await this._dna_request("forum/like", data)
|
|
237
490
|
}
|
|
238
491
|
|
|
239
|
-
|
|
492
|
+
/** 分享帖子 */
|
|
240
493
|
async doShare() {
|
|
241
494
|
const data = { gameId: DNA_GAME_ID }
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
495
|
+
return await this._dna_request("encourage/level/shareTask", data)
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
/** 回复帖子 */
|
|
499
|
+
async createComment(post: { userId: string; postId: string; gameForumId: number }, content: string) {
|
|
500
|
+
const content_json = JSON.stringify([
|
|
501
|
+
{
|
|
502
|
+
content,
|
|
503
|
+
contentType: "1",
|
|
504
|
+
imgHeight: 0,
|
|
505
|
+
imgWidth: 0,
|
|
506
|
+
url: "",
|
|
507
|
+
},
|
|
508
|
+
])
|
|
509
|
+
const data = {
|
|
510
|
+
postId: post.postId,
|
|
511
|
+
forumId: post.gameForumId,
|
|
512
|
+
postType: "1",
|
|
513
|
+
content: content_json,
|
|
247
514
|
}
|
|
515
|
+
|
|
516
|
+
return await this._dna_request("forum/comment/createComment", data, { sign: true, refer: true, params: { toUserId: post.userId } })
|
|
248
517
|
}
|
|
249
518
|
|
|
250
|
-
|
|
251
|
-
async
|
|
519
|
+
/** 回复评论 */
|
|
520
|
+
async createReply(post: { userId: string; postId: string; postCommentId: string; gameForumId: number }, content: string) {
|
|
252
521
|
const content_json = JSON.stringify([
|
|
253
522
|
{
|
|
254
523
|
content,
|
|
@@ -259,28 +528,72 @@ export class DNAAPI {
|
|
|
259
528
|
},
|
|
260
529
|
])
|
|
261
530
|
const data = {
|
|
531
|
+
content: content_json,
|
|
532
|
+
forumId: post.gameForumId,
|
|
533
|
+
postCommentId: post.postCommentId,
|
|
262
534
|
postId: post.postId,
|
|
263
|
-
forumId: post.gameForumId || 47,
|
|
264
535
|
postType: "1",
|
|
536
|
+
toUserId: post.userId,
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
return await this._dna_request("forum/comment/createReply", data, { sign: true, refer: true, params: { toUserId: post.userId } })
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
/** 回复评论的评论 */
|
|
543
|
+
async createReplyList(
|
|
544
|
+
post: { userId: string; postId: string; postCommentId: string; postCommentReplyId: string; gameForumId: number },
|
|
545
|
+
content: string,
|
|
546
|
+
) {
|
|
547
|
+
const content_json = JSON.stringify([
|
|
548
|
+
{
|
|
549
|
+
content,
|
|
550
|
+
contentType: "1",
|
|
551
|
+
imgHeight: 0,
|
|
552
|
+
imgWidth: 0,
|
|
553
|
+
url: "",
|
|
554
|
+
},
|
|
555
|
+
])
|
|
556
|
+
const data = {
|
|
265
557
|
content: content_json,
|
|
558
|
+
forumId: post.gameForumId,
|
|
559
|
+
postCommentId: post.postCommentId,
|
|
560
|
+
postCommentReplyId: post.postCommentReplyId,
|
|
561
|
+
postId: post.postId,
|
|
562
|
+
postType: "1",
|
|
563
|
+
toUserId: post.userId,
|
|
266
564
|
}
|
|
565
|
+
return await this._dna_request("forum/comment/createReply", data, { sign: true, refer: true, params: { toUserId: post.userId } })
|
|
566
|
+
}
|
|
267
567
|
|
|
268
|
-
|
|
568
|
+
/** 删 */
|
|
569
|
+
async deletePost(deleteType: number, id: number) {
|
|
570
|
+
return await this._dna_request("forum/more/delete", { deleteType, id }, { sign: true, refer: true })
|
|
269
571
|
}
|
|
270
572
|
|
|
271
|
-
|
|
272
|
-
|
|
573
|
+
/**
|
|
574
|
+
* 获取用户信息
|
|
575
|
+
* @returns 用户信息
|
|
576
|
+
*/
|
|
577
|
+
async getOtherMine(userId = "709542994134436647") {
|
|
273
578
|
const data = {
|
|
274
|
-
otherUserId:
|
|
579
|
+
otherUserId: userId,
|
|
275
580
|
searchType: 1,
|
|
276
581
|
type: 2,
|
|
277
582
|
}
|
|
278
|
-
return await this._dna_request<
|
|
583
|
+
return await this._dna_request<DNAMineRes>("user/mine", data)
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
/**
|
|
587
|
+
* 获取用户信息
|
|
588
|
+
* @returns 用户信息
|
|
589
|
+
*/
|
|
590
|
+
async getMine() {
|
|
591
|
+
return await this._dna_request<DNAMineRes>("user/mine")
|
|
279
592
|
}
|
|
280
593
|
|
|
281
594
|
async getGameConfig() {
|
|
282
595
|
const data = { gameId: DNA_GAME_ID }
|
|
283
|
-
return await this._dna_request<DNAGameConfigRes>(
|
|
596
|
+
return await this._dna_request<DNAGameConfigRes[]>("config/getGameConfig", data)
|
|
284
597
|
}
|
|
285
598
|
|
|
286
599
|
async getHeaders(options?: {
|
|
@@ -379,20 +692,31 @@ export class DNAAPI {
|
|
|
379
692
|
|
|
380
693
|
for (let attempt = 0; attempt < max_retries; attempt++) {
|
|
381
694
|
try {
|
|
695
|
+
let body: string = data
|
|
696
|
+
if (data && typeof data === "object") {
|
|
697
|
+
const p = new URLSearchParams()
|
|
698
|
+
Object.entries(data).forEach(([key, value]) => {
|
|
699
|
+
if (value !== undefined) p.append(key, String(value))
|
|
700
|
+
})
|
|
701
|
+
body = p.toString()
|
|
702
|
+
}
|
|
382
703
|
const fetchOptions: RequestInit = {
|
|
383
704
|
method,
|
|
384
705
|
headers,
|
|
385
|
-
body
|
|
706
|
+
body,
|
|
386
707
|
}
|
|
387
708
|
|
|
388
709
|
// 实现超时控制
|
|
389
710
|
const controller = new AbortController()
|
|
390
711
|
const timeoutId = setTimeout(() => controller.abort(), timeout)
|
|
391
712
|
|
|
392
|
-
const
|
|
713
|
+
const initOptions = {
|
|
393
714
|
...fetchOptions,
|
|
394
715
|
signal: controller.signal,
|
|
395
|
-
}
|
|
716
|
+
}
|
|
717
|
+
const response = this.fetchFn
|
|
718
|
+
? await this.fetchFn(`${this.BASE_URL}${url}`, initOptions)
|
|
719
|
+
: await fetch(`${this.BASE_URL}${url}`, initOptions)
|
|
396
720
|
clearTimeout(timeoutId)
|
|
397
721
|
|
|
398
722
|
// 获取响应头的 content-type
|
|
@@ -420,9 +744,6 @@ export class DNAAPI {
|
|
|
420
744
|
}
|
|
421
745
|
}
|
|
422
746
|
|
|
423
|
-
console.debug(
|
|
424
|
-
`[DNA] url:[${url}] headers:[${JSON.stringify(headers)}] data:[${JSON.stringify(data)}] raw_res:${JSON.stringify(raw_res)}`,
|
|
425
|
-
)
|
|
426
747
|
return new DNAApiResponse<T>(raw_res)
|
|
427
748
|
} catch (e) {
|
|
428
749
|
console.error(`请求失败: ${(e as Error).message}`)
|
|
@@ -436,50 +757,141 @@ export class DNAAPI {
|
|
|
436
757
|
}
|
|
437
758
|
}
|
|
438
759
|
|
|
760
|
+
enum DNAInstanceMHType {
|
|
761
|
+
"角色" = "role",
|
|
762
|
+
"武器" = "weapon",
|
|
763
|
+
"魔之楔" = "mzx",
|
|
764
|
+
"role" = "角色",
|
|
765
|
+
"weapon" = "武器",
|
|
766
|
+
"mzx" = "魔之楔",
|
|
767
|
+
}
|
|
768
|
+
|
|
769
|
+
export function getDNAInstanceMHType(key: keyof typeof DNAInstanceMHType) {
|
|
770
|
+
return DNAInstanceMHType[key]
|
|
771
|
+
}
|
|
772
|
+
|
|
439
773
|
//#region 接口定义
|
|
440
774
|
|
|
775
|
+
export interface DNAMineRes {
|
|
776
|
+
mine: DNAMine
|
|
777
|
+
postList: DNAPost[]
|
|
778
|
+
hasNext: number
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
export interface DNAMine {
|
|
782
|
+
/** 文章数量 */
|
|
783
|
+
articleCount: number
|
|
784
|
+
/** 收藏数量 */
|
|
785
|
+
collectCount: number
|
|
786
|
+
/** 评论数量 */
|
|
787
|
+
commentCount: number
|
|
788
|
+
/** 粉丝数量 */
|
|
789
|
+
fansCount: number
|
|
790
|
+
/** 新粉丝数量 */
|
|
791
|
+
fansNewCount: number
|
|
792
|
+
/** 关注数量 */
|
|
793
|
+
followCount: number
|
|
794
|
+
/** 性别 */
|
|
795
|
+
gender: number
|
|
796
|
+
/** 精华数量 */
|
|
797
|
+
goldNum: number
|
|
798
|
+
/** 头像 */
|
|
799
|
+
headUrl: string
|
|
800
|
+
/** 是否关注 */
|
|
801
|
+
isFollow: number
|
|
802
|
+
/** 是否登录用户 */
|
|
803
|
+
isLoginUser: number
|
|
804
|
+
/** 是否被禁言 */
|
|
805
|
+
isMute: number
|
|
806
|
+
/** 等级 */
|
|
807
|
+
levelTotal: number
|
|
808
|
+
/** 点赞数量 */
|
|
809
|
+
likeCount: number
|
|
810
|
+
/** 手机号 */
|
|
811
|
+
mobile: string
|
|
812
|
+
/** 管理员列表 */
|
|
813
|
+
moderatorVos: any[]
|
|
814
|
+
/** 帖子数量 */
|
|
815
|
+
postCount: number
|
|
816
|
+
/** 注册时间 */
|
|
817
|
+
registerTime: string
|
|
818
|
+
/** 状态 */
|
|
819
|
+
status: number
|
|
820
|
+
/** 趋势数量 */
|
|
821
|
+
trendCount: number
|
|
822
|
+
/** 用户ID */
|
|
823
|
+
userId: string
|
|
824
|
+
/** 用户名 */
|
|
825
|
+
userName: string
|
|
826
|
+
}
|
|
827
|
+
|
|
441
828
|
export interface DNAGameConfigRes {
|
|
442
|
-
/**
|
|
443
|
-
|
|
444
|
-
/** 游戏封面图 */
|
|
445
|
-
coverUrl: string
|
|
446
|
-
/** 默认游戏 */
|
|
447
|
-
gameDefault: number
|
|
829
|
+
/** 游戏所有板块列表 */
|
|
830
|
+
gameAllForumList: GameForum[]
|
|
448
831
|
/** 游戏ID */
|
|
449
832
|
gameId: number
|
|
833
|
+
/** 游戏板块图片列表 */
|
|
834
|
+
gameForumPictureList: any[]
|
|
835
|
+
/** 游戏板块列表 */
|
|
836
|
+
gameForumList: GameForum[]
|
|
837
|
+
/** 签到按钮图片 */
|
|
838
|
+
signBtn: string
|
|
839
|
+
sort: number
|
|
840
|
+
/** 话题列表 */
|
|
841
|
+
topicList: GameTopic[]
|
|
842
|
+
/** 背景图片 */
|
|
843
|
+
drawBackgroundUrl: string
|
|
844
|
+
/** 是否默认游戏 */
|
|
845
|
+
gameDefault: number
|
|
846
|
+
/** 签到颜色 */
|
|
847
|
+
signColor: string
|
|
450
848
|
/** 游戏名称 */
|
|
451
849
|
gameName: string
|
|
452
|
-
/**
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
/** 游戏板块图片列表 */
|
|
457
|
-
gameForumPictureList: unknown[]
|
|
458
|
-
/** 游戏Wiki列表 */
|
|
459
|
-
gameWikiVoList: GameWikiVo[]
|
|
850
|
+
/** CM图片2 意味不明 */
|
|
851
|
+
drawListUrl: string
|
|
852
|
+
/** 英文站点 */
|
|
853
|
+
configTab: ConfigTab[]
|
|
460
854
|
}
|
|
461
855
|
|
|
462
|
-
export interface
|
|
463
|
-
|
|
464
|
-
iconUrl: string
|
|
465
|
-
param: {
|
|
466
|
-
postId: string
|
|
467
|
-
topicId: string
|
|
468
|
-
}
|
|
469
|
-
postId: string
|
|
470
|
-
toAppAndroid: string
|
|
856
|
+
export interface ConfigTab {
|
|
857
|
+
name: string
|
|
471
858
|
url: string
|
|
472
|
-
wikiName: string
|
|
473
|
-
wikiType: number
|
|
474
859
|
}
|
|
475
860
|
|
|
476
|
-
export interface
|
|
477
|
-
/**
|
|
861
|
+
export interface GameTopic {
|
|
862
|
+
/** 话题背景图片 */
|
|
863
|
+
backgroundUrl: string
|
|
478
864
|
gameId: number
|
|
479
|
-
/**
|
|
480
|
-
|
|
865
|
+
/** 话题图标 */
|
|
866
|
+
topicIconUrl: string
|
|
867
|
+
topicId: number
|
|
868
|
+
/** 话题名称 */
|
|
869
|
+
topicName: string
|
|
870
|
+
sort: number
|
|
871
|
+
/** 话题描述 */
|
|
872
|
+
topicDesc: string
|
|
873
|
+
}
|
|
874
|
+
|
|
875
|
+
export interface GameForum {
|
|
876
|
+
/** 全部=1 普通=3 */
|
|
877
|
+
forumDataType: number
|
|
878
|
+
/** 固定1 */
|
|
879
|
+
forumUiType: number
|
|
880
|
+
/** 小红点 */
|
|
881
|
+
isTrend: number
|
|
882
|
+
/** 夜间模式图标 */
|
|
883
|
+
iconWhiteUrl: string
|
|
884
|
+
/** 固定1 */
|
|
885
|
+
forumType: number
|
|
481
886
|
/** 板块名称 */
|
|
482
|
-
|
|
887
|
+
name: string
|
|
888
|
+
forumListShowType: number
|
|
889
|
+
/** 图标 */
|
|
890
|
+
iconUrl: string
|
|
891
|
+
id: number
|
|
892
|
+
sort: number
|
|
893
|
+
/** 官方 */
|
|
894
|
+
isOfficial: number
|
|
483
895
|
}
|
|
484
896
|
|
|
485
897
|
export interface UserGame {
|
|
@@ -527,31 +939,18 @@ export interface DNARoleListRes {
|
|
|
527
939
|
|
|
528
940
|
/** 密函 */
|
|
529
941
|
export interface DNARoleForToolInstance {
|
|
530
|
-
id: number
|
|
531
|
-
|
|
942
|
+
id: number
|
|
943
|
+
/** 中文 */
|
|
944
|
+
name: string
|
|
532
945
|
/** 密函编码 */
|
|
533
946
|
code: string
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
enum DNAInstanceMHType {
|
|
538
|
-
"角色" = "role",
|
|
539
|
-
"武器" = "weapon",
|
|
540
|
-
"魔之楔" = "mzx",
|
|
541
|
-
"role" = "角色",
|
|
542
|
-
"weapon" = "武器",
|
|
543
|
-
"mzx" = "魔之楔",
|
|
544
|
-
}
|
|
545
|
-
|
|
546
|
-
export function getDNAInstanceMHType(key: keyof typeof DNAInstanceMHType) {
|
|
547
|
-
return DNAInstanceMHType[key]
|
|
947
|
+
/** 固定0 */
|
|
948
|
+
on: number
|
|
548
949
|
}
|
|
549
950
|
|
|
550
951
|
export interface DNARoleForToolInstanceInfo {
|
|
551
952
|
/** 密函列表 */
|
|
552
953
|
instances: DNARoleForToolInstance[] // instances
|
|
553
|
-
/** 密函类型 */
|
|
554
|
-
mh_type?: DNAInstanceMHType // 密函类型
|
|
555
954
|
}
|
|
556
955
|
|
|
557
956
|
export interface DraftDoingInfo {
|
|
@@ -593,7 +992,9 @@ export interface DNARoleShortNoteRes {
|
|
|
593
992
|
draftInfo: DraftInfo
|
|
594
993
|
}
|
|
595
994
|
|
|
596
|
-
export interface
|
|
995
|
+
export interface DNARoleWeapon {
|
|
996
|
+
weaponId: number
|
|
997
|
+
weaponEid: string
|
|
597
998
|
/** 武器类型图标 */
|
|
598
999
|
elementIcon: string
|
|
599
1000
|
/** 武器图标 */
|
|
@@ -602,16 +1003,15 @@ export interface WeaponInsForTool {
|
|
|
602
1003
|
level: number
|
|
603
1004
|
/** 武器名称 */
|
|
604
1005
|
name: string
|
|
1006
|
+
/** 精炼等级 */
|
|
1007
|
+
skillLevel: number
|
|
605
1008
|
/** 是否解锁 */
|
|
606
1009
|
unLocked: boolean
|
|
607
|
-
weaponEid?: string
|
|
608
|
-
weaponId: number
|
|
609
1010
|
}
|
|
610
1011
|
|
|
611
|
-
export interface
|
|
612
|
-
charEid?: string
|
|
613
|
-
/** 角色id */
|
|
1012
|
+
export interface DNARoleChar {
|
|
614
1013
|
charId: number
|
|
1014
|
+
charEid: string
|
|
615
1015
|
/** 元素图标 */
|
|
616
1016
|
elementIcon: string
|
|
617
1017
|
/** 命座等级 */
|
|
@@ -626,47 +1026,47 @@ export interface RoleInsForTool {
|
|
|
626
1026
|
unLocked: boolean
|
|
627
1027
|
}
|
|
628
1028
|
|
|
629
|
-
export interface
|
|
630
|
-
|
|
631
|
-
|
|
1029
|
+
export interface DNARoleForToolRes {
|
|
1030
|
+
/** 角色信息 */
|
|
1031
|
+
roleInfo: DNARoleInfo
|
|
1032
|
+
/** 密函 */
|
|
1033
|
+
instanceInfo: DNARoleForToolInstanceInfo[]
|
|
632
1034
|
}
|
|
633
1035
|
|
|
634
|
-
export interface
|
|
1036
|
+
export interface DNARoleShow {
|
|
635
1037
|
/** 角色列表 */
|
|
636
|
-
roleChars:
|
|
1038
|
+
roleChars: DNARoleChar[]
|
|
637
1039
|
/** 武器列表 */
|
|
638
|
-
langRangeWeapons:
|
|
1040
|
+
langRangeWeapons: DNARoleWeapon[]
|
|
639
1041
|
/** 武器列表 */
|
|
640
|
-
closeWeapons:
|
|
1042
|
+
closeWeapons: DNARoleWeapon[]
|
|
641
1043
|
/** 角色头像 */
|
|
642
1044
|
headUrl: string
|
|
643
1045
|
/** 等级 */
|
|
644
1046
|
level: number
|
|
645
1047
|
/** 成就列表 */
|
|
646
|
-
params:
|
|
1048
|
+
params: DNARoleAchievement[]
|
|
647
1049
|
/** 角色id */
|
|
648
1050
|
roleId: string
|
|
649
1051
|
/** 角色名称 */
|
|
650
1052
|
roleName: string
|
|
651
1053
|
/** 迷津 */
|
|
652
|
-
rougeLikeInfo:
|
|
1054
|
+
rougeLikeInfo: DNARougeLikeInfo
|
|
653
1055
|
}
|
|
654
1056
|
|
|
655
|
-
export interface
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
/** 角色信息 */
|
|
659
|
-
roleShow: RoleShowForTool
|
|
1057
|
+
export interface DNARoleAchievement {
|
|
1058
|
+
paramKey: string // paramKey
|
|
1059
|
+
paramValue: string // paramValue
|
|
660
1060
|
}
|
|
661
1061
|
|
|
662
|
-
export interface
|
|
1062
|
+
export interface DNARoleInfo {
|
|
1063
|
+
/** 深渊信息 */
|
|
1064
|
+
abyssInfo: DNAAbyssInfo
|
|
663
1065
|
/** 角色信息 */
|
|
664
|
-
|
|
665
|
-
/** 密函 */
|
|
666
|
-
instanceInfo: DNARoleForToolInstanceInfo[]
|
|
1066
|
+
roleShow: DNARoleShow
|
|
667
1067
|
}
|
|
668
1068
|
|
|
669
|
-
export interface
|
|
1069
|
+
export interface DNARougeLikeInfo {
|
|
670
1070
|
/** 最大通过等级 */
|
|
671
1071
|
maxPassed: number
|
|
672
1072
|
/** 最大通过等级名称 */
|
|
@@ -678,17 +1078,17 @@ export interface RougeLikeInfo {
|
|
|
678
1078
|
/** 奖励总数 */
|
|
679
1079
|
rewardTotal: number
|
|
680
1080
|
/** 天赋信息 */
|
|
681
|
-
talentInfo:
|
|
1081
|
+
talentInfo: DNARougeLikeTalentInfo[]
|
|
682
1082
|
}
|
|
683
1083
|
|
|
684
|
-
export interface
|
|
1084
|
+
export interface DNARougeLikeTalentInfo {
|
|
685
1085
|
cur: string
|
|
686
1086
|
max: string
|
|
687
1087
|
}
|
|
688
1088
|
|
|
689
|
-
export interface
|
|
690
|
-
/**
|
|
691
|
-
bestTimeVo1:
|
|
1089
|
+
export interface DNAAbyssInfo {
|
|
1090
|
+
/** 阵容 */
|
|
1091
|
+
bestTimeVo1: DNABestTimeVo1
|
|
692
1092
|
/** 结束时间 */
|
|
693
1093
|
endTime: string
|
|
694
1094
|
/** 操作名称 */
|
|
@@ -701,7 +1101,8 @@ export interface AbyssInfo {
|
|
|
701
1101
|
startTime: string
|
|
702
1102
|
}
|
|
703
1103
|
|
|
704
|
-
|
|
1104
|
+
/** 深渊阵容 */
|
|
1105
|
+
export interface DNABestTimeVo1 {
|
|
705
1106
|
/** 角色图标 */
|
|
706
1107
|
charIcon: string
|
|
707
1108
|
/** 近战武器图标 */
|
|
@@ -710,13 +1111,18 @@ export interface BestTimeVo1 {
|
|
|
710
1111
|
langRangeWeaponIcon: string
|
|
711
1112
|
/** 魔灵图标 */
|
|
712
1113
|
petIcon: string
|
|
1114
|
+
/** 协战角色图标1 */
|
|
713
1115
|
phantomCharIcon1: string
|
|
714
|
-
|
|
1116
|
+
/** 协战武器图标1 */
|
|
715
1117
|
phantomWeaponIcon1: string
|
|
1118
|
+
/** 协战角色图标2 */
|
|
1119
|
+
phantomCharIcon2: string
|
|
1120
|
+
/** 协战武器图标2 */
|
|
716
1121
|
phantomWeaponIcon2: string
|
|
717
1122
|
}
|
|
718
1123
|
|
|
719
|
-
|
|
1124
|
+
/** 角色属性 */
|
|
1125
|
+
export interface DNACharAttribute {
|
|
720
1126
|
/** 技能范围 */
|
|
721
1127
|
skillRange: string
|
|
722
1128
|
/** 强化值 */
|
|
@@ -726,7 +1132,7 @@ export interface RoleAttribute {
|
|
|
726
1132
|
/** 武器精通 */
|
|
727
1133
|
weaponTags: string[]
|
|
728
1134
|
/** 防御 */
|
|
729
|
-
|
|
1135
|
+
def: number
|
|
730
1136
|
/** 仇恨值 */
|
|
731
1137
|
enmityValue: string
|
|
732
1138
|
/** 技能效益 */
|
|
@@ -743,7 +1149,8 @@ export interface RoleAttribute {
|
|
|
743
1149
|
maxSp: number
|
|
744
1150
|
}
|
|
745
1151
|
|
|
746
|
-
|
|
1152
|
+
/** 角色技能 */
|
|
1153
|
+
export interface DNARoleSkill {
|
|
747
1154
|
/** 技能id */
|
|
748
1155
|
skillId: number
|
|
749
1156
|
/** 技能图标 */
|
|
@@ -754,14 +1161,16 @@ export interface RoleSkill {
|
|
|
754
1161
|
skillName: string
|
|
755
1162
|
}
|
|
756
1163
|
|
|
757
|
-
|
|
1164
|
+
/** 溯源 */
|
|
1165
|
+
export interface DNARoleTrace {
|
|
758
1166
|
/** 溯源图标 */
|
|
759
1167
|
icon: string
|
|
760
1168
|
/** 溯源描述 */
|
|
761
1169
|
description: string
|
|
762
1170
|
}
|
|
763
1171
|
|
|
764
|
-
|
|
1172
|
+
/** 魔之楔 */
|
|
1173
|
+
export interface DNARoleMod {
|
|
765
1174
|
/** id 没佩戴为-1 */
|
|
766
1175
|
id: number
|
|
767
1176
|
/** 图标 */
|
|
@@ -772,11 +1181,12 @@ export interface Mode {
|
|
|
772
1181
|
name?: string
|
|
773
1182
|
}
|
|
774
1183
|
|
|
775
|
-
export interface
|
|
1184
|
+
export interface DNACharDetail {
|
|
1185
|
+
charId: number
|
|
776
1186
|
/** 角色属性 */
|
|
777
|
-
attribute:
|
|
1187
|
+
attribute: DNACharAttribute
|
|
778
1188
|
/** 角色技能 */
|
|
779
|
-
skills:
|
|
1189
|
+
skills: DNARoleSkill[]
|
|
780
1190
|
/** 立绘 */
|
|
781
1191
|
paint: string
|
|
782
1192
|
/** 角色名称 */
|
|
@@ -784,7 +1194,7 @@ export interface RoleDetail {
|
|
|
784
1194
|
/** 元素图标 */
|
|
785
1195
|
elementIcon: string
|
|
786
1196
|
/** 溯源 */
|
|
787
|
-
traces:
|
|
1197
|
+
traces: DNARoleTrace[]
|
|
788
1198
|
/** 当前魔之楔 */
|
|
789
1199
|
currentVolume: number
|
|
790
1200
|
/** 最大魔之楔 */
|
|
@@ -797,13 +1207,41 @@ export interface RoleDetail {
|
|
|
797
1207
|
gradeLevel: number
|
|
798
1208
|
/** 元素名称 */
|
|
799
1209
|
elementName: string
|
|
800
|
-
/**
|
|
801
|
-
modes:
|
|
1210
|
+
/** 魔之楔列表 */
|
|
1211
|
+
modes: DNARoleMod[]
|
|
802
1212
|
}
|
|
803
1213
|
|
|
804
|
-
export interface
|
|
1214
|
+
export interface DNACharDetailRes {
|
|
805
1215
|
/** 角色详情 */
|
|
806
|
-
charDetail:
|
|
1216
|
+
charDetail: DNACharDetail
|
|
1217
|
+
}
|
|
1218
|
+
|
|
1219
|
+
export interface DNAWeaponDetailRes {
|
|
1220
|
+
/** 武器详情 */
|
|
1221
|
+
weaponDetail: DNAWeaponDetail
|
|
1222
|
+
}
|
|
1223
|
+
|
|
1224
|
+
export interface DNAWeaponDetail {
|
|
1225
|
+
attribute: DNAWeaponAttribute
|
|
1226
|
+
currentVolume: number
|
|
1227
|
+
description: string
|
|
1228
|
+
elementIcon: string
|
|
1229
|
+
elementName: string
|
|
1230
|
+
icon: string
|
|
1231
|
+
id: number
|
|
1232
|
+
level: number
|
|
1233
|
+
modes: DNARoleMod[]
|
|
1234
|
+
name: string
|
|
1235
|
+
skillLevel: number
|
|
1236
|
+
sumVolume: number
|
|
1237
|
+
}
|
|
1238
|
+
|
|
1239
|
+
export interface DNAWeaponAttribute {
|
|
1240
|
+
atk: number
|
|
1241
|
+
crd: number
|
|
1242
|
+
cri: number
|
|
1243
|
+
speed: number
|
|
1244
|
+
trigger: number
|
|
807
1245
|
}
|
|
808
1246
|
|
|
809
1247
|
export interface DNADayAward {
|
|
@@ -876,24 +1314,200 @@ export interface DNATaskProcessRes {
|
|
|
876
1314
|
dailyTask: DNABBSTask[] // dailyTask
|
|
877
1315
|
}
|
|
878
1316
|
|
|
879
|
-
export interface
|
|
880
|
-
postList: DNAPost[]
|
|
1317
|
+
export interface DNATopicPostListRes {
|
|
1318
|
+
postList: DNAPost[]
|
|
1319
|
+
topic: DNATopicDetail
|
|
1320
|
+
hasNext: number
|
|
1321
|
+
}
|
|
1322
|
+
|
|
1323
|
+
export interface DNATopicDetail {
|
|
1324
|
+
backgroundUrl: string
|
|
1325
|
+
gameId: number
|
|
1326
|
+
sort: number
|
|
1327
|
+
topicDesc: string
|
|
1328
|
+
topicIconUrl: string
|
|
1329
|
+
topicId: number
|
|
1330
|
+
topicName: string
|
|
881
1331
|
}
|
|
882
1332
|
|
|
883
1333
|
export interface DNAPost {
|
|
884
|
-
|
|
885
|
-
|
|
1334
|
+
browseCount: string
|
|
1335
|
+
collectionCount: number
|
|
1336
|
+
commentCount: number
|
|
1337
|
+
gameForumId: number
|
|
1338
|
+
gameId: number
|
|
1339
|
+
gameName: string
|
|
1340
|
+
imgContent: DNAPostImgContent[]
|
|
1341
|
+
imgCount: number
|
|
1342
|
+
isCollect: number
|
|
1343
|
+
isCreator: number
|
|
1344
|
+
isElite: number
|
|
1345
|
+
isFollow: number
|
|
1346
|
+
isLike: number
|
|
1347
|
+
isLock: number
|
|
1348
|
+
isOfficial: number
|
|
1349
|
+
isPublisher: number
|
|
1350
|
+
likeCount: number
|
|
1351
|
+
postContent: string
|
|
1352
|
+
postCover: string
|
|
1353
|
+
postCoverVo: DNAPostCoverVo
|
|
1354
|
+
postId: string
|
|
1355
|
+
postStatus: number
|
|
1356
|
+
postTitle: string
|
|
1357
|
+
postType: number
|
|
1358
|
+
showTime: string
|
|
1359
|
+
topics: DNATopicShort[]
|
|
1360
|
+
userHeadUrl: string
|
|
1361
|
+
userId: string
|
|
1362
|
+
userLevel: number
|
|
1363
|
+
userModeratorIdentity: number
|
|
1364
|
+
userName: string
|
|
1365
|
+
}
|
|
1366
|
+
|
|
1367
|
+
export interface DNATopicShort {
|
|
1368
|
+
topicId: number
|
|
1369
|
+
topicName: string
|
|
1370
|
+
}
|
|
1371
|
+
|
|
1372
|
+
export interface DNAPostCoverVo {
|
|
1373
|
+
imgHeight: number
|
|
1374
|
+
imgWidth: number
|
|
1375
|
+
}
|
|
1376
|
+
|
|
1377
|
+
export interface DNAPostImgContent {
|
|
1378
|
+
imgHeight: number
|
|
1379
|
+
imgWidth: number
|
|
1380
|
+
url: string
|
|
1381
|
+
isAbnormal?: boolean
|
|
1382
|
+
}
|
|
1383
|
+
|
|
1384
|
+
export interface DNAPostListRes {
|
|
1385
|
+
postList: DNAPost[] // posts
|
|
1386
|
+
topList: any[]
|
|
1387
|
+
hasNext: number
|
|
886
1388
|
}
|
|
887
1389
|
|
|
888
1390
|
export interface DNAPostDetailRes {
|
|
889
|
-
|
|
1391
|
+
isHotCount: boolean
|
|
1392
|
+
gameId: number
|
|
1393
|
+
isFollow: number
|
|
1394
|
+
isLike: number
|
|
1395
|
+
postDetail: DNAPostDetail
|
|
1396
|
+
isCollect: number
|
|
1397
|
+
hasNext: number
|
|
1398
|
+
comment: DNAComment[]
|
|
890
1399
|
}
|
|
891
1400
|
|
|
892
1401
|
export interface DNAPostDetail {
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
1402
|
+
auditStatus: number
|
|
1403
|
+
browseCount: string
|
|
1404
|
+
checkStatus: number
|
|
1405
|
+
collectionCount: number
|
|
1406
|
+
commentCount: number
|
|
1407
|
+
gameForumId: number
|
|
1408
|
+
gameForumVo: DNAGameForumVo
|
|
1409
|
+
gameId: number
|
|
1410
|
+
gameName: string
|
|
1411
|
+
headCodeUrl: string
|
|
1412
|
+
id: string
|
|
1413
|
+
isCreator: number
|
|
1414
|
+
isElite: number
|
|
1415
|
+
isForceRecommend: number
|
|
1416
|
+
isHide: number
|
|
1417
|
+
isLock: number
|
|
1418
|
+
isMine: number
|
|
1419
|
+
isOfficial: number
|
|
1420
|
+
isRecommend: number
|
|
1421
|
+
isTop: number
|
|
1422
|
+
lastEditorTime?: string
|
|
1423
|
+
likeCount: number
|
|
1424
|
+
postContent: DNAPostContent[]
|
|
1425
|
+
postH5Content: string
|
|
1426
|
+
postTime: string
|
|
1427
|
+
postTitle: string
|
|
1428
|
+
postType: number
|
|
1429
|
+
postUserId: string
|
|
1430
|
+
refreshHour: number
|
|
1431
|
+
score: number
|
|
1432
|
+
topics: DNATopicShort[]
|
|
1433
|
+
userHeadCode: string
|
|
1434
|
+
userLevel: number
|
|
1435
|
+
userModeratorIdentity: number
|
|
1436
|
+
userName: string
|
|
1437
|
+
whiteUrl: any[]
|
|
1438
|
+
}
|
|
1439
|
+
|
|
1440
|
+
export interface DNAPostContent {
|
|
1441
|
+
contentType: PostContentType
|
|
1442
|
+
imgHeight: number
|
|
1443
|
+
imgWidth: number
|
|
1444
|
+
url?: string
|
|
1445
|
+
content?: string
|
|
1446
|
+
contentVideo?: DNAPostContentVideo
|
|
1447
|
+
}
|
|
1448
|
+
|
|
1449
|
+
export interface DNAComment {
|
|
1450
|
+
checkStatus: number
|
|
1451
|
+
commentContent: DNAPostContent[]
|
|
1452
|
+
commentId: string
|
|
1453
|
+
commentTime: string
|
|
1454
|
+
contentTextStatus: number
|
|
1455
|
+
floor: number
|
|
1456
|
+
isCreator: number
|
|
1457
|
+
isLike: number
|
|
1458
|
+
isMine: number
|
|
1459
|
+
isOfficial: number
|
|
1460
|
+
isPublisher: number
|
|
1461
|
+
likeCount: number
|
|
1462
|
+
replyCount: number
|
|
1463
|
+
replyVos: DNAReplyVos[]
|
|
1464
|
+
userHeadCode?: string
|
|
1465
|
+
userHeadUrl: string
|
|
1466
|
+
userId: string
|
|
1467
|
+
userLevel: number
|
|
1468
|
+
userModeratorIdentity: number
|
|
1469
|
+
userName: string
|
|
1470
|
+
}
|
|
1471
|
+
|
|
1472
|
+
export interface DNAReplyVos {
|
|
1473
|
+
checkStatus: number
|
|
1474
|
+
contentTextStatus: number
|
|
1475
|
+
createTime: number
|
|
1476
|
+
isCreator: number
|
|
1477
|
+
isLike: number
|
|
1478
|
+
isMine: number
|
|
1479
|
+
isOfficial: number
|
|
1480
|
+
isPublisher: number
|
|
1481
|
+
likeCount: number
|
|
1482
|
+
postCommentId: string
|
|
1483
|
+
postCommentReplayId: string
|
|
1484
|
+
replyContent: DNAPostContent[]
|
|
1485
|
+
replyContentStr: string
|
|
1486
|
+
replyId: string
|
|
1487
|
+
replyTime: string
|
|
1488
|
+
toUserIsCreator: number
|
|
1489
|
+
toUserModeratorIdentity: number
|
|
1490
|
+
toUserName: string
|
|
1491
|
+
userHeadCode?: string
|
|
1492
|
+
userHeadUrl: string
|
|
1493
|
+
userId: string
|
|
1494
|
+
userLevel: number
|
|
1495
|
+
userModeratorIdentity: number
|
|
1496
|
+
userName: string
|
|
1497
|
+
}
|
|
1498
|
+
|
|
1499
|
+
export interface DNAGameForumVo {
|
|
1500
|
+
forumDataType: number
|
|
1501
|
+
forumListShowType: number
|
|
1502
|
+
forumType: number
|
|
1503
|
+
forumUiType: number
|
|
1504
|
+
iconUrl: string
|
|
1505
|
+
iconWhiteUrl: string
|
|
1506
|
+
id: number
|
|
1507
|
+
isOfficial: number
|
|
1508
|
+
isTrend: number
|
|
1509
|
+
name: string
|
|
1510
|
+
sort: number
|
|
897
1511
|
}
|
|
898
1512
|
|
|
899
1513
|
export enum PostContentType {
|
|
@@ -902,26 +1516,11 @@ export enum PostContentType {
|
|
|
902
1516
|
VIDEO = 5,
|
|
903
1517
|
}
|
|
904
1518
|
|
|
905
|
-
export interface DNAPostContent {
|
|
906
|
-
contentType: PostContentType // content
|
|
907
|
-
content: string // content
|
|
908
|
-
url?: string // url
|
|
909
|
-
contentVideo?: DNAPostContentVideo // contentVideo
|
|
910
|
-
}
|
|
911
|
-
|
|
912
1519
|
export interface DNAPostContentVideo {
|
|
913
1520
|
videoUrl: string // videoUrl
|
|
914
1521
|
coverUrl?: string // coverUrl
|
|
915
1522
|
}
|
|
916
1523
|
|
|
917
|
-
// interface DNAWikiDetail {
|
|
918
|
-
// name: string // name
|
|
919
|
-
// }
|
|
920
|
-
|
|
921
|
-
// interface DNAWikiRes {
|
|
922
|
-
// wikis: DNAWikiDetail[] // wikis
|
|
923
|
-
// }
|
|
924
|
-
|
|
925
1524
|
class DNAApiResponse<T = any> {
|
|
926
1525
|
code: number = 0
|
|
927
1526
|
msg: string = ""
|