This commit is contained in:
payacom
2026-07-11 20:52:56 +03:30
parent 3c90976f23
commit 54971578b0
6 changed files with 103 additions and 10 deletions

View File

@@ -1,6 +1,18 @@
const mongoose = require('mongoose')
const timestamp = require('mongoose-timestamp')
// متن‌های روی استوری با مختصات نسبی (۰ تا ۱) تا در هر ابعادی درست رندر شوند
const overlaySchema = new mongoose.Schema({
text: { type: String, default: '' },
x: { type: Number, default: 0.5 },
y: { type: Number, default: 0.5 },
font_size: { type: Number, default: 0.06 },
color: { type: String, default: '#ffffff' },
background: { type: String, default: '' },
rotation: { type: Number, default: 0 },
align: { type: String, default: 'center' }
}, { _id: false })
const storySchema = new mongoose.Schema({
user_id: {
type: mongoose.Schema.Types.ObjectId,
@@ -17,6 +29,10 @@ const storySchema = new mongoose.Schema({
enum: ['image', 'video'],
required: true
},
overlays: {
type: [overlaySchema],
default: []
},
expires_at: {
type: Date,
required: true,