dna-api 0.2.1 → 0.2.4
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 +447 -53
- package/dist/index.js +3 -3
- package/dist/index.js.map +3 -3
- package/package.json +1 -1
- package/src/index.ts +537 -105
package/src/index.ts
CHANGED
|
@@ -7,7 +7,7 @@ const LOGIN_LOG_URL = `${MAIN_URL}/user/login/log`
|
|
|
7
7
|
const ROLE_LIST_URL = `${MAIN_URL}/role/list`
|
|
8
8
|
const ROLE_FOR_TOOL_URL = `${MAIN_URL}/role/defaultRoleForTool`
|
|
9
9
|
const ROLE_DETAIL_URL = `${MAIN_URL}/role/getCharDetail`
|
|
10
|
-
const WEAPON_DETAIL_URL = `${MAIN_URL}/
|
|
10
|
+
const WEAPON_DETAIL_URL = `${MAIN_URL}/role/getWeaponDetail`
|
|
11
11
|
const SHORT_NOTE_URL = `${MAIN_URL}/role/getShortNoteInfo`
|
|
12
12
|
const SIGN_CALENDAR_URL = `${MAIN_URL}/encourage/signin/show`
|
|
13
13
|
const GAME_SIGN_URL = `${MAIN_URL}/encourage/signin/signin`
|
|
@@ -15,11 +15,13 @@ const BBS_SIGN_URL = `${MAIN_URL}/user/signIn`
|
|
|
15
15
|
const HAVE_SIGN_IN_URL = `${MAIN_URL}/user/haveSignInNew`
|
|
16
16
|
const GET_TASK_PROCESS_URL = `${MAIN_URL}/encourage/level/getTaskProcess`
|
|
17
17
|
const GET_POST_LIST_URL = `${MAIN_URL}/forum/list`
|
|
18
|
+
const GET_POST_BY_TOPIC_URL = `${MAIN_URL}/forum/getPostByTopic`
|
|
18
19
|
const GET_POST_DETAIL_URL = `${MAIN_URL}/forum/getPostDetail`
|
|
19
20
|
const LIKE_POST_URL = `${MAIN_URL}/forum/like`
|
|
20
21
|
const SHARE_POST_URL = `${MAIN_URL}/encourage/level/shareTask`
|
|
21
22
|
const REPLY_POST_URL = `${MAIN_URL}/forum/comment/createComment`
|
|
22
|
-
const
|
|
23
|
+
const GET_GAME_CONFIG_URL = `${MAIN_URL}/config/getGameConfig`
|
|
24
|
+
const GET_MINE_URL = `${MAIN_URL}/user/mine`
|
|
23
25
|
|
|
24
26
|
enum RespCode {
|
|
25
27
|
ERROR = -999,
|
|
@@ -53,7 +55,6 @@ export class DNAAPI {
|
|
|
53
55
|
*/
|
|
54
56
|
constructor(
|
|
55
57
|
public dev_code: string,
|
|
56
|
-
public uid = "",
|
|
57
58
|
public token = "",
|
|
58
59
|
options: { fetchFn?: typeof fetch; is_h5?: boolean; rsa_public_key?: string } = {},
|
|
59
60
|
) {
|
|
@@ -84,14 +85,11 @@ export class DNAAPI {
|
|
|
84
85
|
/**
|
|
85
86
|
* 登录
|
|
86
87
|
*/
|
|
87
|
-
async login(mobile: string, code: string
|
|
88
|
+
async login(mobile: string, code: string) {
|
|
88
89
|
const data = { mobile, code, gameList: DNA_GAME_ID }
|
|
89
90
|
const res = await this._dna_request<DNALoginRes>(LOGIN_URL, data, { sign: true, refer: true })
|
|
90
91
|
if (res.is_success && res.data) {
|
|
91
92
|
const data = res.data
|
|
92
|
-
if (typeof data.userId === "string") {
|
|
93
|
-
this.uid = data.userId
|
|
94
|
-
}
|
|
95
93
|
if (typeof data.token === "string") {
|
|
96
94
|
this.token = data.token
|
|
97
95
|
}
|
|
@@ -118,23 +116,23 @@ export class DNAAPI {
|
|
|
118
116
|
*/
|
|
119
117
|
async getDefaultRoleForTool() {
|
|
120
118
|
const data = { type: 1 }
|
|
121
|
-
return await this._dna_request<DNARoleForToolRes>(ROLE_FOR_TOOL_URL, data, { sign: true })
|
|
119
|
+
return await this._dna_request<DNARoleForToolRes>(ROLE_FOR_TOOL_URL, data, { sign: true, token: true, tokenSig: true })
|
|
122
120
|
}
|
|
123
121
|
|
|
124
122
|
/**
|
|
125
123
|
* 获取角色详情
|
|
126
124
|
*/
|
|
127
|
-
async
|
|
128
|
-
const data = { charId: char_id, charEid: char_eid, type: 1 }
|
|
129
|
-
return await this._dna_request<
|
|
125
|
+
async getCharDetail(char_id: string, char_eid: string, otherUserId?: string) {
|
|
126
|
+
const data = { charId: char_id, charEid: char_eid, type: 1, otherUserId } as any
|
|
127
|
+
return await this._dna_request<DNACharDetailRes>(ROLE_DETAIL_URL, data)
|
|
130
128
|
}
|
|
131
129
|
|
|
132
130
|
/**
|
|
133
131
|
* 获取武器详情
|
|
134
132
|
*/
|
|
135
|
-
async getWeaponDetail(weapon_id: string) {
|
|
136
|
-
const data = { weaponId: weapon_id, type: 1 }
|
|
137
|
-
return await this._dna_request<
|
|
133
|
+
async getWeaponDetail(weapon_id: string, weapon_eid: string, otherUserId?: string) {
|
|
134
|
+
const data = { weaponId: weapon_id, weaponEid: weapon_eid, type: 1, otherUserId }
|
|
135
|
+
return await this._dna_request<DNAWeaponDetailRes>(WEAPON_DETAIL_URL, data)
|
|
138
136
|
}
|
|
139
137
|
|
|
140
138
|
/**
|
|
@@ -190,30 +188,59 @@ export class DNAAPI {
|
|
|
190
188
|
|
|
191
189
|
/**
|
|
192
190
|
* 获取帖子列表
|
|
191
|
+
* @param forumId 论坛ID
|
|
192
|
+
* @param pageIndex 页码
|
|
193
|
+
* @param pageSize 每页数量
|
|
194
|
+
* @param searchType 搜索类型 1:最新 2:热门
|
|
195
|
+
* @param timeType 时间类型 0:全部 1:今日 2:本周 3:本月
|
|
196
|
+
* @returns 帖子列表
|
|
193
197
|
*/
|
|
194
|
-
async getPostList() {
|
|
198
|
+
async getPostList(forumId: number = 48, pageIndex: number = 1, pageSize: number = 20, searchType: number = 1, timeType: number = 0) {
|
|
195
199
|
const data = {
|
|
196
|
-
forumId:
|
|
200
|
+
forumId: forumId,
|
|
197
201
|
gameId: DNA_GAME_ID,
|
|
198
|
-
pageIndex:
|
|
199
|
-
pageSize:
|
|
200
|
-
searchType:
|
|
201
|
-
timeType: 0
|
|
202
|
+
pageIndex: pageIndex,
|
|
203
|
+
pageSize: pageSize,
|
|
204
|
+
searchType: searchType, // 1:最新 2:热门
|
|
205
|
+
timeType: timeType, // 0:全部 1:今日 2:本周 3:本月
|
|
202
206
|
}
|
|
203
207
|
return await this._dna_request<DNAPostListRes>(GET_POST_LIST_URL, data)
|
|
204
208
|
}
|
|
205
209
|
|
|
210
|
+
/**
|
|
211
|
+
* 获取帖子列表
|
|
212
|
+
* @param forumId 论坛ID
|
|
213
|
+
* @param pageIndex 页码
|
|
214
|
+
* @param pageSize 每页数量
|
|
215
|
+
* @param searchType 搜索类型 1:最新 2:热门
|
|
216
|
+
* @param timeType 时间类型 0:全部 1:今日 2:本周 3:本月
|
|
217
|
+
* @returns 帖子列表
|
|
218
|
+
*/
|
|
219
|
+
async getPostsByTopic(
|
|
220
|
+
topicId: number = 177,
|
|
221
|
+
pageIndex: number = 1,
|
|
222
|
+
pageSize: number = 20,
|
|
223
|
+
searchType: number = 1,
|
|
224
|
+
timeType: number = 0,
|
|
225
|
+
) {
|
|
226
|
+
const data = {
|
|
227
|
+
topicId: topicId,
|
|
228
|
+
gameId: DNA_GAME_ID,
|
|
229
|
+
pageIndex: pageIndex,
|
|
230
|
+
pageSize: pageSize,
|
|
231
|
+
searchType: searchType, // 1:最新 2:热门
|
|
232
|
+
timeType: timeType, // 0:全部 1:今日 2:本周 3:本月
|
|
233
|
+
}
|
|
234
|
+
return await this._dna_request<DNAPostListRes>(GET_POST_BY_TOPIC_URL, data)
|
|
235
|
+
}
|
|
206
236
|
/**
|
|
207
237
|
* 获取帖子详情
|
|
238
|
+
* @param post_id 帖子ID
|
|
239
|
+
* @returns 帖子详情
|
|
208
240
|
*/
|
|
209
241
|
async getPostDetail(post_id: string) {
|
|
210
242
|
const data = { postId: post_id }
|
|
211
|
-
|
|
212
|
-
return await this._dna_request<DNAPostDetailRes>(GET_POST_DETAIL_URL, data)
|
|
213
|
-
} catch (e) {
|
|
214
|
-
console.error("get_post_detail", e as Error)
|
|
215
|
-
return DNAApiResponse.err("请求皎皎角服务失败")
|
|
216
|
-
}
|
|
243
|
+
return await this._dna_request<DNAPostDetailRes>(GET_POST_DETAIL_URL, data)
|
|
217
244
|
}
|
|
218
245
|
|
|
219
246
|
/**
|
|
@@ -231,23 +258,13 @@ export class DNAAPI {
|
|
|
231
258
|
postType: post.postType,
|
|
232
259
|
toUserId: post.userId,
|
|
233
260
|
}
|
|
234
|
-
|
|
235
|
-
return await this._dna_request(LIKE_POST_URL, data)
|
|
236
|
-
} catch (e) {
|
|
237
|
-
console.error("do_like", e as Error)
|
|
238
|
-
return DNAApiResponse.err("请求皎皎角服务失败")
|
|
239
|
-
}
|
|
261
|
+
return await this._dna_request(LIKE_POST_URL, data)
|
|
240
262
|
}
|
|
241
263
|
|
|
242
264
|
// 分享帖子
|
|
243
265
|
async doShare() {
|
|
244
266
|
const data = { gameId: DNA_GAME_ID }
|
|
245
|
-
|
|
246
|
-
return await this._dna_request(SHARE_POST_URL, data)
|
|
247
|
-
} catch (e) {
|
|
248
|
-
console.error("do_share", e as Error)
|
|
249
|
-
return DNAApiResponse.err("请求皎皎角服务失败")
|
|
250
|
-
}
|
|
267
|
+
return await this._dna_request(SHARE_POST_URL, data)
|
|
251
268
|
}
|
|
252
269
|
|
|
253
270
|
// 回复帖子
|
|
@@ -271,14 +288,30 @@ export class DNAAPI {
|
|
|
271
288
|
return await this._dna_request(REPLY_POST_URL, data, { sign: true, refer: true, params: { toUserId: post.userId } })
|
|
272
289
|
}
|
|
273
290
|
|
|
274
|
-
|
|
275
|
-
|
|
291
|
+
/**
|
|
292
|
+
* 获取用户信息
|
|
293
|
+
* @returns 用户信息
|
|
294
|
+
*/
|
|
295
|
+
async getOtherMine(userId = "709542994134436647") {
|
|
276
296
|
const data = {
|
|
277
|
-
otherUserId:
|
|
297
|
+
otherUserId: userId,
|
|
278
298
|
searchType: 1,
|
|
279
299
|
type: 2,
|
|
280
300
|
}
|
|
281
|
-
return await this._dna_request<
|
|
301
|
+
return await this._dna_request<DNAMineRes>(GET_MINE_URL, data)
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* 获取用户信息
|
|
306
|
+
* @returns 用户信息
|
|
307
|
+
*/
|
|
308
|
+
async getMine() {
|
|
309
|
+
return await this._dna_request<DNAMineRes>(GET_MINE_URL)
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
async getGameConfig() {
|
|
313
|
+
const data = { gameId: DNA_GAME_ID }
|
|
314
|
+
return await this._dna_request<DNAGameConfigRes[]>(GET_GAME_CONFIG_URL, data)
|
|
282
315
|
}
|
|
283
316
|
|
|
284
317
|
async getHeaders(options?: {
|
|
@@ -287,8 +320,9 @@ export class DNAAPI {
|
|
|
287
320
|
dev_code?: string
|
|
288
321
|
refer?: boolean
|
|
289
322
|
token?: string
|
|
323
|
+
tokenSig?: boolean
|
|
290
324
|
}) {
|
|
291
|
-
let { payload, exparams, dev_code = this.dev_code, refer, token = this.token } = options || {}
|
|
325
|
+
let { payload, exparams, dev_code = this.dev_code, refer, token = this.token, tokenSig } = options || {}
|
|
292
326
|
|
|
293
327
|
const CONTENT_TYPE = "application/x-www-form-urlencoded; charset=utf-8"
|
|
294
328
|
const iosBaseHeader = {
|
|
@@ -317,7 +351,7 @@ export class DNAAPI {
|
|
|
317
351
|
headers.token = token
|
|
318
352
|
}
|
|
319
353
|
if (typeof payload === "object") {
|
|
320
|
-
const si = build_signature(payload)
|
|
354
|
+
const si = build_signature(payload, tokenSig ? token : "")
|
|
321
355
|
Object.assign(payload, { sign: si.s, timestamp: si.t })
|
|
322
356
|
if (exparams) {
|
|
323
357
|
Object.assign(payload, exparams)
|
|
@@ -348,6 +382,8 @@ export class DNAAPI {
|
|
|
348
382
|
options?: {
|
|
349
383
|
method?: "GET" | "POST"
|
|
350
384
|
sign?: boolean
|
|
385
|
+
tokenSig?: boolean
|
|
386
|
+
token?: boolean
|
|
351
387
|
refer?: boolean
|
|
352
388
|
params?: Record<string, any>
|
|
353
389
|
max_retries?: number
|
|
@@ -355,23 +391,37 @@ export class DNAAPI {
|
|
|
355
391
|
timeout?: number
|
|
356
392
|
},
|
|
357
393
|
): Promise<DNAApiResponse<T>> {
|
|
358
|
-
let { method = "POST", sign, refer, params, max_retries = 3, retry_delay = 1, timeout = 10000 } = options || {}
|
|
394
|
+
let { method = "POST", sign, refer, params, max_retries = 3, retry_delay = 1, timeout = 10000, token, tokenSig } = options || {}
|
|
359
395
|
let headers: Record<string, any>
|
|
360
396
|
if (sign) {
|
|
361
|
-
const { payload: p, headers: h } = await this.getHeaders({
|
|
397
|
+
const { payload: p, headers: h } = await this.getHeaders({
|
|
398
|
+
payload: data,
|
|
399
|
+
refer,
|
|
400
|
+
exparams: params,
|
|
401
|
+
token: token ? this.token : undefined,
|
|
402
|
+
tokenSig,
|
|
403
|
+
})
|
|
362
404
|
data = p
|
|
363
405
|
headers = h
|
|
364
406
|
} else {
|
|
365
|
-
const { headers: h } = await this.getHeaders()
|
|
407
|
+
const { headers: h } = await this.getHeaders({ token: token ? this.token : undefined })
|
|
366
408
|
headers = h
|
|
367
409
|
}
|
|
368
410
|
|
|
369
411
|
for (let attempt = 0; attempt < max_retries; attempt++) {
|
|
370
412
|
try {
|
|
413
|
+
let body: string = data
|
|
414
|
+
if (data && typeof data === "object") {
|
|
415
|
+
const p = new URLSearchParams()
|
|
416
|
+
Object.entries(data).forEach(([key, value]) => {
|
|
417
|
+
if (value !== undefined) p.append(key, String(value))
|
|
418
|
+
})
|
|
419
|
+
body = p.toString()
|
|
420
|
+
}
|
|
371
421
|
const fetchOptions: RequestInit = {
|
|
372
422
|
method,
|
|
373
423
|
headers,
|
|
374
|
-
body
|
|
424
|
+
body,
|
|
375
425
|
}
|
|
376
426
|
|
|
377
427
|
// 实现超时控制
|
|
@@ -409,9 +459,6 @@ export class DNAAPI {
|
|
|
409
459
|
}
|
|
410
460
|
}
|
|
411
461
|
|
|
412
|
-
console.debug(
|
|
413
|
-
`[DNA] url:[${url}] headers:[${JSON.stringify(headers)}] data:[${JSON.stringify(data)}] raw_res:${JSON.stringify(raw_res)}`,
|
|
414
|
-
)
|
|
415
462
|
return new DNAApiResponse<T>(raw_res)
|
|
416
463
|
} catch (e) {
|
|
417
464
|
console.error(`请求失败: ${(e as Error).message}`)
|
|
@@ -427,6 +474,128 @@ export class DNAAPI {
|
|
|
427
474
|
|
|
428
475
|
//#region 接口定义
|
|
429
476
|
|
|
477
|
+
export interface DNAMineRes {
|
|
478
|
+
mine: DNAMine
|
|
479
|
+
postList: DNAPost[]
|
|
480
|
+
hasNext: number
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
interface DNAMine {
|
|
484
|
+
/** 文章数量 */
|
|
485
|
+
articleCount: number
|
|
486
|
+
/** 收藏数量 */
|
|
487
|
+
collectCount: number
|
|
488
|
+
/** 评论数量 */
|
|
489
|
+
commentCount: number
|
|
490
|
+
/** 粉丝数量 */
|
|
491
|
+
fansCount: number
|
|
492
|
+
/** 新粉丝数量 */
|
|
493
|
+
fansNewCount: number
|
|
494
|
+
/** 关注数量 */
|
|
495
|
+
followCount: number
|
|
496
|
+
/** 性别 */
|
|
497
|
+
gender: number
|
|
498
|
+
/** 精华数量 */
|
|
499
|
+
goldNum: number
|
|
500
|
+
/** 头像 */
|
|
501
|
+
headUrl: string
|
|
502
|
+
/** 是否关注 */
|
|
503
|
+
isFollow: number
|
|
504
|
+
/** 是否登录用户 */
|
|
505
|
+
isLoginUser: number
|
|
506
|
+
/** 是否被禁言 */
|
|
507
|
+
isMute: number
|
|
508
|
+
/** 等级 */
|
|
509
|
+
levelTotal: number
|
|
510
|
+
/** 点赞数量 */
|
|
511
|
+
likeCount: number
|
|
512
|
+
/** 手机号 */
|
|
513
|
+
mobile: string
|
|
514
|
+
/** 管理员列表 */
|
|
515
|
+
moderatorVos: any[]
|
|
516
|
+
/** 帖子数量 */
|
|
517
|
+
postCount: number
|
|
518
|
+
/** 注册时间 */
|
|
519
|
+
registerTime: string
|
|
520
|
+
/** 状态 */
|
|
521
|
+
status: number
|
|
522
|
+
/** 趋势数量 */
|
|
523
|
+
trendCount: number
|
|
524
|
+
/** 用户ID */
|
|
525
|
+
userId: string
|
|
526
|
+
/** 用户名 */
|
|
527
|
+
userName: string
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
export interface DNAGameConfigRes {
|
|
531
|
+
/** 游戏所有板块列表 */
|
|
532
|
+
gameAllForumList: GameForum[]
|
|
533
|
+
/** 游戏ID */
|
|
534
|
+
gameId: number
|
|
535
|
+
/** 游戏板块图片列表 */
|
|
536
|
+
gameForumPictureList: any[]
|
|
537
|
+
/** 游戏板块列表 */
|
|
538
|
+
gameForumList: GameForum[]
|
|
539
|
+
/** 签到按钮图片 */
|
|
540
|
+
signBtn: string
|
|
541
|
+
sort: number
|
|
542
|
+
/** 话题列表 */
|
|
543
|
+
topicList: GameTopic[]
|
|
544
|
+
/** 背景图片 */
|
|
545
|
+
drawBackgroundUrl: string
|
|
546
|
+
/** 是否默认游戏 */
|
|
547
|
+
gameDefault: number
|
|
548
|
+
/** 签到颜色 */
|
|
549
|
+
signColor: string
|
|
550
|
+
/** 游戏名称 */
|
|
551
|
+
gameName: string
|
|
552
|
+
/** CM图片2 意味不明 */
|
|
553
|
+
drawListUrl: string
|
|
554
|
+
/** 英文站点 */
|
|
555
|
+
configTab: ConfigTab[]
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
export interface ConfigTab {
|
|
559
|
+
name: string
|
|
560
|
+
url: string
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
export interface GameTopic {
|
|
564
|
+
/** 话题背景图片 */
|
|
565
|
+
backgroundUrl: string
|
|
566
|
+
gameId: number
|
|
567
|
+
/** 话题图标 */
|
|
568
|
+
topicIconUrl: string
|
|
569
|
+
topicId: number
|
|
570
|
+
/** 话题名称 */
|
|
571
|
+
topicName: string
|
|
572
|
+
sort: number
|
|
573
|
+
/** 话题描述 */
|
|
574
|
+
topicDesc: string
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
export interface GameForum {
|
|
578
|
+
/** 全部=1 普通=3 */
|
|
579
|
+
forumDataType: number
|
|
580
|
+
/** 固定1 */
|
|
581
|
+
forumUiType: number
|
|
582
|
+
/** 小红点 */
|
|
583
|
+
isTrend: number
|
|
584
|
+
/** 夜间模式图标 */
|
|
585
|
+
iconWhiteUrl: string
|
|
586
|
+
/** 固定1 */
|
|
587
|
+
forumType: number
|
|
588
|
+
/** 板块名称 */
|
|
589
|
+
name: string
|
|
590
|
+
forumListShowType: number
|
|
591
|
+
/** 图标 */
|
|
592
|
+
iconUrl: string
|
|
593
|
+
id: number
|
|
594
|
+
sort: number
|
|
595
|
+
/** 官方 */
|
|
596
|
+
isOfficial: number
|
|
597
|
+
}
|
|
598
|
+
|
|
430
599
|
export interface UserGame {
|
|
431
600
|
gameId: number // gameId
|
|
432
601
|
gameName: string // gameName
|
|
@@ -472,11 +641,13 @@ export interface DNARoleListRes {
|
|
|
472
641
|
|
|
473
642
|
/** 密函 */
|
|
474
643
|
export interface DNARoleForToolInstance {
|
|
475
|
-
id: number
|
|
476
|
-
|
|
644
|
+
id: number
|
|
645
|
+
/** 中文 */
|
|
646
|
+
name: string
|
|
477
647
|
/** 密函编码 */
|
|
478
648
|
code: string
|
|
479
|
-
|
|
649
|
+
/** 固定0 */
|
|
650
|
+
on: number
|
|
480
651
|
}
|
|
481
652
|
|
|
482
653
|
enum DNAInstanceMHType {
|
|
@@ -538,7 +709,9 @@ export interface DNARoleShortNoteRes {
|
|
|
538
709
|
draftInfo: DraftInfo
|
|
539
710
|
}
|
|
540
711
|
|
|
541
|
-
export interface
|
|
712
|
+
export interface DNARoleWeapon {
|
|
713
|
+
weaponId: number
|
|
714
|
+
weaponEid: string
|
|
542
715
|
/** 武器类型图标 */
|
|
543
716
|
elementIcon: string
|
|
544
717
|
/** 武器图标 */
|
|
@@ -547,15 +720,15 @@ export interface WeaponInsForTool {
|
|
|
547
720
|
level: number
|
|
548
721
|
/** 武器名称 */
|
|
549
722
|
name: string
|
|
723
|
+
/** 精炼等级 */
|
|
724
|
+
skillLevel: number
|
|
550
725
|
/** 是否解锁 */
|
|
551
726
|
unLocked: boolean
|
|
552
|
-
weaponEid?: string
|
|
553
|
-
weaponId: number
|
|
554
727
|
}
|
|
555
728
|
|
|
556
|
-
export interface
|
|
557
|
-
charEid?: string
|
|
729
|
+
export interface DNARoleChar {
|
|
558
730
|
charId: number
|
|
731
|
+
charEid: string
|
|
559
732
|
/** 元素图标 */
|
|
560
733
|
elementIcon: string
|
|
561
734
|
/** 命座等级 */
|
|
@@ -570,41 +743,103 @@ export interface RoleInsForTool {
|
|
|
570
743
|
unLocked: boolean
|
|
571
744
|
}
|
|
572
745
|
|
|
573
|
-
export interface
|
|
574
|
-
|
|
575
|
-
|
|
746
|
+
export interface DNARoleForToolRes {
|
|
747
|
+
/** 角色信息 */
|
|
748
|
+
roleInfo: DNARoleInfo
|
|
749
|
+
/** 密函 */
|
|
750
|
+
instanceInfo: DNARoleForToolInstanceInfo[]
|
|
576
751
|
}
|
|
577
752
|
|
|
578
|
-
export interface
|
|
753
|
+
export interface DNARoleShow {
|
|
579
754
|
/** 角色列表 */
|
|
580
|
-
roleChars:
|
|
755
|
+
roleChars: DNARoleChar[]
|
|
581
756
|
/** 武器列表 */
|
|
582
|
-
langRangeWeapons:
|
|
757
|
+
langRangeWeapons: DNARoleWeapon[]
|
|
583
758
|
/** 武器列表 */
|
|
584
|
-
closeWeapons:
|
|
759
|
+
closeWeapons: DNARoleWeapon[]
|
|
760
|
+
/** 角色头像 */
|
|
761
|
+
headUrl: string
|
|
585
762
|
/** 等级 */
|
|
586
763
|
level: number
|
|
587
764
|
/** 成就列表 */
|
|
588
|
-
params:
|
|
765
|
+
params: DNARoleAchievement[]
|
|
589
766
|
/** 角色id */
|
|
590
767
|
roleId: string
|
|
591
768
|
/** 角色名称 */
|
|
592
769
|
roleName: string
|
|
770
|
+
/** 迷津 */
|
|
771
|
+
rougeLikeInfo: DNARougeLikeInfo
|
|
593
772
|
}
|
|
594
773
|
|
|
595
|
-
export interface
|
|
596
|
-
|
|
597
|
-
|
|
774
|
+
export interface DNARoleAchievement {
|
|
775
|
+
paramKey: string // paramKey
|
|
776
|
+
paramValue: string // paramValue
|
|
598
777
|
}
|
|
599
778
|
|
|
600
|
-
export interface
|
|
779
|
+
export interface DNARoleInfo {
|
|
780
|
+
/** 深渊信息 */
|
|
781
|
+
abyssInfo: DNAAbyssInfo
|
|
601
782
|
/** 角色信息 */
|
|
602
|
-
|
|
603
|
-
/** 密函 */
|
|
604
|
-
instanceInfo: DNARoleForToolInstanceInfo[]
|
|
783
|
+
roleShow: DNARoleShow
|
|
605
784
|
}
|
|
606
785
|
|
|
607
|
-
export interface
|
|
786
|
+
export interface DNARougeLikeInfo {
|
|
787
|
+
/** 最大通过等级 */
|
|
788
|
+
maxPassed: number
|
|
789
|
+
/** 最大通过等级名称 */
|
|
790
|
+
maxPassedName: string
|
|
791
|
+
/** 重置时间 */
|
|
792
|
+
resetTime: string
|
|
793
|
+
/** 奖励数量 */
|
|
794
|
+
rewardCount: number
|
|
795
|
+
/** 奖励总数 */
|
|
796
|
+
rewardTotal: number
|
|
797
|
+
/** 天赋信息 */
|
|
798
|
+
talentInfo: DNARougeLikeTalentInfo[]
|
|
799
|
+
}
|
|
800
|
+
|
|
801
|
+
export interface DNARougeLikeTalentInfo {
|
|
802
|
+
cur: string
|
|
803
|
+
max: string
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
export interface DNAAbyssInfo {
|
|
807
|
+
/** 阵容 */
|
|
808
|
+
bestTimeVo1: DNABestTimeVo1
|
|
809
|
+
/** 结束时间 */
|
|
810
|
+
endTime: string
|
|
811
|
+
/** 操作名称 */
|
|
812
|
+
operaName: string
|
|
813
|
+
/** 进度名称 */
|
|
814
|
+
progressName: string
|
|
815
|
+
/** 星级 */
|
|
816
|
+
stars: string
|
|
817
|
+
/** 开始时间 */
|
|
818
|
+
startTime: string
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
/** 深渊阵容 */
|
|
822
|
+
export interface DNABestTimeVo1 {
|
|
823
|
+
/** 角色图标 */
|
|
824
|
+
charIcon: string
|
|
825
|
+
/** 近战武器图标 */
|
|
826
|
+
closeWeaponIcon: string
|
|
827
|
+
/** 远程武器图标 */
|
|
828
|
+
langRangeWeaponIcon: string
|
|
829
|
+
/** 魔灵图标 */
|
|
830
|
+
petIcon: string
|
|
831
|
+
/** 协战角色图标1 */
|
|
832
|
+
phantomCharIcon1: string
|
|
833
|
+
/** 协战武器图标1 */
|
|
834
|
+
phantomWeaponIcon1: string
|
|
835
|
+
/** 协战角色图标2 */
|
|
836
|
+
phantomCharIcon2: string
|
|
837
|
+
/** 协战武器图标2 */
|
|
838
|
+
phantomWeaponIcon2: string
|
|
839
|
+
}
|
|
840
|
+
|
|
841
|
+
/** 角色属性 */
|
|
842
|
+
export interface DNACharAttribute {
|
|
608
843
|
/** 技能范围 */
|
|
609
844
|
skillRange: string
|
|
610
845
|
/** 强化值 */
|
|
@@ -614,7 +849,7 @@ export interface RoleAttribute {
|
|
|
614
849
|
/** 武器精通 */
|
|
615
850
|
weaponTags: string[]
|
|
616
851
|
/** 防御 */
|
|
617
|
-
|
|
852
|
+
def: number
|
|
618
853
|
/** 仇恨值 */
|
|
619
854
|
enmityValue: string
|
|
620
855
|
/** 技能效益 */
|
|
@@ -631,7 +866,8 @@ export interface RoleAttribute {
|
|
|
631
866
|
maxSp: number
|
|
632
867
|
}
|
|
633
868
|
|
|
634
|
-
|
|
869
|
+
/** 角色技能 */
|
|
870
|
+
export interface DNARoleSkill {
|
|
635
871
|
/** 技能id */
|
|
636
872
|
skillId: number
|
|
637
873
|
/** 技能图标 */
|
|
@@ -642,14 +878,16 @@ export interface RoleSkill {
|
|
|
642
878
|
skillName: string
|
|
643
879
|
}
|
|
644
880
|
|
|
645
|
-
|
|
881
|
+
/** 溯源 */
|
|
882
|
+
export interface DNARoleTrace {
|
|
646
883
|
/** 溯源图标 */
|
|
647
884
|
icon: string
|
|
648
885
|
/** 溯源描述 */
|
|
649
886
|
description: string
|
|
650
887
|
}
|
|
651
888
|
|
|
652
|
-
|
|
889
|
+
/** 魔之楔 */
|
|
890
|
+
export interface DNARoleMod {
|
|
653
891
|
/** id 没佩戴为-1 */
|
|
654
892
|
id: number
|
|
655
893
|
/** 图标 */
|
|
@@ -660,11 +898,12 @@ export interface Mode {
|
|
|
660
898
|
name?: string
|
|
661
899
|
}
|
|
662
900
|
|
|
663
|
-
export interface
|
|
901
|
+
export interface DNACharDetail {
|
|
902
|
+
charId: number
|
|
664
903
|
/** 角色属性 */
|
|
665
|
-
attribute:
|
|
904
|
+
attribute: DNACharAttribute
|
|
666
905
|
/** 角色技能 */
|
|
667
|
-
skills:
|
|
906
|
+
skills: DNARoleSkill[]
|
|
668
907
|
/** 立绘 */
|
|
669
908
|
paint: string
|
|
670
909
|
/** 角色名称 */
|
|
@@ -672,7 +911,7 @@ export interface RoleDetail {
|
|
|
672
911
|
/** 元素图标 */
|
|
673
912
|
elementIcon: string
|
|
674
913
|
/** 溯源 */
|
|
675
|
-
traces:
|
|
914
|
+
traces: DNARoleTrace[]
|
|
676
915
|
/** 当前魔之楔 */
|
|
677
916
|
currentVolume: number
|
|
678
917
|
/** 最大魔之楔 */
|
|
@@ -685,13 +924,41 @@ export interface RoleDetail {
|
|
|
685
924
|
gradeLevel: number
|
|
686
925
|
/** 元素名称 */
|
|
687
926
|
elementName: string
|
|
688
|
-
/**
|
|
689
|
-
modes:
|
|
927
|
+
/** 魔之楔列表 */
|
|
928
|
+
modes: DNARoleMod[]
|
|
690
929
|
}
|
|
691
930
|
|
|
692
|
-
export interface
|
|
931
|
+
export interface DNACharDetailRes {
|
|
693
932
|
/** 角色详情 */
|
|
694
|
-
charDetail:
|
|
933
|
+
charDetail: DNACharDetail
|
|
934
|
+
}
|
|
935
|
+
|
|
936
|
+
export interface DNAWeaponDetailRes {
|
|
937
|
+
/** 武器详情 */
|
|
938
|
+
weaponDetail: DNAWeaponDetail
|
|
939
|
+
}
|
|
940
|
+
|
|
941
|
+
export interface DNAWeaponDetail {
|
|
942
|
+
attribute: DNAWeaponAttribute
|
|
943
|
+
currentVolume: number
|
|
944
|
+
description: string
|
|
945
|
+
elementIcon: string
|
|
946
|
+
elementName: string
|
|
947
|
+
icon: string
|
|
948
|
+
id: number
|
|
949
|
+
level: number
|
|
950
|
+
modes: DNARoleMod[]
|
|
951
|
+
name: string
|
|
952
|
+
skillLevel: number
|
|
953
|
+
sumVolume: number
|
|
954
|
+
}
|
|
955
|
+
|
|
956
|
+
export interface DNAWeaponAttribute {
|
|
957
|
+
atk: number
|
|
958
|
+
crd: number
|
|
959
|
+
cri: number
|
|
960
|
+
speed: number
|
|
961
|
+
trigger: number
|
|
695
962
|
}
|
|
696
963
|
|
|
697
964
|
export interface DNADayAward {
|
|
@@ -764,24 +1031,198 @@ export interface DNATaskProcessRes {
|
|
|
764
1031
|
dailyTask: DNABBSTask[] // dailyTask
|
|
765
1032
|
}
|
|
766
1033
|
|
|
767
|
-
export interface
|
|
768
|
-
postList: DNAPost[]
|
|
1034
|
+
export interface DNATopicPostListRes {
|
|
1035
|
+
postList: DNAPost[]
|
|
1036
|
+
topic: DNATopicDetail
|
|
1037
|
+
hasNext: number
|
|
1038
|
+
}
|
|
1039
|
+
|
|
1040
|
+
export interface DNATopicDetail {
|
|
1041
|
+
backgroundUrl: string
|
|
1042
|
+
gameId: number
|
|
1043
|
+
sort: number
|
|
1044
|
+
topicDesc: string
|
|
1045
|
+
topicIconUrl: string
|
|
1046
|
+
topicId: number
|
|
1047
|
+
topicName: string
|
|
769
1048
|
}
|
|
770
1049
|
|
|
771
1050
|
export interface DNAPost {
|
|
772
|
-
|
|
773
|
-
|
|
1051
|
+
browseCount: string
|
|
1052
|
+
collectionCount: number
|
|
1053
|
+
commentCount: number
|
|
1054
|
+
gameForumId: number
|
|
1055
|
+
gameId: number
|
|
1056
|
+
gameName: string
|
|
1057
|
+
imgContent: DNAPostImgContent[]
|
|
1058
|
+
imgCount: number
|
|
1059
|
+
isCollect: number
|
|
1060
|
+
isCreator: number
|
|
1061
|
+
isElite: number
|
|
1062
|
+
isFollow: number
|
|
1063
|
+
isLike: number
|
|
1064
|
+
isLock: number
|
|
1065
|
+
isOfficial: number
|
|
1066
|
+
isPublisher: number
|
|
1067
|
+
likeCount: number
|
|
1068
|
+
postContent: string
|
|
1069
|
+
postCover: string
|
|
1070
|
+
postCoverVo: DNAPostCoverVo
|
|
1071
|
+
postId: string
|
|
1072
|
+
postStatus: number
|
|
1073
|
+
postTitle: string
|
|
1074
|
+
postType: number
|
|
1075
|
+
showTime: string
|
|
1076
|
+
topics: DNATopicShort[]
|
|
1077
|
+
userHeadUrl: string
|
|
1078
|
+
userId: string
|
|
1079
|
+
userLevel: number
|
|
1080
|
+
userModeratorIdentity: number
|
|
1081
|
+
userName: string
|
|
1082
|
+
}
|
|
1083
|
+
|
|
1084
|
+
export interface DNATopicShort {
|
|
1085
|
+
topicId: number
|
|
1086
|
+
topicName: string
|
|
1087
|
+
}
|
|
1088
|
+
|
|
1089
|
+
export interface DNAPostCoverVo {
|
|
1090
|
+
imgHeight: number
|
|
1091
|
+
imgWidth: number
|
|
1092
|
+
}
|
|
1093
|
+
|
|
1094
|
+
export interface DNAPostImgContent {
|
|
1095
|
+
imgHeight: number
|
|
1096
|
+
imgWidth: number
|
|
1097
|
+
url: string
|
|
1098
|
+
isAbnormal?: boolean
|
|
1099
|
+
}
|
|
1100
|
+
|
|
1101
|
+
export interface DNAPostListRes {
|
|
1102
|
+
postList: DNAPost[] // posts
|
|
1103
|
+
topList: any[]
|
|
1104
|
+
hasNext: number
|
|
774
1105
|
}
|
|
775
1106
|
|
|
776
1107
|
export interface DNAPostDetailRes {
|
|
777
|
-
|
|
1108
|
+
isHotCount: boolean
|
|
1109
|
+
gameId: number
|
|
1110
|
+
isFollow: number
|
|
1111
|
+
isLike: number
|
|
1112
|
+
postDetail: DNAPostDetail
|
|
1113
|
+
isCollect: number
|
|
1114
|
+
hasNext: number
|
|
1115
|
+
comment: DNAComment[]
|
|
778
1116
|
}
|
|
779
1117
|
|
|
780
1118
|
export interface DNAPostDetail {
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
1119
|
+
auditStatus: number
|
|
1120
|
+
browseCount: string
|
|
1121
|
+
checkStatus: number
|
|
1122
|
+
collectionCount: number
|
|
1123
|
+
commentCount: number
|
|
1124
|
+
gameForumId: number
|
|
1125
|
+
gameForumVo: DNAGameForumVo
|
|
1126
|
+
gameId: number
|
|
1127
|
+
gameName: string
|
|
1128
|
+
headCodeUrl: string
|
|
1129
|
+
id: string
|
|
1130
|
+
isCreator: number
|
|
1131
|
+
isElite: number
|
|
1132
|
+
isForceRecommend: number
|
|
1133
|
+
isHide: number
|
|
1134
|
+
isLock: number
|
|
1135
|
+
isMine: number
|
|
1136
|
+
isOfficial: number
|
|
1137
|
+
isRecommend: number
|
|
1138
|
+
isTop: number
|
|
1139
|
+
lastEditorTime: string
|
|
1140
|
+
likeCount: number
|
|
1141
|
+
postContent: DNAPostContent[]
|
|
1142
|
+
postH5Content: string
|
|
1143
|
+
postTime: string
|
|
1144
|
+
postTitle: string
|
|
1145
|
+
postType: number
|
|
1146
|
+
postUserId: string
|
|
1147
|
+
refreshHour: number
|
|
1148
|
+
score: number
|
|
1149
|
+
userLevel: number
|
|
1150
|
+
userModeratorIdentity: number
|
|
1151
|
+
userName: string
|
|
1152
|
+
whiteUrl: any[]
|
|
1153
|
+
}
|
|
1154
|
+
|
|
1155
|
+
export interface DNAPostContent {
|
|
1156
|
+
contentType: PostContentType
|
|
1157
|
+
imgHeight: number
|
|
1158
|
+
imgWidth: number
|
|
1159
|
+
url?: string
|
|
1160
|
+
content?: string
|
|
1161
|
+
contentVideo?: DNAPostContentVideo
|
|
1162
|
+
}
|
|
1163
|
+
|
|
1164
|
+
export interface DNAComment {
|
|
1165
|
+
checkStatus: number
|
|
1166
|
+
commentContent: DNAPostContent[]
|
|
1167
|
+
commentId: string
|
|
1168
|
+
commentTime: string
|
|
1169
|
+
contentTextStatus: number
|
|
1170
|
+
floor: number
|
|
1171
|
+
isCreator: number
|
|
1172
|
+
isLike: number
|
|
1173
|
+
isMine: number
|
|
1174
|
+
isOfficial: number
|
|
1175
|
+
isPublisher: number
|
|
1176
|
+
likeCount: number
|
|
1177
|
+
replyCount: number
|
|
1178
|
+
replyVos: DNAReplyVos[]
|
|
1179
|
+
userHeadCode?: string
|
|
1180
|
+
userHeadUrl: string
|
|
1181
|
+
userId: string
|
|
1182
|
+
userLevel: number
|
|
1183
|
+
userModeratorIdentity: number
|
|
1184
|
+
userName: string
|
|
1185
|
+
}
|
|
1186
|
+
|
|
1187
|
+
export interface DNAReplyVos {
|
|
1188
|
+
checkStatus: number
|
|
1189
|
+
contentTextStatus: number
|
|
1190
|
+
createTime: number
|
|
1191
|
+
isCreator: number
|
|
1192
|
+
isLike: number
|
|
1193
|
+
isMine: number
|
|
1194
|
+
isOfficial: number
|
|
1195
|
+
isPublisher: number
|
|
1196
|
+
likeCount: number
|
|
1197
|
+
postCommentId: string
|
|
1198
|
+
postCommentReplayId: string
|
|
1199
|
+
replyContent: DNAPostContent[]
|
|
1200
|
+
replyContentStr: string
|
|
1201
|
+
replyId: string
|
|
1202
|
+
replyTime: string
|
|
1203
|
+
toUserIsCreator: number
|
|
1204
|
+
toUserModeratorIdentity: number
|
|
1205
|
+
toUserName: string
|
|
1206
|
+
userHeadCode?: string
|
|
1207
|
+
userHeadUrl: string
|
|
1208
|
+
userId: string
|
|
1209
|
+
userLevel: number
|
|
1210
|
+
userModeratorIdentity: number
|
|
1211
|
+
userName: string
|
|
1212
|
+
}
|
|
1213
|
+
|
|
1214
|
+
export interface DNAGameForumVo {
|
|
1215
|
+
forumDataType: number
|
|
1216
|
+
forumListShowType: number
|
|
1217
|
+
forumType: number
|
|
1218
|
+
forumUiType: number
|
|
1219
|
+
iconUrl: string
|
|
1220
|
+
iconWhiteUrl: string
|
|
1221
|
+
id: number
|
|
1222
|
+
isOfficial: number
|
|
1223
|
+
isTrend: number
|
|
1224
|
+
name: string
|
|
1225
|
+
sort: number
|
|
785
1226
|
}
|
|
786
1227
|
|
|
787
1228
|
export enum PostContentType {
|
|
@@ -790,13 +1231,6 @@ export enum PostContentType {
|
|
|
790
1231
|
VIDEO = 5,
|
|
791
1232
|
}
|
|
792
1233
|
|
|
793
|
-
export interface DNAPostContent {
|
|
794
|
-
contentType: PostContentType // content
|
|
795
|
-
content: string // content
|
|
796
|
-
url?: string // url
|
|
797
|
-
contentVideo?: DNAPostContentVideo // contentVideo
|
|
798
|
-
}
|
|
799
|
-
|
|
800
1234
|
export interface DNAPostContentVideo {
|
|
801
1235
|
videoUrl: string // videoUrl
|
|
802
1236
|
coverUrl?: string // coverUrl
|
|
@@ -890,7 +1324,6 @@ function signature_hash(text: string): string {
|
|
|
890
1324
|
}
|
|
891
1325
|
return chars.join("")
|
|
892
1326
|
}
|
|
893
|
-
|
|
894
1327
|
return swap_positions(md5_upper(text), [1, 13, 5, 17, 7, 23])
|
|
895
1328
|
}
|
|
896
1329
|
|
|
@@ -931,5 +1364,4 @@ function build_signature(data: Record<string, any>, token?: string): Record<stri
|
|
|
931
1364
|
const enc = xor_encode(sig, sec)
|
|
932
1365
|
return { s: enc, t: ts, k: sec }
|
|
933
1366
|
}
|
|
934
|
-
|
|
935
1367
|
//#endregion
|