mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-06 03:20:13 +08:00
24 lines
448 B
TypeScript
24 lines
448 B
TypeScript
import { Schema } from 'mongoose'
|
|
|
|
export interface IResponse {
|
|
type: 'narrative' | 'dialogue'
|
|
content: string[]
|
|
speaker?: string
|
|
color?: string
|
|
}
|
|
|
|
export const responseSchema = new Schema<IResponse>({
|
|
type: {
|
|
type: String,
|
|
enum: ['narrative', 'dialogue'],
|
|
default: 'dialogue',
|
|
required: true,
|
|
},
|
|
content: {
|
|
type: [String],
|
|
required: true,
|
|
},
|
|
speaker: { type: String, default: 'Ada' },
|
|
color: String,
|
|
})
|