✨ feat(诸子列传): 查询其他好友数据
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import BaseModel from './BaseModel';
|
||||
import { index, getModelForClass, prop, DocumentType, modelOptions } from '@typegoose/typegoose';
|
||||
import { index, getModelForClass, prop, DocumentType } from '@typegoose/typegoose';
|
||||
|
||||
/**
|
||||
* 诸子百家
|
||||
@@ -28,8 +28,8 @@ export default class AuthorBook extends BaseModel {
|
||||
@prop({ required: true, default: [], type: Author, _id: false })
|
||||
authors: Author[];
|
||||
|
||||
public static async findByRoleId(roleId: string) {
|
||||
let result: AuthorBookType[] = await AuthorBookModel.find({ roleId }).select('-_id -roleId').lean();
|
||||
public static async findByRoleId(roleId: string, select = '-_id') {
|
||||
let result: AuthorBookType[] = await AuthorBookModel.find({ roleId }).select(select).lean();
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -216,6 +216,7 @@ export class HeroDetailParam {
|
||||
scroll: number;
|
||||
teraph: number;
|
||||
}
|
||||
authorBooks: { bookId: number, progress: number }[] = [];
|
||||
|
||||
constructor(hero: HeroType) {
|
||||
this.roleId = hero.roleId;
|
||||
@@ -263,4 +264,8 @@ export class HeroDetailParam {
|
||||
setArtifact(artifact: ArtifactModelType) {
|
||||
this.artifacts.push({ artifactId: artifact.artifactId, lv: artifact.lv });
|
||||
}
|
||||
|
||||
setAuthorBook(authorBooks: { bookId: number, progress: number }[]) {
|
||||
this.authorBooks = authorBooks;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user