feat: 完成 NestJS 后端核心底座开发 (M1-M6) 和 Ant Design Vue 前端迁移
主要更新: 1. 后端核心底座完成 (M1-M6): - 健康检查、指标监控、分布式锁 - 事件总线、队列系统、事务管理 - 安全守卫、多租户隔离、存储适配器 - 审计日志、配置管理、多语言支持 2. 前端迁移到 Ant Design Vue: - 从 Element Plus 迁移到 Ant Design Vue - 完善 system 模块 (role/menu/dept) - 修复依赖和配置问题 3. 文档完善: - AI 开发工作流文档 - 架构约束和开发规范 - 项目进度跟踪 4. 其他改进: - 修复编译错误和类型问题 - 完善测试用例 - 优化项目结构
This commit is contained in:
@@ -8,7 +8,12 @@ import {
|
||||
HttpCode,
|
||||
HttpStatus,
|
||||
} from '@nestjs/common';
|
||||
import { ApiTags, ApiOperation, ApiResponse, ApiBearerAuth } from '@nestjs/swagger';
|
||||
import {
|
||||
ApiTags,
|
||||
ApiOperation,
|
||||
ApiResponse,
|
||||
ApiBearerAuth,
|
||||
} from '@nestjs/swagger';
|
||||
import { JwtAuthGuard } from '../../auth/guards/JwtAuthGuard';
|
||||
import { RolesGuard } from '../../auth/guards/RolesGuard';
|
||||
import { Roles } from '../../auth/decorators/RolesDecorator';
|
||||
@@ -35,7 +40,9 @@ export class SiteSettingsController {
|
||||
@ApiOperation({ summary: '更新站点设置' })
|
||||
@ApiResponse({ status: 200, description: '站点设置更新成功' })
|
||||
@Roles('super', 'admin')
|
||||
async updateSiteSettings(@Body() updateSiteSettingsDto: UpdateSiteSettingsDto) {
|
||||
async updateSiteSettings(
|
||||
@Body() updateSiteSettingsDto: UpdateSiteSettingsDto,
|
||||
) {
|
||||
return this.siteSettingsService.updateSiteSettings(updateSiteSettingsDto);
|
||||
}
|
||||
|
||||
@@ -47,4 +54,4 @@ export class SiteSettingsController {
|
||||
async resetSiteSettings() {
|
||||
return this.siteSettingsService.resetSiteSettings();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,4 +88,4 @@ export class SiteSettingsDto {
|
||||
|
||||
@ApiProperty({ description: '关闭原因' })
|
||||
close_reason: string;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,10 @@ import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { Site } from './site.entity';
|
||||
import { UpdateSiteSettingsDto } from './site-settings.dto';
|
||||
import { DEFAULT_SITE_CONFIG, SYSTEM_CONSTANTS } from '../../../config/common/constants';
|
||||
import {
|
||||
DEFAULT_SITE_CONFIG,
|
||||
SYSTEM_CONSTANTS,
|
||||
} from '@wwjConfig/common/constants';
|
||||
|
||||
@Injectable()
|
||||
export class SiteSettingsService {
|
||||
@@ -30,7 +33,8 @@ export class SiteSettingsService {
|
||||
site_name: site.site_name || DEFAULT_SITE_CONFIG.site_name,
|
||||
site_title: site.site_title || DEFAULT_SITE_CONFIG.site_title,
|
||||
site_keywords: site.site_keywords || DEFAULT_SITE_CONFIG.site_keywords,
|
||||
site_description: site.site_description || DEFAULT_SITE_CONFIG.site_description,
|
||||
site_description:
|
||||
site.site_description || DEFAULT_SITE_CONFIG.site_description,
|
||||
site_logo: site.site_logo || DEFAULT_SITE_CONFIG.site_logo,
|
||||
site_favicon: site.site_favicon || DEFAULT_SITE_CONFIG.site_favicon,
|
||||
icp_number: site.icp_number || DEFAULT_SITE_CONFIG.icp_number,
|
||||
@@ -69,7 +73,8 @@ export class SiteSettingsService {
|
||||
site_name: site_name || DEFAULT_SITE_CONFIG.site_name,
|
||||
site_title: site_title || DEFAULT_SITE_CONFIG.site_title,
|
||||
site_keywords: site_keywords || DEFAULT_SITE_CONFIG.site_keywords,
|
||||
site_description: site_description || DEFAULT_SITE_CONFIG.site_description,
|
||||
site_description:
|
||||
site_description || DEFAULT_SITE_CONFIG.site_description,
|
||||
site_logo: site_logo || DEFAULT_SITE_CONFIG.site_logo,
|
||||
site_favicon: site_favicon || DEFAULT_SITE_CONFIG.site_favicon,
|
||||
icp_number: icp_number || DEFAULT_SITE_CONFIG.icp_number,
|
||||
@@ -82,7 +87,8 @@ export class SiteSettingsService {
|
||||
if (site_name !== undefined) site.site_name = site_name;
|
||||
if (site_title !== undefined) site.site_title = site_title;
|
||||
if (site_keywords !== undefined) site.site_keywords = site_keywords;
|
||||
if (site_description !== undefined) site.site_description = site_description;
|
||||
if (site_description !== undefined)
|
||||
site.site_description = site_description;
|
||||
if (site_logo !== undefined) site.site_logo = site_logo;
|
||||
if (site_favicon !== undefined) site.site_favicon = site_favicon;
|
||||
if (icp_number !== undefined) site.icp_number = icp_number;
|
||||
@@ -111,4 +117,4 @@ export class SiteSettingsService {
|
||||
await this.siteRepository.save(defaultSite);
|
||||
return { message: '站点设置重置成功' };
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ export class Site {
|
||||
site_id: number;
|
||||
|
||||
// 添加缺失的字段以匹配 PHP 项目
|
||||
@PrimaryGeneratedColumn({ name: 'id' })
|
||||
@Column({ name: 'id', type: 'int', default: 0 })
|
||||
id: number;
|
||||
|
||||
@Column({ name: 'site_title', type: 'varchar', length: 255, default: '' })
|
||||
@@ -129,4 +129,4 @@ export class Site {
|
||||
|
||||
@Column({ name: 'meta_keyword', type: 'varchar', length: 255, default: '' })
|
||||
meta_keyword: string;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,4 +10,4 @@ import { Site } from './site.entity';
|
||||
providers: [SiteSettingsService],
|
||||
exports: [SiteSettingsService],
|
||||
})
|
||||
export class SiteModule {}
|
||||
export class SiteModule {}
|
||||
|
||||
Reference in New Issue
Block a user