feat: add pagination and random sorting to course listing endpoint with configurable page size and Fisher-Yates shuffle algorithm

This commit is contained in:
JakkrapartXD 2026-02-06 17:41:03 +07:00
parent 217c9c29b8
commit 3f93dc8ab5
3 changed files with 57 additions and 6 deletions

View file

@ -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 {