import { Controller, Get, Param, Query } from '@nestjs/common';
import { ApiTags, ApiOperation } from '@nestjs/swagger';
import { MerchantService } from '@/modules/merchant/merchant.service';
import { QueryMerchantDto } from '@/modules/merchant/dto/merchant.dto';

@ApiTags('商家')
@Controller('app/merchants')
export class MerchantController {
  constructor(private readonly merchantService: MerchantService) {}

  @Get()
  @ApiOperation({ summary: '商家列表(公开)' })
  async findAll(@Query() query: QueryMerchantDto) {
    return this.merchantService.findPublic(query);
  }

  @Get(':id')
  @ApiOperation({ summary: '获取商家详情(公开)' })
  async findById(@Param('id') id: number) {
    return this.merchantService.findById(id);
  }
}
