优化项目结构

This commit is contained in:
eafonyang
2026-08-13 14:23:01 +08:00
parent e40d9d6b27
commit d01b0c8f47
29 changed files with 620 additions and 872 deletions
@@ -96,8 +96,6 @@ router.post('/api/www/sections', async (req: Request, res: Response) => {
bodyColor: b.body_color || '',
bgType: b.bg_type || 'color',
bgValue: b.bg_value || '',
overlayEnabled: b.overlay_enabled ? 1 : 0,
overlayOpacity: b.overlay_opacity ?? '0.00',
overlineZh: b.overline_zh || '',
overlineEn: b.overline_en || '',
titleZh: b.title_zh || '',
@@ -148,8 +146,6 @@ router.put('/api/www/sections/:id', async (req: Request, res: Response) => {
bodyColor: b.body_color ?? existing.bodyColor,
bgType: b.bg_type ?? existing.bgType,
bgValue: b.bg_value ?? existing.bgValue,
overlayEnabled: b.overlay_enabled !== undefined ? (b.overlay_enabled ? 1 : 0) : existing.overlayEnabled,
overlayOpacity: b.overlay_opacity ?? existing.overlayOpacity,
overlineZh: b.overline_zh ?? existing.overlineZh,
overlineEn: b.overline_en ?? existing.overlineEn,
titleZh: b.title_zh ?? existing.titleZh,
@@ -1,4 +1,4 @@
import { mysqlTable, bigint, varchar, tinyint, int, text, decimal, json, datetime } from 'drizzle-orm/mysql-core';
import { mysqlTable, bigint, varchar, tinyint, int, text, json, datetime } from 'drizzle-orm/mysql-core';
import { sql } from 'drizzle-orm';
export const wwwSectionBlocks = mysqlTable('www_section_blocks', {
@@ -13,8 +13,6 @@ export const wwwSectionBlocks = mysqlTable('www_section_blocks', {
bodyColor: varchar('body_color', { length: 20 }).notNull().default(''),
bgType: varchar('bg_type', { length: 10 }).notNull().default('color'),
bgValue: varchar('bg_value', { length: 500 }).notNull().default(''),
overlayEnabled: tinyint('overlay_enabled').notNull().default(0),
overlayOpacity: decimal('overlay_opacity', { precision: 3, scale: 2 }).notNull().default('0.00'),
overlineZh: varchar('overline_zh', { length: 100 }).notNull().default(''),
overlineEn: varchar('overline_en', { length: 100 }).notNull().default(''),
titleZh: varchar('title_zh', { length: 200 }).notNull().default(''),