import { Controller, Get, Query, UseGuards } from '@nestjs/common';
import { ApiBearerAuth, ApiTags } from '@nestjs/swagger';
import { CurrentUser } from '../../common/decorators/current-user.decorator';
import { JwtAuthGuard } from '../../common/guards/jwt-auth.guard';
import { JwtPayload } from '../../common/interfaces/jwt-payload.interface';
import { FeedQueryDto } from '../feed/dto/feed-query.dto';
import { SearchQueryDto } from '../search/dto/search-query.dto';
import { MusicWorldService } from './music-world.service';

@ApiTags('Music World')
@ApiBearerAuth()
@UseGuards(JwtAuthGuard)
@Controller('music-world')
export class MusicWorldController {
  constructor(private readonly musicWorldService: MusicWorldService) {}

  @Get()
  getMusicWorld() {
    return this.musicWorldService.getMusicWorld();
  }

  @Get('explore')
  getExplore(@CurrentUser() user: JwtPayload, @Query() query: FeedQueryDto) {
    return this.musicWorldService.getExplore(user.sub, query);
  }

  @Get('search')
  search(@CurrentUser() user: JwtPayload, @Query() query: SearchQueryDto) {
    return this.musicWorldService.search(user.sub, query);
  }
}
