import { Controller, Post, Body, Get } from '@nestjs/common';
import { ApiTags } from '@nestjs/swagger';
import { SystemService } from '../service/system.service';
import { LoginUserDto } from '../dto/login-user.dto';
import { NoAuthToken } from '../../common/decorator/no-token.decorator';
import { Query } from '@nestjs/common/decorators';

@ApiTags('系统管理')
@Controller('system')
export class SystemController {
  constructor(private readonly systemService: SystemService) {}
  @NoAuthToken()
  @Post('login')
  async login(@Body() loginUserDto: LoginUserDto) {
    return this.systemService.login(loginUserDto);
  }

  @Get('checkAdminPassword')
  async checkAdminPassword(@Query() { password }) {
    return this.systemService.checkAdminPassword(password);
  }
}
