-
diff --git a/packages/common/src/models/post.ts b/packages/common/src/models/post.ts
index 037d004..d672bc8 100755
--- a/packages/common/src/models/post.ts
+++ b/packages/common/src/models/post.ts
@@ -40,20 +40,23 @@ export type PostDto = Post & {
delete: boolean;
// edit: boolean;
};
+ meta?: PostMeta;
watchableDepts: Department[];
watchableStaffs: Staff[];
terms: TermDto[];
depts: DepartmentDto[];
- meta?: {
- thumbnail?: string;
- views?: number;
- };
+
studentIds?: string[];
};
-
-export type LectureMeta = {
- type?: string;
+export type PostMeta = {
+ thumbnail?: string;
views?: number;
+ likes?: number;
+ hates?: number;
+};
+export type LectureMeta = PostMeta & {
+ type?: string;
+
videoUrl?: string;
videoThumbnail?: string;
videoIds?: string[];
@@ -65,7 +68,7 @@ export type Lecture = Post & {
meta?: LectureMeta;
};
-export type SectionMeta = {
+export type SectionMeta = PostMeta & {
objectives?: string[];
};
export type Section = Post & {
@@ -74,13 +77,8 @@ export type Section = Post & {
export type SectionDto = Section & {
lectures: Lecture[];
};
-export type CourseMeta = {
- thumbnail?: string;
-
+export type CourseMeta = PostMeta & {
objectives?: string[];
- views?: number;
- likes?: number;
- hates?: number;
};
export type Course = PostDto & {
meta?: CourseMeta;
@@ -93,3 +91,45 @@ export type CourseDto = Course & {
depts: Department[];
studentIds: string[];
};
+
+export type Summary = {
+ id: string;
+ text: string;
+ parent: string;
+ start: number;
+ end: number;
+};
+export type NodeObj = {
+ topic: string;
+ id: string;
+ style?: {
+ fontSize?: string;
+ color?: string;
+ background?: string;
+ fontWeight?: string;
+ };
+ children?: NodeObj[];
+};
+export type Arrow = {
+ id: string;
+ label: string;
+ from: string;
+ to: string;
+ delta1: {
+ x: number;
+ y: number;
+ };
+ delta2: {
+ x: number;
+ y: number;
+ };
+};
+export type PathMeta = PostMeta & {
+ nodeData: NodeObj;
+ arrows?: Arrow[];
+ summaries?: Summary[];
+ direction?: number;
+};
+export type PathDto = PostDto & {
+ meta: PathMeta;
+};
diff --git a/packages/common/src/models/select.ts b/packages/common/src/models/select.ts
index d63251a..8245ffe 100755
--- a/packages/common/src/models/select.ts
+++ b/packages/common/src/models/select.ts
@@ -6,6 +6,8 @@ export const postDetailSelect: Prisma.PostSelect = {
title: true,
content: true,
resources: true,
+ parent: true,
+ parentId: true,
// watchableDepts: true,
// watchableStaffs: true,
updatedAt: true,
@@ -18,9 +20,9 @@ export const postDetailSelect: Prisma.PostSelect = {
select: {
id: true,
slug: true,
- }
- }
- }
+ },
+ },
+ },
},
depts: true,
author: {
@@ -42,12 +44,14 @@ export const postDetailSelect: Prisma.PostSelect = {
},
},
},
- meta: true
+ meta: true,
};
export const postUnDetailSelect: Prisma.PostSelect = {
id: true,
type: true,
title: true,
+ parent: true,
+ parentId: true,
content: true,
resources: true,
updatedAt: true,
@@ -85,6 +89,8 @@ export const courseDetailSelect: Prisma.PostSelect = {
title: true,
subTitle: true,
type: true,
+ author: true,
+ authorId: true,
content: true,
depts: true,
// isFeatured: true,