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-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-06 16:32:52 +08:00
|
|
|
content: 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-24 20:53:42 +08:00
|
|
|
terms:{
|
|
|
|
select:{
|
|
|
|
id:true,
|
|
|
|
name:true,
|
|
|
|
taxonomy:{
|
|
|
|
select:{
|
|
|
|
id:true,
|
|
|
|
slug:true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
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
|
|
|
};
|