UNPKG

node-web-mvc

Version:
34 lines (33 loc) 1.93 kB
"use strict"; var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const RequestMapping_1 = __importDefault(require("./RequestMapping")); const Target_1 = __importDefault(require("../Target")); const ElementType_1 = __importDefault(require("../annotation/ElementType")); const HttpMethod_1 = __importDefault(require("../../http/HttpMethod")); const Merge_1 = __importDefault(require("../Merge")); const BasicMapping_1 = __importDefault(require("./BasicMapping")); let PatchMapping = class PatchMapping extends BasicMapping_1.default { }; PatchMapping = __decorate([ (0, Merge_1.default)((0, RequestMapping_1.default)({ method: HttpMethod_1.default.PATCH, value: '' })) ], PatchMapping); /** * 配置一个Patch类型的请求映射 * 例如: * * @RequestMapping('/user/') * @RequestMapping(['/user','/hello'],'GET') * @RequestMapping('/user','POST','application/json') * RequestMapping({ value:'/user',method:'POST',produces:'application/json',consumes:'' }) * @param {String/Object/Array} value 可以为对象,或者为path的字符串数组 '/user' ['/user' ] { value:'xxx',method:'' } */ exports.default = (0, Target_1.default)([ElementType_1.default.METHOD])(PatchMapping);