import { Inject, Controller, Post, Body } from '@midwayjs/core';
import { Context } from '@midwayjs/koa';
import { Validate } from '@midwayjs/validate';
import { UserDTO } from '../dto/user.dto';

@Controller('/api')
export class APIController {
  @Inject()
  ctx: Context;

  @Post('/get_user')
  @Validate({
    errorStatus: 422,
  })
  async getUser(@Body() user: UserDTO) {
    return { success: true, message: 'OK', data: user };
  }
}
