chore: 企业管理模式初步

This commit is contained in:
xiaojunnuo
2026-02-04 15:49:01 +08:00
parent bd511f97cb
commit eb46f8c776
24 changed files with 285 additions and 3 deletions
@@ -42,6 +42,9 @@ export class CertInfoEntity {
@Column({ name: 'cert_file', comment: '证书下载' })
certFile: string;
@Column({ name: 'project_id', comment: '项目id' })
projectId: number;
@Column({
name: 'create_time',
comment: '创建时间',
@@ -71,6 +71,9 @@ export class SiteInfoEntity {
@Column({ name: 'group_id', comment: '分组id' })
groupId: number;
@Column({ name: 'project_id', comment: '项目id' })
projectId: number;
@Column({ name: 'create_time', comment: '创建时间', default: () => 'CURRENT_TIMESTAMP' })
createTime: Date;
@Column({ name: 'update_time', comment: '修改时间', default: () => 'CURRENT_TIMESTAMP' })
@@ -33,6 +33,8 @@ export class SiteIpEntity {
remark: string;
@Column({ name: "disabled", comment: "禁用启用" })
disabled: boolean;
@Column({ name: 'project_id', comment: '项目id' })
projectId: number;
@Column({ name: 'create_time', comment: '创建时间', default: () => 'CURRENT_TIMESTAMP' })
createTime: Date;
@@ -17,6 +17,9 @@ export class OpenKeyEntity {
@Column({ name: 'scope', comment: '权限范围' })
scope: string; // open 仅开放接口、 user 用户所有权限
@Column({ name: 'project_id', comment: '项目id' })
projectId: number;
@Column({ name: 'create_time', comment: '创建时间', default: () => 'CURRENT_TIMESTAMP' })
createTime: Date;
@@ -25,6 +25,9 @@ export class HistoryLogEntity {
@Column({ comment: '日志内容', length: 40960, nullable: true })
logs: string;
@Column({ name: 'project_id', comment: '项目id' })
projectId: number;
@Column({
name: 'create_time',
comment: '创建时间',
@@ -26,6 +26,9 @@ export class HistoryEntity {
})
endTime: Date;
@Column({ name: 'project_id', comment: '项目id' })
projectId: number;
@Column({
name: 'create_time',
comment: '创建时间',
@@ -38,6 +41,7 @@ export class HistoryEntity {
default: () => 'CURRENT_TIMESTAMP',
})
updateTime: Date;
pipelineTitle: string;
@@ -20,6 +20,9 @@ export class NotificationEntity {
@Column({ name: 'is_default', comment: '是否默认' })
isDefault: boolean;
@Column({ name: 'project_id', comment: '项目id' })
projectId: number;
@Column({
name: 'create_time',
comment: '创建时间',
@@ -17,6 +17,9 @@ export class PipelineGroupEntity {
@Column({ name: 'favorite', comment: '收藏' })
favorite: boolean;
@Column({ name: 'project_id', comment: '项目id' })
projectId: number;
@Column({
name: 'create_time',
comment: '创建时间',
@@ -61,6 +61,9 @@ export class PipelineEntity {
@Column({name: 'order', comment: '排序', nullable: true,})
order: number;
@Column({ name: 'project_id', comment: '项目id' })
projectId: number;
@Column({name: 'create_time',comment: '创建时间', default: () => 'CURRENT_TIMESTAMP',})
createTime: Date;
@Column({
@@ -23,6 +23,9 @@ export class StorageEntity {
@Column({ comment: 'value', length: 40960, nullable: true })
value: string;
@Column({ name: 'project_id', comment: '项目id' })
projectId: number;
@Column({
name: 'create_time',
comment: '创建时间',
@@ -39,6 +39,9 @@ export class TemplateEntity {
})
order: number;
@Column({ name: 'project_id', comment: '项目id' })
projectId: number;
@Column({
name: 'create_time',
comment: '创建时间',
@@ -0,0 +1,43 @@
import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';
/**
*/
@Entity('cd_audit_log')
export class AuditLogEntity {
@PrimaryGeneratedColumn()
id: number;
@Column({ name: 'user_id', comment: 'UserId' })
userId: number;
@Column({ name: 'user_name', comment: '用户名' })
userName: string;
@Column({ name: 'project_id', comment: 'ProjectId' })
projectId: number;
@Column({ name: 'project_name', comment: '项目名称' })
projectName: string;
@Column({ name: 'action', comment: '操作' })
action: string;
@Column({ name: 'content', comment: '内容' })
content: string;
@Column({ name: 'ip_address', comment: 'IP地址' })
ipAddress: string;
@Column({
name: 'create_time',
comment: '创建时间',
default: () => 'CURRENT_TIMESTAMP',
})
createTime: Date;
@Column({
name: 'update_time',
comment: '修改时间',
default: () => 'CURRENT_TIMESTAMP',
})
updateTime: Date;
}
@@ -0,0 +1,31 @@
import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';
/**
*/
@Entity('cd_project_user')
export class ProjectUserEntity {
@PrimaryGeneratedColumn()
id: number;
@Column({ name: 'user_id', comment: 'UserId' })
userId: number;
@Column({ name: 'project_id', comment: 'ProjectId' })
projectId: number;
@Column({ name: 'permission', comment: '权限' })
permission: string; // read / write
@Column({
name: 'create_time',
comment: '创建时间',
default: () => 'CURRENT_TIMESTAMP',
})
createTime: Date;
@Column({
name: 'update_time',
comment: '修改时间',
default: () => 'CURRENT_TIMESTAMP',
})
updateTime: Date;
}
@@ -0,0 +1,31 @@
import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';
/**
*/
@Entity('cd_project')
export class ProjectEntity {
@PrimaryGeneratedColumn()
id: number;
@Column({ name: 'user_id', comment: 'UserId' })
userId: number;
@Column({ name: 'name', comment: '项目名称' })
name: string;
@Column({ name: 'disabled', comment: '禁用' })
disabled: boolean;
@Column({
name: 'create_time',
comment: '创建时间',
default: () => 'CURRENT_TIMESTAMP',
})
createTime: Date;
@Column({
name: 'update_time',
comment: '修改时间',
default: () => 'CURRENT_TIMESTAMP',
})
updateTime: Date;
}