feat: implement course listing and retrieval API with dedicated controller, service, and types.
This commit is contained in:
parent
4b335b6b49
commit
1aa3190ca4
3 changed files with 91 additions and 0 deletions
26
Backend/src/types/courses.types.ts
Normal file
26
Backend/src/types/courses.types.ts
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
import { Course, Prisma } from '@prisma/client';
|
||||
|
||||
// Use Prisma's CourseCreateInput for creating courses
|
||||
export interface createCourse {
|
||||
data: Prisma.CourseCreateInput;
|
||||
}
|
||||
|
||||
// Response type uses Prisma's Course model
|
||||
export interface createCourseResponse {
|
||||
code: number;
|
||||
message: string;
|
||||
data: Course;
|
||||
}
|
||||
|
||||
export interface listCourseResponse {
|
||||
code: number;
|
||||
message: string;
|
||||
data: Course[];
|
||||
total: number | null;
|
||||
}
|
||||
|
||||
export interface getCourseResponse {
|
||||
code: number;
|
||||
message: string;
|
||||
data: Course | null;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue