import {HTTPBody} from '@fastify-modular/route'; import {pito} from 'pito'; import {AdminOnly, NeedLogin} from '../defines'; // ========================================================================== export const CreateNoticeInput = pito.Obj({ title : pito.Str(), contents: pito.Str(), }); export type CreateNoticeInput = pito.Type; // ========================================================================== export const CreateNoticeOutput = pito.Obj({ noticeId: pito.Num(), }); export type CreateNoticeOutput = pito.Type; // ========================================================================== export const CreateNotice = HTTPBody('POST', '/api/v1/product/create-notice', 'cs') .body(CreateNoticeInput) .response(CreateNoticeOutput) .presets(NeedLogin, AdminOnly) .build(); // ==========================================================================