cc-server-parent/packages/binding/src/utils.ts
MiaoWoo f541290f47 feat: format and rebuild
Signed-off-by: MiaoWoo <admin@yumc.pw>
2019-06-29 17:02:30 +08:00

32 lines
863 B
TypeScript

import { interfaces } from './interfaces'
import { METADATA_KEY } from './constants'
function getVaildControllerMetadata(model: Object) {
let controllerMetadata: interfaces.MethodMetadata = Reflect.getMetadata(
METADATA_KEY.vaildController,
model
) || {};
return controllerMetadata;
}
function getVaildMethodMetadata(constructor: any) {
let parameterMetadata: interfaces.ParameterMetadata[] = Reflect.getMetadata(
METADATA_KEY.vaildMethod,
constructor
) || [];
return parameterMetadata;
}
function getVaildModelMetadata(model: Object) {
let propertyMetadata: interfaces.PropertyMetadata[] = Reflect.getMetadata(
METADATA_KEY.vaildModel,
model
) || [];
return propertyMetadata;
}
export {
getVaildControllerMetadata,
getVaildMethodMetadata,
getVaildModelMetadata
}