build: trident-sync prepare

This commit is contained in:
xiaojunnuo
2023-01-29 13:44:19 +08:00
parent dcd1023a39
commit 07a45b4530
589 changed files with 36886 additions and 2 deletions
@@ -0,0 +1,33 @@
import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';
/**
* 授权配置
*/
@Entity('cd_access')
export class AccessEntity {
@PrimaryGeneratedColumn()
id: number;
@Column({ name: 'user_id', comment: '用户id' })
userId: number;
@Column({ comment: '名称', length: 100 })
name: string;
@Column({ comment: '类型', length: 100 })
type: string;
@Column({ name: 'setting', comment: '设置', length: 1024, nullable: true })
setting: string;
@Column({
name: 'create_time',
comment: '创建时间',
default: () => 'CURRENT_TIMESTAMP',
})
createTime: Date;
@Column({
name: 'update_time',
comment: '修改时间',
default: () => 'CURRENT_TIMESTAMP',
})
updateTime: Date;
}
@@ -0,0 +1,41 @@
import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';
@Entity('pi_history_log')
export class HistoryLogEntity {
@PrimaryGeneratedColumn()
id: number;
@Column({ name: 'user_id', comment: '用户id' })
userId: number;
@Column({ name: 'pipeline_id', comment: '流水线' })
pipelineId: number;
@Column({ name: 'history_id', comment: '历史id' })
historyId: number;
@Column({
name: 'node_id',
comment: '任务节点id',
length: 100,
nullable: true,
})
nodeId: string;
@Column({ comment: '日志内容', length: 40960, nullable: true })
logs: string;
@Column({
name: 'create_time',
comment: '创建时间',
default: () => 'CURRENT_TIMESTAMP',
})
createTime: Date;
@Column({
name: 'update_time',
comment: '修改时间',
default: () => 'CURRENT_TIMESTAMP',
})
updateTime: Date;
}
@@ -0,0 +1,38 @@
import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';
@Entity('pi_history')
export class HistoryEntity {
@PrimaryGeneratedColumn()
id: number;
@Column({ name: 'user_id', comment: '用户id' })
userId: number;
@Column({ name: 'pipeline_id', comment: '流水线' })
pipelineId: number;
@Column({ comment: '运行状态', length: 40960, nullable: true })
pipeline: string;
@Column({ comment: '结果状态', length: 20, nullable: true })
status: string;
@Column({
name: 'end_time',
comment: '结束时间',
nullable: true,
})
endTime: Date;
@Column({
name: 'create_time',
comment: '创建时间',
default: () => 'CURRENT_TIMESTAMP',
})
createTime: Date;
@Column({
name: 'update_time',
comment: '修改时间',
default: () => 'CURRENT_TIMESTAMP',
})
updateTime: Date;
}
@@ -0,0 +1,52 @@
import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';
@Entity('pi_pipeline')
export class PipelineEntity {
@PrimaryGeneratedColumn()
id: number;
@Column({ name: 'user_id', comment: '用户id' })
userId: number;
@Column({ name: 'title', comment: '标题' })
title: number;
@Column({ comment: '配置', length: 40960 })
content: string;
@Column({
name: 'keep_history_count',
comment: '历史记录保持数量',
nullable: true,
})
keepHistoryCount: number;
@Column({ comment: '备注', length: 100, nullable: true })
remark: string;
@Column({ comment: '状态', length: 100, nullable: true })
status: string;
@Column({ comment: '启用/禁用', nullable: true, default: false })
disabled: boolean;
@Column({
name: 'last_history_time',
comment: '最后一次执行时间',
nullable: true,
})
lastHistoryTime: number;
@Column({
name: 'create_time',
comment: '创建时间',
default: () => 'CURRENT_TIMESTAMP',
})
createTime: Date;
@Column({
name: 'update_time',
comment: '修改时间',
default: () => 'CURRENT_TIMESTAMP',
})
updateTime: Date;
}
@@ -0,0 +1,35 @@
import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';
@Entity('pi_storage')
export class StorageEntity {
@PrimaryGeneratedColumn()
id: number;
@Column({ name: 'user_id', comment: '用户id' })
userId: number;
@Column({ name: 'scope', comment: '范围' })
scope: string;
@Column({ name: 'namespace', comment: '命名空间' })
namespace: string;
@Column({ comment: 'key', length: 100, nullable: true })
key: string;
@Column({ comment: 'value', length: 40960, nullable: true })
value: string;
@Column({
name: 'create_time',
comment: '创建时间',
default: () => 'CURRENT_TIMESTAMP',
})
createTime: Date;
@Column({
name: 'update_time',
comment: '修改时间',
default: () => 'CURRENT_TIMESTAMP',
})
updateTime: Date;
}
@@ -0,0 +1,12 @@
import { HistoryEntity } from '../history';
import { HistoryLogEntity } from '../history-log';
export class HistoryDetail {
history: HistoryEntity;
log: HistoryLogEntity;
constructor(history: HistoryEntity, log: HistoryLogEntity) {
this.history = history;
this.log = log;
}
}
@@ -0,0 +1,13 @@
import { PipelineEntity } from '../pipeline';
import { HistoryEntity } from '../history';
import { HistoryLogEntity } from '../history-log';
export class PipelineDetail {
pipeline: PipelineEntity;
constructor(pipeline: PipelineEntity) {
this.pipeline = pipeline;
}
last: HistoryEntity;
logs: HistoryLogEntity[];
}