diff --git a/backend/src/v1/tags/tags.repository.ts b/backend/src/v1/tags/tags.repository.ts index a93aeffa..39004f83 100644 --- a/backend/src/v1/tags/tags.repository.ts +++ b/backend/src/v1/tags/tags.repository.ts @@ -1,15 +1,9 @@ /* eslint-disable max-classes-per-file */ -import { - In, QueryRunner, Repository, -} from 'typeorm'; +import { In, QueryRunner, Repository } from 'typeorm'; import { QueryDeepPartialEntity } from 'typeorm/query-builder/QueryPartialEntity.js'; import jipDataSource from '~/app-data-source'; import { - BookInfo, - SubTag, - SuperTag, - User, - VTagsSubDefault, + BookInfo, SubTag, SuperTag, User, VTagsSubDefault, VTagsSuperDefault, } from '~/entity/entities'; import { subDefaultTag, superDefaultTag } from '../DTO/tags.model'; @@ -95,6 +89,8 @@ export class SuperTagRepository extends Repository { private readonly bookInfoRepo: Repository; + private readonly vSuperDefaultRepo: Repository; + private readonly entityManager; constructor(transactionQueryRunner?: QueryRunner) { @@ -114,6 +110,10 @@ export class SuperTagRepository extends Repository { BookInfo, this.entityManager, ); + this.vSuperDefaultRepo = new Repository( + VTagsSuperDefault, + this.entityManager, + ); } async getSuperTagLogin(superTagId: number): Promise { @@ -225,4 +225,10 @@ export class SuperTagRepository extends Repository { }); return count; } + + async getMainTags(limit: number): Promise { + return this.vSuperDefaultRepo.find({ + take: limit, + }); + } }