feat(pipeline-tasks): 任务更新推送时机修改。
This commit is contained in:
@ -1,11 +1,16 @@
|
||||
import { AppBaseEntity } from './../commons/entities/app-base-entity';
|
||||
import { Field, ObjectType } from '@nestjs/graphql';
|
||||
import { Column, Entity, ManyToOne } from 'typeorm';
|
||||
import { ObjectType } from '@nestjs/graphql';
|
||||
import { Column, Entity, ManyToOne, ValueTransformer } from 'typeorm';
|
||||
import { Pipeline } from '../pipelines/pipeline.entity';
|
||||
import { PipelineTaskLogs } from './models/pipeline-task-logs.model';
|
||||
import { TaskStatuses } from './enums/task-statuses.enum';
|
||||
import { PipelineUnits } from './enums/pipeline-units.enum';
|
||||
import { plainToClass } from 'class-transformer';
|
||||
|
||||
const logsTransformer: ValueTransformer = {
|
||||
from: (value) => plainToClass(PipelineTaskLogs, value),
|
||||
to: (value) => value,
|
||||
};
|
||||
@ObjectType()
|
||||
@Entity()
|
||||
export class PipelineTask extends AppBaseEntity {
|
||||
@ -20,7 +25,7 @@ export class PipelineTask extends AppBaseEntity {
|
||||
@Column({ type: 'enum', enum: PipelineUnits, array: true })
|
||||
units: PipelineUnits[];
|
||||
|
||||
@Column({ type: 'jsonb', default: '[]' })
|
||||
@Column({ type: 'jsonb', default: '[]', transformer: logsTransformer })
|
||||
logs: PipelineTaskLogs[];
|
||||
|
||||
@Column({ type: 'enum', enum: TaskStatuses, default: TaskStatuses.pending })
|
||||
|
Reference in New Issue
Block a user