feat: 初始化 WWJ Cloud 企业级框架项目
- 后端:基于 NestJS 的分层架构设计 - 前端:基于 VbenAdmin + Element Plus 的管理系统 - 支持 SaaS + 独立版双架构模式 - 完整的用户权限管理系统 - 系统设置、文件上传、通知等核心功能 - 多租户支持和插件化扩展架构
This commit is contained in:
94
wwjcloud/src/common/admin/dto/create-admin.dto.ts
Normal file
94
wwjcloud/src/common/admin/dto/create-admin.dto.ts
Normal file
@@ -0,0 +1,94 @@
|
||||
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
||||
import { IsString, IsOptional, IsInt, IsEmail, IsIn, Length, IsArray } from 'class-validator';
|
||||
import { Transform } from 'class-transformer';
|
||||
|
||||
export class CreateAdminDto {
|
||||
@ApiProperty({ description: '站点ID' })
|
||||
@IsInt()
|
||||
@Transform(({ value }) => parseInt(value))
|
||||
siteId: number;
|
||||
|
||||
@ApiProperty({ description: '用户名' })
|
||||
@IsString()
|
||||
@Length(1, 255)
|
||||
username: string;
|
||||
|
||||
@ApiProperty({ description: '密码' })
|
||||
@IsString()
|
||||
@Length(6, 255)
|
||||
password: string;
|
||||
|
||||
@ApiProperty({ description: '真实姓名' })
|
||||
@IsString()
|
||||
@Length(1, 255)
|
||||
realName: string;
|
||||
|
||||
@ApiPropertyOptional({ description: '头像' })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
headImg?: string;
|
||||
|
||||
@ApiPropertyOptional({ description: '手机号' })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
@Length(11, 11)
|
||||
mobile?: string;
|
||||
|
||||
@ApiPropertyOptional({ description: '邮箱' })
|
||||
@IsOptional()
|
||||
@IsEmail()
|
||||
email?: string;
|
||||
|
||||
@ApiPropertyOptional({ description: '性别:1男 2女 0保密' })
|
||||
@IsOptional()
|
||||
@IsIn([0, 1, 2])
|
||||
@Transform(({ value }) => parseInt(value))
|
||||
sex?: number;
|
||||
|
||||
@ApiPropertyOptional({ description: '生日' })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
birthday?: string;
|
||||
|
||||
@ApiPropertyOptional({ description: '省份ID' })
|
||||
@IsOptional()
|
||||
@IsInt()
|
||||
@Transform(({ value }) => parseInt(value))
|
||||
pid?: number;
|
||||
|
||||
@ApiPropertyOptional({ description: '城市ID' })
|
||||
@IsOptional()
|
||||
@IsInt()
|
||||
@Transform(({ value }) => parseInt(value))
|
||||
cid?: number;
|
||||
|
||||
@ApiPropertyOptional({ description: '区县ID' })
|
||||
@IsOptional()
|
||||
@IsInt()
|
||||
@Transform(({ value }) => parseInt(value))
|
||||
did?: number;
|
||||
|
||||
@ApiPropertyOptional({ description: '详细地址' })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
address?: string;
|
||||
|
||||
@ApiPropertyOptional({ description: '状态:1正常 0禁用', default: 1 })
|
||||
@IsOptional()
|
||||
@IsIn([0, 1])
|
||||
@Transform(({ value }) => parseInt(value))
|
||||
status?: number;
|
||||
|
||||
@ApiPropertyOptional({ description: '是否超级管理员:1是 0否', default: 0 })
|
||||
@IsOptional()
|
||||
@IsIn([0, 1])
|
||||
@Transform(({ value }) => parseInt(value))
|
||||
isAdmin?: number;
|
||||
|
||||
@ApiPropertyOptional({ description: '角色ID数组' })
|
||||
@IsOptional()
|
||||
@IsArray()
|
||||
@IsInt({ each: true })
|
||||
@Transform(({ value }) => Array.isArray(value) ? value.map(v => parseInt(v)) : [])
|
||||
roleIds?: number[];
|
||||
}
|
||||
3
wwjcloud/src/common/admin/dto/index.ts
Normal file
3
wwjcloud/src/common/admin/dto/index.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
export { CreateAdminDto } from './create-admin.dto';
|
||||
export { UpdateAdminDto } from './update-admin.dto';
|
||||
export { QueryAdminDto } from './query-admin.dto';
|
||||
64
wwjcloud/src/common/admin/dto/query-admin.dto.ts
Normal file
64
wwjcloud/src/common/admin/dto/query-admin.dto.ts
Normal file
@@ -0,0 +1,64 @@
|
||||
import { ApiPropertyOptional } from '@nestjs/swagger';
|
||||
import { IsOptional, IsString, IsInt, IsIn } from 'class-validator';
|
||||
import { Transform } from 'class-transformer';
|
||||
|
||||
export class QueryAdminDto {
|
||||
@ApiPropertyOptional({ description: '页码', default: 1 })
|
||||
@IsOptional()
|
||||
@IsInt()
|
||||
@Transform(({ value }) => parseInt(value) || 1)
|
||||
page?: number = 1;
|
||||
|
||||
@ApiPropertyOptional({ description: '每页数量', default: 10 })
|
||||
@IsOptional()
|
||||
@IsInt()
|
||||
@Transform(({ value }) => parseInt(value) || 10)
|
||||
limit?: number = 10;
|
||||
|
||||
@ApiPropertyOptional({ description: '关键词搜索(用户名/真实姓名/手机号)' })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
keyword?: string;
|
||||
|
||||
@ApiPropertyOptional({ description: '站点ID' })
|
||||
@IsOptional()
|
||||
@IsInt()
|
||||
@Transform(({ value }) => parseInt(value))
|
||||
siteId?: number;
|
||||
|
||||
@ApiPropertyOptional({ description: '性别:1男 2女 0保密' })
|
||||
@IsOptional()
|
||||
@IsIn([0, 1, 2])
|
||||
@Transform(({ value }) => parseInt(value))
|
||||
sex?: number;
|
||||
|
||||
@ApiPropertyOptional({ description: '状态:1正常 0禁用' })
|
||||
@IsOptional()
|
||||
@IsIn([0, 1])
|
||||
@Transform(({ value }) => parseInt(value))
|
||||
status?: number;
|
||||
|
||||
@ApiPropertyOptional({ description: '是否超级管理员:1是 0否' })
|
||||
@IsOptional()
|
||||
@IsIn([0, 1])
|
||||
@Transform(({ value }) => parseInt(value))
|
||||
isAdmin?: number;
|
||||
|
||||
@ApiPropertyOptional({ description: '角色ID' })
|
||||
@IsOptional()
|
||||
@IsInt()
|
||||
@Transform(({ value }) => parseInt(value))
|
||||
roleId?: number;
|
||||
|
||||
@ApiPropertyOptional({ description: '开始时间(时间戳)' })
|
||||
@IsOptional()
|
||||
@IsInt()
|
||||
@Transform(({ value }) => parseInt(value))
|
||||
startTime?: number;
|
||||
|
||||
@ApiPropertyOptional({ description: '结束时间(时间戳)' })
|
||||
@IsOptional()
|
||||
@IsInt()
|
||||
@Transform(({ value }) => parseInt(value))
|
||||
endTime?: number;
|
||||
}
|
||||
4
wwjcloud/src/common/admin/dto/update-admin.dto.ts
Normal file
4
wwjcloud/src/common/admin/dto/update-admin.dto.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
import { PartialType } from '@nestjs/swagger';
|
||||
import { CreateAdminDto } from './create-admin.dto';
|
||||
|
||||
export class UpdateAdminDto extends PartialType(CreateAdminDto) {}
|
||||
Reference in New Issue
Block a user