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,7 +1,29 @@
|
||||
import { Controller, Get, Post, Put, Delete, Body, Param, Query, UseGuards, Request } from '@nestjs/common';
|
||||
import { ApiTags, ApiOperation, ApiResponse, ApiBearerAuth } from '@nestjs/swagger';
|
||||
import {
|
||||
Controller,
|
||||
Get,
|
||||
Post,
|
||||
Put,
|
||||
Delete,
|
||||
Body,
|
||||
Param,
|
||||
Query,
|
||||
UseGuards,
|
||||
Request,
|
||||
} from '@nestjs/common';
|
||||
import {
|
||||
ApiTags,
|
||||
ApiOperation,
|
||||
ApiResponse,
|
||||
ApiBearerAuth,
|
||||
} from '@nestjs/swagger';
|
||||
import { MemberService } from '../../services/api/MemberService';
|
||||
import { CreateMemberDto, UpdateProfileDto, ChangePasswordDto, ResetPasswordDto, SignDto } from '../../dto/api/MemberDto';
|
||||
import {
|
||||
CreateMemberApiDto,
|
||||
UpdateProfileDto,
|
||||
ChangePasswordDto,
|
||||
ResetPasswordDto,
|
||||
SignDto,
|
||||
} from '../../dto/api/MemberDto';
|
||||
|
||||
@ApiTags('前台-会员管理')
|
||||
@ApiBearerAuth()
|
||||
@@ -12,14 +34,23 @@ export class MemberController {
|
||||
@Post('register')
|
||||
@ApiOperation({ summary: '会员注册' })
|
||||
@ApiResponse({ status: 201, description: '注册成功' })
|
||||
async register(@Body() createMemberDto: CreateMemberDto) {
|
||||
async register(@Body() createMemberDto: CreateMemberApiDto) {
|
||||
return await this.memberService.register(createMemberDto);
|
||||
}
|
||||
|
||||
@Post('login')
|
||||
@ApiOperation({ summary: '会员登录' })
|
||||
@ApiResponse({ status: 200, description: '登录成功' })
|
||||
async login(@Body() loginDto: { username: string; password: string; ip?: string; address?: string; device?: string }) {
|
||||
async login(
|
||||
@Body()
|
||||
loginDto: {
|
||||
username: string;
|
||||
password: string;
|
||||
ip?: string;
|
||||
address?: string;
|
||||
device?: string;
|
||||
},
|
||||
) {
|
||||
return await this.memberService.login(loginDto);
|
||||
}
|
||||
|
||||
@@ -34,7 +65,10 @@ export class MemberController {
|
||||
@Put('profile')
|
||||
@ApiOperation({ summary: '更新个人资料' })
|
||||
@ApiResponse({ status: 200, description: '更新成功' })
|
||||
async updateProfile(@Request() req: any, @Body() updateProfileDto: UpdateProfileDto) {
|
||||
async updateProfile(
|
||||
@Request() req: any,
|
||||
@Body() updateProfileDto: UpdateProfileDto,
|
||||
) {
|
||||
const memberId = req.user.member_id;
|
||||
return await this.memberService.updateProfile(memberId, updateProfileDto);
|
||||
}
|
||||
@@ -42,7 +76,10 @@ export class MemberController {
|
||||
@Post('change-password')
|
||||
@ApiOperation({ summary: '修改密码' })
|
||||
@ApiResponse({ status: 200, description: '修改成功' })
|
||||
async changePassword(@Request() req: any, @Body() changePasswordDto: ChangePasswordDto) {
|
||||
async changePassword(
|
||||
@Request() req: any,
|
||||
@Body() changePasswordDto: ChangePasswordDto,
|
||||
) {
|
||||
const memberId = req.user.member_id;
|
||||
return await this.memberService.changePassword(memberId, changePasswordDto);
|
||||
}
|
||||
@@ -65,7 +102,10 @@ export class MemberController {
|
||||
@Get('points/history')
|
||||
@ApiOperation({ summary: '获取积分历史' })
|
||||
@ApiResponse({ status: 200, description: '获取成功' })
|
||||
async getPointsHistory(@Request() req: any, @Query() query: { page?: number; limit?: number }) {
|
||||
async getPointsHistory(
|
||||
@Request() req: any,
|
||||
@Query() query: { page?: number; limit?: number },
|
||||
) {
|
||||
const memberId = req.user.member_id;
|
||||
return await this.memberService.getPointsHistory(memberId, query);
|
||||
}
|
||||
@@ -73,7 +113,10 @@ export class MemberController {
|
||||
@Get('balance/history')
|
||||
@ApiOperation({ summary: '获取余额历史' })
|
||||
@ApiResponse({ status: 200, description: '获取成功' })
|
||||
async getBalanceHistory(@Request() req: any, @Query() query: { page?: number; limit?: number }) {
|
||||
async getBalanceHistory(
|
||||
@Request() req: any,
|
||||
@Query() query: { page?: number; limit?: number },
|
||||
) {
|
||||
const memberId = req.user.member_id;
|
||||
return await this.memberService.getBalanceHistory(memberId, query);
|
||||
}
|
||||
@@ -97,7 +140,11 @@ export class MemberController {
|
||||
@Put('address/:id')
|
||||
@ApiOperation({ summary: '更新地址' })
|
||||
@ApiResponse({ status: 200, description: '更新成功' })
|
||||
async updateAddress(@Request() req: any, @Param('id') id: number, @Body() addressDto: any) {
|
||||
async updateAddress(
|
||||
@Request() req: any,
|
||||
@Param('id') id: number,
|
||||
@Body() addressDto: any,
|
||||
) {
|
||||
const memberId = req.user.member_id;
|
||||
return await this.memberService.updateAddress(memberId, id, addressDto);
|
||||
}
|
||||
@@ -133,4 +180,4 @@ export class MemberController {
|
||||
const memberId = req.user.member_id;
|
||||
return await this.memberService.logout(memberId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user