95 lines
1.7 KiB
TypeScript
Executable File
95 lines
1.7 KiB
TypeScript
Executable File
import {
|
|
Post,
|
|
Department,
|
|
Staff,
|
|
Enrollment,
|
|
Taxonomy,
|
|
Term,
|
|
} from "@prisma/client";
|
|
import { StaffDto } from "./staff";
|
|
import { TermDto } from "./term";
|
|
import { ResourceDto } from "./resource";
|
|
import { DepartmentDto } from "./department";
|
|
|
|
export type PostComment = {
|
|
id: string;
|
|
type: string;
|
|
title: string;
|
|
content: string;
|
|
authorId: string;
|
|
domainId: string;
|
|
referenceId: string;
|
|
resources: string[];
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
parentId: string;
|
|
author: {
|
|
id: string;
|
|
showname: string;
|
|
username: string;
|
|
avatar: string;
|
|
};
|
|
};
|
|
export type PostDto = Post & {
|
|
readed: boolean;
|
|
readedCount: number;
|
|
author: StaffDto;
|
|
limitedComments: PostComment[];
|
|
commentsCount: number;
|
|
perms?: {
|
|
delete: boolean;
|
|
// edit: boolean;
|
|
};
|
|
watchableDepts: Department[];
|
|
watchableStaffs: Staff[];
|
|
terms: TermDto[]
|
|
depts: DepartmentDto[]
|
|
meta?: {
|
|
thumbnail?: string
|
|
views?: number
|
|
}
|
|
};
|
|
|
|
export type LectureMeta = {
|
|
type?: string;
|
|
views?: number;
|
|
videoUrl?: string;
|
|
videoThumbnail?: string;
|
|
videoIds?: string[];
|
|
videoThumbnailIds?: string[];
|
|
};
|
|
|
|
export type Lecture = Post & {
|
|
resources?: ResourceDto[];
|
|
meta?: LectureMeta;
|
|
};
|
|
|
|
export type SectionMeta = {
|
|
objectives?: string[];
|
|
};
|
|
export type Section = Post & {
|
|
meta?: SectionMeta;
|
|
};
|
|
export type SectionDto = Section & {
|
|
lectures: Lecture[];
|
|
};
|
|
export type CourseMeta = {
|
|
thumbnail?: string;
|
|
|
|
objectives?: string[];
|
|
views?: number;
|
|
likes?: number;
|
|
hates?: number;
|
|
};
|
|
export type Course = Post & {
|
|
meta?: CourseMeta;
|
|
};
|
|
export type CourseDto = Course & {
|
|
enrollments?: Enrollment[];
|
|
sections?: SectionDto[];
|
|
terms: TermDto[];
|
|
lectureCount?: number;
|
|
depts: Department[];
|
|
studentIds: string[];
|
|
};
|