add base subscriber
This commit is contained in:
@@ -48,7 +48,7 @@ export class PostEntity extends BaseEntity {
|
||||
type: PostBodyType;
|
||||
|
||||
@Expose()
|
||||
@Column({ comment: '发布时间', type: 'varchar', nullable: true })
|
||||
@Column({ comment: '发布时间', type: 'timestamp', nullable: true })
|
||||
publishedAt?: Date | null;
|
||||
|
||||
@Expose()
|
||||
|
||||
@@ -19,6 +19,10 @@ export class CategoryService extends BaseService<CategoryEntity, CategoryReposit
|
||||
return this.repository.findTrees();
|
||||
}
|
||||
|
||||
async detail(id: string) {
|
||||
return this.repository.findOneOrFail({ where: { id }, relations: ['parent', 'children'] });
|
||||
}
|
||||
|
||||
async create(data: CreateCategoryDto) {
|
||||
const item = await this.repository.save({
|
||||
...data,
|
||||
|
||||
@@ -32,7 +32,7 @@ type SubscriberEvent<T extends ObjectLiteral> =
|
||||
|
||||
@EventSubscriber()
|
||||
export abstract class BaseSubscriber<T extends ObjectLiteral>
|
||||
implements EntitySubscriberInterface<T>
|
||||
implements EntitySubscriberInterface<T>
|
||||
{
|
||||
protected abstract entity: ObjectType<T>;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user