feat: Реализован полный CRUD для админ-панели и улучшена функциональность
- Portfolio CRUD: добавление, редактирование, удаление, переключение публикации - Services CRUD: полное управление услугами с возможностью активации/деактивации - Banner system: новая модель Banner с CRUD операциями и аналитикой кликов - Telegram integration: расширенные настройки бота, обнаружение чатов, отправка сообщений - Media management: улучшенная загрузка файлов с оптимизацией изображений и превью - UI improvements: обновлённые админ-панели с rich-text редактором и drag&drop загрузкой - Database: добавлена таблица banners с полями для баннеров и аналитики
This commit is contained in:
@@ -1,116 +1,82 @@
|
||||
const mongoose = require('mongoose');
|
||||
const { DataTypes } = require('sequelize');
|
||||
const { sequelize } = require('../config/database');
|
||||
|
||||
const siteSettingsSchema = new mongoose.Schema({
|
||||
const SiteSettings = sequelize.define('SiteSettings', {
|
||||
id: {
|
||||
type: DataTypes.UUID,
|
||||
defaultValue: DataTypes.UUIDV4,
|
||||
primaryKey: true
|
||||
},
|
||||
siteName: {
|
||||
type: String,
|
||||
default: 'SmartSolTech'
|
||||
type: DataTypes.STRING,
|
||||
defaultValue: 'SmartSolTech'
|
||||
},
|
||||
siteDescription: {
|
||||
type: String,
|
||||
default: 'Innovative technology solutions for modern businesses'
|
||||
type: DataTypes.TEXT,
|
||||
defaultValue: 'Innovative technology solutions for modern businesses'
|
||||
},
|
||||
logo: {
|
||||
type: String,
|
||||
default: '/images/logo.png'
|
||||
type: DataTypes.STRING,
|
||||
defaultValue: '/images/logo.png'
|
||||
},
|
||||
favicon: {
|
||||
type: String,
|
||||
default: '/images/favicon.ico'
|
||||
type: DataTypes.STRING,
|
||||
defaultValue: '/images/favicon.ico'
|
||||
},
|
||||
contact: {
|
||||
email: {
|
||||
type: String,
|
||||
default: 'info@smartsoltech.kr'
|
||||
},
|
||||
phone: {
|
||||
type: String,
|
||||
default: '+82-10-0000-0000'
|
||||
},
|
||||
address: {
|
||||
type: String,
|
||||
default: 'Seoul, South Korea'
|
||||
type: DataTypes.JSONB,
|
||||
defaultValue: {
|
||||
email: 'info@smartsoltech.kr',
|
||||
phone: '+82-10-0000-0000',
|
||||
address: 'Seoul, South Korea'
|
||||
}
|
||||
},
|
||||
social: {
|
||||
facebook: String,
|
||||
twitter: String,
|
||||
linkedin: String,
|
||||
instagram: String,
|
||||
github: String,
|
||||
telegram: String
|
||||
type: DataTypes.JSONB,
|
||||
defaultValue: {}
|
||||
},
|
||||
telegram: {
|
||||
botToken: String,
|
||||
chatId: String,
|
||||
isEnabled: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
type: DataTypes.JSONB,
|
||||
defaultValue: {
|
||||
isEnabled: false
|
||||
}
|
||||
},
|
||||
seo: {
|
||||
metaTitle: {
|
||||
type: String,
|
||||
default: 'SmartSolTech - Technology Solutions'
|
||||
},
|
||||
metaDescription: {
|
||||
type: String,
|
||||
default: 'Professional web development, mobile apps, and digital solutions in Korea'
|
||||
},
|
||||
keywords: {
|
||||
type: String,
|
||||
default: 'web development, mobile apps, UI/UX design, Korea, technology'
|
||||
},
|
||||
googleAnalytics: String,
|
||||
googleTagManager: String
|
||||
type: DataTypes.JSONB,
|
||||
defaultValue: {
|
||||
metaTitle: 'SmartSolTech - Technology Solutions',
|
||||
metaDescription: 'Professional web development, mobile apps, and digital solutions in Korea',
|
||||
keywords: 'web development, mobile apps, UI/UX design, Korea, technology'
|
||||
}
|
||||
},
|
||||
hero: {
|
||||
title: {
|
||||
type: String,
|
||||
default: 'Smart Technology Solutions'
|
||||
},
|
||||
subtitle: {
|
||||
type: String,
|
||||
default: 'We create innovative digital experiences that drive business growth'
|
||||
},
|
||||
backgroundImage: {
|
||||
type: String,
|
||||
default: '/images/hero-bg.jpg'
|
||||
},
|
||||
ctaText: {
|
||||
type: String,
|
||||
default: 'Get Started'
|
||||
},
|
||||
ctaLink: {
|
||||
type: String,
|
||||
default: '#contact'
|
||||
type: DataTypes.JSONB,
|
||||
defaultValue: {
|
||||
title: 'Smart Technology Solutions',
|
||||
subtitle: 'We create innovative digital experiences that drive business growth',
|
||||
backgroundImage: '/images/hero-bg.jpg',
|
||||
ctaText: 'Get Started',
|
||||
ctaLink: '#contact'
|
||||
}
|
||||
},
|
||||
about: {
|
||||
title: {
|
||||
type: String,
|
||||
default: 'About SmartSolTech'
|
||||
},
|
||||
description: {
|
||||
type: String,
|
||||
default: 'We are a team of passionate developers and designers creating cutting-edge technology solutions.'
|
||||
},
|
||||
image: {
|
||||
type: String,
|
||||
default: '/images/about.jpg'
|
||||
type: DataTypes.JSONB,
|
||||
defaultValue: {
|
||||
title: 'About SmartSolTech',
|
||||
description: 'We are a team of passionate developers and designers creating cutting-edge technology solutions.',
|
||||
image: '/images/about.jpg'
|
||||
}
|
||||
},
|
||||
maintenance: {
|
||||
isEnabled: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
message: {
|
||||
type: String,
|
||||
default: 'We are currently performing maintenance. Please check back soon.'
|
||||
type: DataTypes.JSONB,
|
||||
defaultValue: {
|
||||
isEnabled: false,
|
||||
message: 'We are currently performing maintenance. Please check back soon.'
|
||||
}
|
||||
}
|
||||
}, {
|
||||
tableName: 'site_settings',
|
||||
timestamps: true
|
||||
});
|
||||
|
||||
module.exports = mongoose.model('SiteSettings', siteSettingsSchema);
|
||||
module.exports = SiteSettings;
|
||||
Reference in New Issue
Block a user