import { RouterMetadata } from "./Metadata" ; import { ControllerStaticType } from "../abstract/controller" ; export const Controller = < RES , REQ > ( params ) : ( ( target : ControllerStaticType < RES , REQ > ) => void ) => { const { path , method , auth , skipAutoHandle } = params ; return ( target ) : void => { Reflect . defineMetadata ( RouterMetadata . PATH , path , target ) ; Reflect . defineMetadata ( RouterMetadata . METHOD , method , target ) ; Reflect . defineMetadata ( RouterMetadata . AUTH , auth , target ) ; Reflect . defineMetadata ( RouterMetadata . SKIP_AUTO_HANDLE , skipAutoHandle || false , target ) ; } ; } ; export type ControllerParams = { path : string | string [ ] ; method : "get" | "post" ; auth : boolean ; skipAutoHandle ? : boolean ; } ;