feat: 初始化 WWJ Cloud 企业级框架项目

- 后端:基于 NestJS 的分层架构设计
- 前端:基于 VbenAdmin + Element Plus 的管理系统
- 支持 SaaS + 独立版双架构模式
- 完整的用户权限管理系统
- 系统设置、文件上传、通知等核心功能
- 多租户支持和插件化扩展架构
This commit is contained in:
万物街
2025-08-23 13:20:01 +08:00
commit f30d64e6cc
172 changed files with 10179 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
import { Entity, PrimaryGeneratedColumn, Column, ManyToOne, JoinColumn } from 'typeorm';
import { ApiProperty } from '@nestjs/swagger';
import { SysUser } from './sys-user.entity';
@Entity('sys_user_role')
export class SysUserRole {
@ApiProperty({ description: '主键ID' })
@PrimaryGeneratedColumn({ name: 'id', type: 'int', unsigned: true })
id: number;
@ApiProperty({ description: '用户ID' })
@Column({ name: 'uid', type: 'int', default: 0 })
uid: number;
@ApiProperty({ description: '角色ID' })
@Column({ name: 'role_id', type: 'int', default: 0 })
roleId: number;
@ApiProperty({ description: '站点ID' })
@Column({ name: 'site_id', type: 'int', default: 0 })
siteId: number;
// 关联用户
@ManyToOne(() => SysUser, user => user.userRoles)
@JoinColumn({ name: 'uid' })
user: SysUser;
}

View File

@@ -0,0 +1,94 @@
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, OneToMany } from 'typeorm';
import { ApiProperty } from '@nestjs/swagger';
import { SysUserRole } from './sys-user-role.entity';
@Entity('sys_user')
export class SysUser {
@ApiProperty({ description: '用户ID' })
@PrimaryGeneratedColumn({ name: 'uid', type: 'int', unsigned: true })
uid: number;
@ApiProperty({ description: '站点ID' })
@Column({ name: 'site_id', type: 'int', default: 0 })
siteId: number;
@ApiProperty({ description: '用户名' })
@Column({ name: 'username', type: 'varchar', length: 255, default: '' })
username: string;
@ApiProperty({ description: '密码' })
@Column({ name: 'password', type: 'varchar', length: 255, default: '' })
password: string;
@ApiProperty({ description: '真实姓名' })
@Column({ name: 'real_name', type: 'varchar', length: 255, default: '' })
realName: string;
@ApiProperty({ description: '头像' })
@Column({ name: 'head_img', type: 'varchar', length: 255, default: '' })
headImg: string;
@ApiProperty({ description: '手机号' })
@Column({ name: 'mobile', type: 'varchar', length: 20, default: '' })
mobile: string;
@ApiProperty({ description: '邮箱' })
@Column({ name: 'email', type: 'varchar', length: 255, default: '' })
email: string;
@ApiProperty({ description: '性别1男 2女 0保密' })
@Column({ name: 'sex', type: 'tinyint', default: 0 })
sex: number;
@ApiProperty({ description: '生日' })
@Column({ name: 'birthday', type: 'varchar', length: 255, default: '' })
birthday: string;
@ApiProperty({ description: '省份ID' })
@Column({ name: 'pid', type: 'int', default: 0 })
pid: number;
@ApiProperty({ description: '城市ID' })
@Column({ name: 'cid', type: 'int', default: 0 })
cid: number;
@ApiProperty({ description: '区县ID' })
@Column({ name: 'did', type: 'int', default: 0 })
did: number;
@ApiProperty({ description: '详细地址' })
@Column({ name: 'address', type: 'varchar', length: 255, default: '' })
address: string;
@ApiProperty({ description: '状态1正常 0禁用' })
@Column({ name: 'status', type: 'tinyint', default: 1 })
status: number;
@ApiProperty({ description: '是否超级管理员1是 0否' })
@Column({ name: 'is_admin', type: 'tinyint', default: 0 })
isAdmin: number;
@ApiProperty({ description: '最后登录时间' })
@Column({ name: 'last_time', type: 'int', default: 0 })
lastTime: number;
@ApiProperty({ description: '最后登录IP' })
@Column({ name: 'last_ip', type: 'varchar', length: 255, default: '' })
lastIp: string;
@ApiProperty({ description: '创建时间' })
@CreateDateColumn({ name: 'create_time', type: 'int' })
createTime: number;
@ApiProperty({ description: '更新时间' })
@UpdateDateColumn({ name: 'update_time', type: 'int' })
updateTime: number;
@ApiProperty({ description: '删除时间' })
@Column({ name: 'delete_time', type: 'int', default: 0 })
deleteTime: number;
// 关联用户角色
@OneToMany(() => SysUserRole, userRole => userRole.user)
userRoles: SysUserRole[];
}