feat: add pagination and random sorting to course listing endpoint with configurable page size and Fisher-Yates shuffle algorithm
This commit is contained in:
parent
217c9c29b8
commit
3f93dc8ab5
3 changed files with 57 additions and 6 deletions
|
|
@ -1,10 +1,20 @@
|
|||
import { Course } from '@prisma/client';
|
||||
|
||||
export interface ListCoursesInput {
|
||||
category_id?: number;
|
||||
page?: number;
|
||||
limit?: number;
|
||||
random?: boolean;
|
||||
}
|
||||
|
||||
export interface listCourseResponse {
|
||||
code: number;
|
||||
message: string;
|
||||
data: Course[];
|
||||
total: number;
|
||||
page: number;
|
||||
limit: number;
|
||||
totalPages: number;
|
||||
}
|
||||
|
||||
export interface getCourseResponse {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue