2024-12-30 08:26:40 +08:00
|
|
|
import { Prisma } from "@prisma/client";
|
|
|
|
|
|
|
|
export const postDetailSelect: Prisma.PostSelect = {
|
|
|
|
id: true,
|
|
|
|
type: true,
|
|
|
|
title: true,
|
|
|
|
content: true,
|
2024-12-31 15:57:32 +08:00
|
|
|
resources: true,
|
2024-12-30 13:44:30 +08:00
|
|
|
watchableDepts: true,
|
|
|
|
watchableStaffs: true,
|
2024-12-30 08:26:40 +08:00
|
|
|
updatedAt: true,
|
|
|
|
author: {
|
|
|
|
select: {
|
|
|
|
id: true,
|
|
|
|
showname: true,
|
|
|
|
avatar: true,
|
|
|
|
department: {
|
|
|
|
select: {
|
|
|
|
id: true,
|
|
|
|
name: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
domain: {
|
|
|
|
select: {
|
|
|
|
id: true,
|
|
|
|
name: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
export const postUnDetailSelect: Prisma.PostSelect = {
|
|
|
|
id: true,
|
|
|
|
type: true,
|
|
|
|
title: true,
|
|
|
|
content: true,
|
2024-12-31 15:57:32 +08:00
|
|
|
resources: true,
|
2024-12-30 08:26:40 +08:00
|
|
|
updatedAt: true,
|
|
|
|
author: {
|
|
|
|
select: {
|
|
|
|
id: true,
|
|
|
|
showname: true,
|
|
|
|
avatar: true,
|
|
|
|
department: {
|
|
|
|
select: {
|
|
|
|
id: true,
|
|
|
|
name: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
domain: {
|
|
|
|
select: {
|
|
|
|
id: true,
|
|
|
|
name: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
export const messageDetailSelect: Prisma.MessageSelect = {
|
|
|
|
id: true,
|
|
|
|
sender: true,
|
|
|
|
content: true,
|
|
|
|
title: true,
|
|
|
|
url: true,
|
|
|
|
option: true,
|
|
|
|
intent: true,
|
|
|
|
};
|
2025-01-08 00:56:15 +08:00
|
|
|
export const courseDetailSelect: Prisma.CourseSelect = {
|
|
|
|
id: true,
|
|
|
|
title: true,
|
|
|
|
subTitle: true,
|
|
|
|
description: true,
|
|
|
|
thumbnail: true,
|
|
|
|
level: true,
|
|
|
|
requirements: true,
|
|
|
|
objectives: true,
|
2025-01-27 22:43:31 +08:00
|
|
|
// skills: true,
|
|
|
|
// audiences: true,
|
|
|
|
// totalDuration: true,
|
|
|
|
// totalLectures: true,
|
|
|
|
// averageRating: true,
|
|
|
|
// numberOfReviews: true,
|
|
|
|
// numberOfStudents: true,
|
|
|
|
// completionRate: true,
|
2025-01-08 00:56:15 +08:00
|
|
|
status: true,
|
2025-01-27 22:43:31 +08:00
|
|
|
// isFeatured: true,
|
2025-01-08 00:56:15 +08:00
|
|
|
createdAt: true,
|
|
|
|
publishedAt: true,
|
|
|
|
// 关联表选择
|
|
|
|
sections: {
|
|
|
|
include: {
|
|
|
|
lectures: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
enrollments: true,
|
|
|
|
};
|