diff --git a/src/modules/dict/controller/app/info.ts b/src/modules/dict/controller/app/info.ts index 172bfc6..aa8b9e9 100644 --- a/src/modules/dict/controller/app/info.ts +++ b/src/modules/dict/controller/app/info.ts @@ -1,5 +1,10 @@ import { Body, Inject, Post, Provide } from '@midwayjs/decorator'; -import { CoolController, BaseController } from '@cool-midway/core'; +import { + CoolController, + BaseController, + CoolUrlTag, + TagTypes, +} from '@cool-midway/core'; import { DictInfoService } from '../../service/info'; /** @@ -7,6 +12,10 @@ import { DictInfoService } from '../../service/info'; */ @Provide() @CoolController() +@CoolUrlTag({ + key: TagTypes.IGNORE_TOKEN, + value: ['data'], +}) export class AppDictInfoController extends BaseController { @Inject() dictInfoService: DictInfoService; diff --git a/src/modules/dict/entity/info.ts b/src/modules/dict/entity/info.ts index dc99631..7af27c1 100644 --- a/src/modules/dict/entity/info.ts +++ b/src/modules/dict/entity/info.ts @@ -18,4 +18,7 @@ export class DictInfoEntity extends BaseEntity { @Column({ comment: '备注', nullable: true }) remark: string; + + @Column({ comment: '父ID', default: null }) + parentId: number; } diff --git a/src/modules/dict/service/info.ts b/src/modules/dict/service/info.ts index 0a6b7de..526a0ac 100644 --- a/src/modules/dict/service/info.ts +++ b/src/modules/dict/service/info.ts @@ -32,7 +32,8 @@ export class DictInfoService extends BaseService { return {}; } const data = await this.dictInfoEntity - .createQueryBuilder() + .createQueryBuilder('a') + .select(['a.id', 'a.name', 'a.typeId', 'a.parentId']) .where('typeId in(:typeIds)', { typeIds: typeData.map(e => { return e.id;