m
This commit is contained in:
+53
@@ -0,0 +1,53 @@
|
||||
"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 __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
||||
return function (target, key) { decorator(target, key, paramIndex); }
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.DocumentController = void 0;
|
||||
const openapi = require("@nestjs/swagger");
|
||||
const common_1 = require("@nestjs/common");
|
||||
const swagger_1 = require("@nestjs/swagger");
|
||||
const api_1 = require("../../common/api");
|
||||
const document_service_1 = require("../service/document.service");
|
||||
const document_dto_1 = require("../dto/document.dto");
|
||||
const document_model_1 = require("../../../model/document.model");
|
||||
const public_decorator_1 = require("../../common/decorator/public.decorator");
|
||||
let DocumentController = class DocumentController {
|
||||
documentService;
|
||||
constructor(documentService) {
|
||||
this.documentService = documentService;
|
||||
}
|
||||
async getDocument(dto) {
|
||||
return await this.documentService.getDocument(dto.type);
|
||||
}
|
||||
};
|
||||
exports.DocumentController = DocumentController;
|
||||
__decorate([
|
||||
(0, public_decorator_1.AuthPublic)(),
|
||||
(0, common_1.Get)('getDocument'),
|
||||
(0, swagger_1.ApiOperation)({ summary: '获取文档库(按类型获取最新一条)' }),
|
||||
api_1.Api.ApiResponse({
|
||||
codeDescription: '200成功,400失败',
|
||||
model: document_model_1.DocumentModel,
|
||||
}),
|
||||
openapi.ApiResponse({ status: 200 }),
|
||||
__param(0, (0, common_1.Query)()),
|
||||
__metadata("design:type", Function),
|
||||
__metadata("design:paramtypes", [document_dto_1.DocumentDto]),
|
||||
__metadata("design:returntype", Promise)
|
||||
], DocumentController.prototype, "getDocument", null);
|
||||
exports.DocumentController = DocumentController = __decorate([
|
||||
(0, common_1.Controller)('document'),
|
||||
(0, swagger_1.ApiTags)('文档库'),
|
||||
__metadata("design:paramtypes", [document_service_1.DocumentService])
|
||||
], DocumentController);
|
||||
//# sourceMappingURL=document.controller.js.map
|
||||
Reference in New Issue
Block a user