✨ feat(诸子列传): 初始下发进度
This commit is contained in:
@@ -437,10 +437,11 @@ export async function leaveServer(session: FrontendOrBackendSession) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function getAuthorBook(roleId: string) {
|
async function getAuthorBook(roleId: string) {
|
||||||
|
let result: { bookId: number, authors: { subId: number, star: number }[], progress: number, maxProgress: number }[] = [];
|
||||||
let authorBooks = await AuthorBookModel.findByRoleId(roleId);
|
let authorBooks = await AuthorBookModel.findByRoleId(roleId);
|
||||||
return authorBooks.map(authorBook => {
|
for(let [bookId, maxProgress] of gameData.authorBookMaxProgress) {
|
||||||
let maxProgress = gameData.authorBookMaxProgress.get(authorBook.bookId);
|
let authorBook = authorBooks.find(cur => cur.bookId == bookId);
|
||||||
let { bookId, authors, progress } = authorBook;
|
result.push({ bookId, authors: authorBook?.authors??[], progress: authorBook?.progress??0, maxProgress});
|
||||||
return { bookId, authors, progress, maxProgress: maxProgress??0 }
|
}
|
||||||
})
|
return result
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user