@mvx/mvc
Version:
@mvx/mvc is mvc framework on server, base on koa, @tsdi frameworks
28 lines (26 loc) • 696 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.JsonResult = void 0;
const ResultValue_1 = require("./ResultValue");
/**
* controller method return result type of json.
* context type 'application/json'
*
* @export
* @class JsonResult
*/
class JsonResult extends ResultValue_1.ResultValue {
constructor(data) {
super('application/json');
this.data = data;
}
async sendValue(ctx) {
ctx.type = this.contentType;
ctx.body = this.data || {};
}
static ρAnn() {
return { "name": "JsonResult" };
}
}
exports.JsonResult = JsonResult;
//# sourceMappingURL=../sourcemaps/results/JsonResult.js.map