Initial reader-api backend extracted from reader

This commit is contained in:
2026-03-24 13:55:10 +07:00
parent 56f8f5ccfc
commit 24f070d14e
69 changed files with 12167 additions and 1 deletions
+25
View File
@@ -0,0 +1,25 @@
import mongoose, { Schema, Document } from "mongoose"
export interface IEditorRecommendation extends Document {
novelId: string
editorId: string
createdAt: Date
updatedAt: Date
}
const EditorRecommendationSchema: Schema = new Schema(
{
novelId: { type: String, required: true, index: true },
editorId: { type: String, required: true, index: true },
},
{
timestamps: true,
}
)
EditorRecommendationSchema.index({ novelId: 1, editorId: 1 }, { unique: true })
EditorRecommendationSchema.index({ createdAt: -1 })
export const EditorRecommendation =
mongoose.models.EditorRecommendation ||
mongoose.model<IEditorRecommendation>("EditorRecommendation", EditorRecommendationSchema)