import {HttpMethodType} from "../../../enum" import HttpMethod from "../../../type/impl/http/HttpMethod" import {PojoType} from "../../../type/type" import DecorateRegistCenter from "../../DecorateRegistCenter" import ControllerParam from '../../../type/impl/http/ControllerParam' import Streamable from '../../../type/impl/http/Streamable' import Uploader from '../../../type/impl/http/Upload' export function Get(route: string): Function{ return function(prototype: any, methodName: string, desc: PojoType){ DecorateRegistCenter.registHttpSends(new HttpMethod({ route, type: HttpMethodType.GET, cost: prototype.constructor, methodName })) } } export function Post(route: string): Function{ return function(prototype: any, methodName: string, desc: PojoType){ DecorateRegistCenter.registHttpSends(new HttpMethod({ route, type: HttpMethodType.POST, cost: prototype.constructor, methodName })) } } export function ParamValue(requestName: string = '', require: boolean = false): Function{ return function(prototype: any, propName: string, index: number): void{ DecorateRegistCenter.registParams(new ControllerParam({ cost: prototype.constructor, propName, index, requestName, require })) } } export function Stream(mineType: string = ''): Function{ return function(prototype: any, methodName: string){ DecorateRegistCenter.registStreams(new Streamable({ mineType, cost: prototype.constructor, methodName })) } } export function Upload(): Function{ return function(prototype: any, methodName: string){ DecorateRegistCenter.registUploads(new Uploader({ cost: prototype.constructor, methodName })) } }