import {  Controller, Get, Inject, Query } from '@midwayjs/core';
import { Context } from '@midwayjs/koa';
import { BaseAppUtils } from '../librarys/BaseAppUtils';
import { QuickValidatePipe } from '../librarys/QuickValidatePipe';
import { BaseController } from './BaseController';

@Controller('/home')
export class HomeController extends BaseController {

    @Inject()
    ctx:Context;

    /**
     * 首页
     * @returns
     */
    @Get('/')
    async home(@Query([
        QuickValidatePipe.Ins.Rule("id",BaseAppUtils.Ins.RuleNumberNotEmpty("文章ID"))
        .Rule('name',BaseAppUtils.Ins.RuleStringChineseTirmNotEmpty("学生姓名"))
    ]) data:{id:number,name:string}){
        console.log('data',data.id);
        return this.SUCCESS('SUCCESS');
    }


}
