import { CoolController, BaseController, CoolUrlTag, CoolTag, TagTypes } from '@cool-midway/core';
import { Get, Inject, Query } from '@midwayjs/core';
import { FixturesMouldEntity } from '../../entity/mould';
import { FixturesMouldService } from '../../service/mould';

/**
 * 装修页面
 */
@CoolController({
    api: [],
    entity: FixturesMouldEntity,
})
@CoolUrlTag()
export class AppFixturesMouldController extends BaseController {
    @Inject()
    fixturesMouldService: FixturesMouldService;

    @CoolTag(TagTypes.IGNORE_TOKEN)
    @Get('/getHomePage', { summary: '获取首页' })
    async getHomePage() {
        return this.ok(await this.fixturesMouldService.getHomePage());
    }


    @CoolTag(TagTypes.IGNORE_TOKEN)
    @Get('/getPage', { summary: '获取指定页面' })
    async getPage(@Query('id') id: string) {
        return this.ok(await this.fixturesMouldService.getPage(id));
    }
}
