training_data/packages/common/src/models/select.ts

138 lines
2.0 KiB
TypeScript
Raw Normal View History

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,
2025-02-27 21:45:40 +08:00
parent: true,
parentId: true,
2025-02-26 21:08:38 +08:00
// watchableDepts: true,
// watchableStaffs: true,
2024-12-30 08:26:40 +08:00
updatedAt: true,
2025-02-26 23:18:14 +08:00
terms: {
select: {
id: true,
name: true,
taxonomyId: true,
taxonomy: {
select: {
id: true,
slug: true,
2025-02-27 21:45:40 +08:00
},
},
},
2025-02-26 23:18:14 +08:00
},
depts: true,
2024-12-30 08:26:40 +08:00
author: {
select: {
id: true,
showname: true,
avatar: true,
department: {
select: {
id: true,
name: true,
},
},
domain: {
select: {
id: true,
name: true,
},
},
},
},
2025-02-27 21:45:40 +08:00
meta: true,
2025-02-27 23:50:07 +08:00
views: true,
2024-12-30 08:26:40 +08:00
};
export const postUnDetailSelect: Prisma.PostSelect = {
id: true,
type: true,
title: true,
2025-02-27 23:50:07 +08:00
views: true,
2025-02-27 21:45:40 +08:00
parent: true,
parentId: true,
2024-12-30 08:26:40 +08:00
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,
2025-02-27 23:50:07 +08:00
2024-12-30 08:26:40 +08:00
title: true,
url: true,
option: true,
intent: true,
};
2025-02-06 16:32:52 +08:00
export const courseDetailSelect: Prisma.PostSelect = {
2025-01-08 00:56:15 +08:00
id: true,
title: true,
subTitle: true,
2025-02-27 23:50:07 +08:00
views: true,
2025-02-26 16:23:43 +08:00
type: true,
2025-02-27 21:45:40 +08:00
author: true,
authorId: true,
2025-02-06 16:32:52 +08:00
content: true,
2025-02-25 08:25:54 +08:00
depts: true,
2025-01-27 22:43:31 +08:00
// isFeatured: true,
2025-01-08 00:56:15 +08:00
createdAt: true,
2025-02-24 20:53:42 +08:00
updatedAt: true,
2025-01-08 00:56:15 +08:00
// 关联表选择
2025-02-25 08:25:54 +08:00
terms: {
select: {
id: true,
name: true,
2025-02-26 16:11:08 +08:00
taxonomyId: true,
2025-02-25 08:25:54 +08:00
taxonomy: {
select: {
id: true,
slug: true,
},
},
},
2025-02-24 20:53:42 +08:00
},
enrollments: {
select: {
id: true,
2025-01-08 00:56:15 +08:00
},
},
2025-02-06 16:32:52 +08:00
meta: true,
2025-02-24 20:53:42 +08:00
rating: true,
2025-01-08 00:56:15 +08:00
};
2025-02-26 16:11:08 +08:00
export const lectureDetailSelect: Prisma.PostSelect = {
id: true,
title: true,
subTitle: true,
content: true,
resources: true,
2025-02-27 23:50:07 +08:00
views: true,
2025-02-26 16:11:08 +08:00
createdAt: true,
updatedAt: true,
// 关联表选择
meta: true,
};