Spaces:
Sleeping
Sleeping
Download backend/src/modules/search/search.controller.ts from kishankrish19/Chat: direct link, hf CLI and curl.
- Browser
- Download file 898 Bytes
-
https://huggingface.co/spaces/kishankrish19/Chat/resolve/main/backend/src/modules/search/search.controller.ts
- Command line
-
hf download hf://spaces/kishankrish19/Chat/backend/src/modules/search/search.controller.ts
-
curl -L -o search.controller.ts https://huggingface.co/spaces/kishankrish19/Chat/resolve/main/backend/src/modules/search/search.controller.ts
898 Bytes
| import { Controller, Get, Query } from '@nestjs/common'; | |
| import { ApiTags, ApiOperation } from '@nestjs/swagger'; | |
| import { SearchService } from './search.service'; | |
| ('Search & Browse') | |
| () | |
| export class SearchController { | |
| constructor(private readonly searchService: SearchService) {} | |
| ('search') | |
| ({ | |
| summary: | |
| 'Full-text + fuzzy search across tracks, artists, albums, playlists', | |
| }) | |
| search(('q') q: string, ('type') type?: string) { | |
| return this.searchService.search(q || '', type); | |
| } | |
| ('search/suggest') | |
| ({ summary: 'Type-ahead search suggestions' }) | |
| suggest(('q') q: string) { | |
| return this.searchService.suggest(q || ''); | |
| } | |
| ('browse/categories') | |
| ({ summary: 'Genre & mood browse category tiles' }) | |
| getCategories() { | |
| return this.searchService.getCategories(); | |
| } | |
| } | |