first commit

This commit is contained in:
Первов Артем
2026-06-19 08:18:52 +03:00
commit 05a9e0e535
61 changed files with 11950 additions and 0 deletions

18
src/tag/tag.service.ts Normal file
View File

@@ -0,0 +1,18 @@
import { Injectable } from '@nestjs/common';
import { GetTagsDto } from './dto/get-tags.dto';
import { TagResponseDto } from './dto/tag-response.dto';
import { createTagResponse } from './tag.mapper';
import { TagRepository } from './tag.repository';
@Injectable()
export class TagService {
constructor(private readonly repository: TagRepository) {}
/** Нормализует фильтры и возвращает метаданные тегов для UI. */
async findAll(query: GetTagsDto): Promise<TagResponseDto> {
const edge = query.edge ?? null;
const search = query.search ? `%${query.search}%` : null;
const rows = await this.repository.findAll(edge, search);
return createTagResponse(rows);
}
}