import { Controller, Get, Post, UseGuards } from '@nestjs/common';
import { ApiTags, ApiOperation, ApiBearerAuth } from '@nestjs/swagger';
import { AdminSyncService } from '@/application/services/admin-sync.service';

@ApiTags('Admin')
@Controller('admin')
export class AdminController {
  constructor(private readonly adminSyncService: AdminSyncService) {}

  @Get('users/sync')
  @ApiOperation({ summary: '获取所有用户数据供 mining-admin-service 同步' })
  async getAllUsersForSync() {
    return this.adminSyncService.getAllUsersForSync();
  }

  @Post('legacy-users/publish-all')
  @ApiOperation({ summary: '为所有 synced_legacy_users 发布事件到 Kafka' })
  async publishAllLegacyUsers() {
    return this.adminSyncService.publishAllLegacyUsers();
  }
}
