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:
@@ -1,19 +1,29 @@
|
||||
import {
|
||||
Controller,
|
||||
Get,
|
||||
Post,
|
||||
Put,
|
||||
Delete,
|
||||
Body,
|
||||
Param,
|
||||
Query,
|
||||
import {
|
||||
Controller,
|
||||
Get,
|
||||
Post,
|
||||
Put,
|
||||
Delete,
|
||||
Body,
|
||||
Param,
|
||||
Query,
|
||||
UseGuards,
|
||||
HttpCode,
|
||||
HttpStatus
|
||||
HttpStatus,
|
||||
} from '@nestjs/common';
|
||||
import { ApiTags, ApiOperation, ApiResponse, ApiBearerAuth } from '@nestjs/swagger';
|
||||
import {
|
||||
ApiTags,
|
||||
ApiOperation,
|
||||
ApiResponse,
|
||||
ApiBearerAuth,
|
||||
} from '@nestjs/swagger';
|
||||
import { MenuAdminService } from '../../services/admin/MenuAdminService';
|
||||
import { CreateMenuDto, UpdateMenuDto, QueryMenuDto, BatchUpdateStatusDto } from '../../dto/admin/MenuDto';
|
||||
import {
|
||||
CreateMenuDto,
|
||||
UpdateMenuDto,
|
||||
QueryMenuDto,
|
||||
BatchUpdateMenuStatusDto,
|
||||
} from '../../dto/admin/MenuDto';
|
||||
import { JwtAuthGuard } from '../../../auth/guards/JwtAuthGuard';
|
||||
import { RolesGuard } from '../../../auth/guards/RolesGuard';
|
||||
import { Roles } from '../../../auth/decorators/RolesDecorator';
|
||||
@@ -66,7 +76,7 @@ export class MenuController {
|
||||
@Roles('admin')
|
||||
async updateMenu(
|
||||
@Param('id') id: string,
|
||||
@Body() updateMenuDto: UpdateMenuDto
|
||||
@Body() updateMenuDto: UpdateMenuDto,
|
||||
) {
|
||||
return await this.menuAdminService.updateMenu(Number(id), updateMenuDto);
|
||||
}
|
||||
@@ -99,17 +109,23 @@ export class MenuController {
|
||||
@Roles('admin')
|
||||
async updateMenuStatus(
|
||||
@Param('id') id: string,
|
||||
@Body() body: { status: number }
|
||||
@Body() body: { status: number },
|
||||
) {
|
||||
return await this.menuAdminService.updateMenuStatus(Number(id), body.status);
|
||||
return await this.menuAdminService.updateMenuStatus(
|
||||
Number(id),
|
||||
body.status,
|
||||
);
|
||||
}
|
||||
|
||||
@Put('batch/status')
|
||||
@ApiOperation({ summary: '批量更新菜单状态' })
|
||||
@ApiResponse({ status: 200, description: '批量更新菜单状态成功' })
|
||||
@Roles('admin')
|
||||
async batchUpdateMenuStatus(@Body() body: BatchUpdateStatusDto) {
|
||||
return await this.menuAdminService.batchUpdateMenuStatus(body.menuIds, body.status);
|
||||
async batchUpdateMenuStatus(@Body() body: BatchUpdateMenuStatusDto) {
|
||||
return await this.menuAdminService.batchUpdateMenuStatus(
|
||||
body.menuIds,
|
||||
body.status,
|
||||
);
|
||||
}
|
||||
|
||||
@Get('stats/overview')
|
||||
@@ -127,4 +143,4 @@ export class MenuController {
|
||||
async exportMenus() {
|
||||
return await this.menuAdminService.exportMenus();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,19 +1,30 @@
|
||||
import {
|
||||
Controller,
|
||||
Get,
|
||||
Post,
|
||||
Put,
|
||||
Delete,
|
||||
Body,
|
||||
Param,
|
||||
Query,
|
||||
import {
|
||||
Controller,
|
||||
Get,
|
||||
Post,
|
||||
Put,
|
||||
Delete,
|
||||
Body,
|
||||
Param,
|
||||
Query,
|
||||
UseGuards,
|
||||
HttpCode,
|
||||
HttpStatus
|
||||
HttpStatus,
|
||||
} from '@nestjs/common';
|
||||
import { ApiTags, ApiOperation, ApiResponse, ApiBearerAuth } from '@nestjs/swagger';
|
||||
import {
|
||||
ApiTags,
|
||||
ApiOperation,
|
||||
ApiResponse,
|
||||
ApiBearerAuth,
|
||||
} from '@nestjs/swagger';
|
||||
import { RoleAdminService } from '../../services/admin/RoleAdminService';
|
||||
import { CreateRoleDto, UpdateRoleDto, QueryRoleDto, BatchUpdateStatusDto, AssignMenusDto } from '../../dto/admin/RoleDto';
|
||||
import {
|
||||
CreateRoleDto,
|
||||
UpdateRoleDto,
|
||||
QueryRoleDto,
|
||||
BatchUpdateRoleStatusDto,
|
||||
AssignMenusDto,
|
||||
} from '../../dto/admin/RoleDto';
|
||||
import { JwtAuthGuard } from '../../../auth/guards/JwtAuthGuard';
|
||||
import { RolesGuard } from '../../../auth/guards/RolesGuard';
|
||||
import { Roles } from '../../../auth/decorators/RolesDecorator';
|
||||
@@ -59,7 +70,7 @@ export class RoleController {
|
||||
@Roles('admin')
|
||||
async updateRole(
|
||||
@Param('id') id: string,
|
||||
@Body() updateRoleDto: UpdateRoleDto
|
||||
@Body() updateRoleDto: UpdateRoleDto,
|
||||
) {
|
||||
return await this.roleAdminService.updateRole(Number(id), updateRoleDto);
|
||||
}
|
||||
@@ -90,17 +101,23 @@ export class RoleController {
|
||||
@Roles('admin')
|
||||
async updateRoleStatus(
|
||||
@Param('id') id: string,
|
||||
@Body() body: { status: number }
|
||||
@Body() body: { status: number },
|
||||
) {
|
||||
return await this.roleAdminService.updateRoleStatus(Number(id), body.status);
|
||||
return await this.roleAdminService.updateRoleStatus(
|
||||
Number(id),
|
||||
body.status,
|
||||
);
|
||||
}
|
||||
|
||||
@Put('batch/status')
|
||||
@ApiOperation({ summary: '批量更新角色状态' })
|
||||
@ApiResponse({ status: 200, description: '批量更新角色状态成功' })
|
||||
@Roles('admin')
|
||||
async batchUpdateRoleStatus(@Body() body: BatchUpdateStatusDto) {
|
||||
return await this.roleAdminService.batchUpdateRoleStatus(body.roleIds, body.status);
|
||||
async batchUpdateRoleStatus(@Body() body: BatchUpdateRoleStatusDto) {
|
||||
return await this.roleAdminService.batchUpdateRoleStatus(
|
||||
body.roleIds,
|
||||
body.status,
|
||||
);
|
||||
}
|
||||
|
||||
@Put(':id/menus')
|
||||
@@ -110,9 +127,12 @@ export class RoleController {
|
||||
@Roles('admin')
|
||||
async assignMenus(
|
||||
@Param('id') id: string,
|
||||
@Body() assignMenusDto: AssignMenusDto
|
||||
@Body() assignMenusDto: AssignMenusDto,
|
||||
) {
|
||||
return await this.roleAdminService.assignMenus(Number(id), assignMenusDto.menuIds);
|
||||
return await this.roleAdminService.assignMenus(
|
||||
Number(id),
|
||||
assignMenusDto.menuIds,
|
||||
);
|
||||
}
|
||||
|
||||
@Get('stats/overview')
|
||||
@@ -130,4 +150,4 @@ export class RoleController {
|
||||
async exportRoles(@Body() query: any) {
|
||||
return await this.roleAdminService.exportRoles();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user