This commit is contained in:
ditiqi 2025-02-24 12:19:09 +08:00
parent e4f8cd3ef8
commit 8cb8de8fa9
1 changed files with 34 additions and 11 deletions

View File

@ -49,7 +49,7 @@ export class PostService extends BaseTreeService<Prisma.PostDelegate> {
meta: {
type: type,
},
},
} as any,
},
{ tx },
);
@ -71,7 +71,7 @@ export class PostService extends BaseTreeService<Prisma.PostDelegate> {
parentId: courseId,
title: title,
authorId: staff?.id,
},
} as any,
},
{ tx },
);
@ -216,13 +216,36 @@ export class PostService extends BaseTreeService<Prisma.PostDelegate> {
return { ...result, items };
});
}
async findManyWithPagination(args:
{ page?: number;
async findManyWithPagination(args: {
page?: number;
pageSize?: number;
where?: Prisma.PostWhereInput;
select?: Prisma.PostSelect<DefaultArgs>;
}): Promise<{ items: { id: string; type: string | null; level: string | null; state: string | null; title: string | null; subTitle: string | null; content: string | null; important: boolean | null; domainId: string | null; order: number | null; duration: number | null; rating: number | null; createdAt: Date; publishedAt: Date | null; updatedAt: Date; deletedAt: Date | null; authorId: string | null; parentId: string | null; hasChildren: boolean | null; meta: Prisma.JsonValue | null; }[]; totalPages: number; }>
{
}): Promise<{
items: {
id: string;
type: string | null;
level: string | null;
state: string | null;
title: string | null;
subTitle: string | null;
content: string | null;
important: boolean | null;
domainId: string | null;
order: number | null;
duration: number | null;
rating: number | null;
createdAt: Date;
publishedAt: Date | null;
updatedAt: Date;
deletedAt: Date | null;
authorId: string | null;
parentId: string | null;
hasChildren: boolean | null;
meta: Prisma.JsonValue | null;
}[];
totalPages: number;
}> {
return super.findManyWithPagination(args);
}
protected async setPerms(data: Post, staff?: UserProfile) {