package cn.cslg.report.controller;

import cn.cslg.report.common.core.base.Constants;

import cn.cslg.report.entity.Template;
import cn.cslg.report.service.business.TemplateService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.context.annotation.Lazy;
import org.springframework.web.bind.annotation.*;

import java.io.IOException;

@Tag(name = "报告模板")
@RestController
@RequestMapping(Constants.REPORT_API + "/template")
@RequiredArgsConstructor(onConstructor_ = {@Lazy})
public class TempleController {
    public final TemplateService templateService;
    @RequestMapping(value = "/getTemplateByType", method = RequestMethod.POST)
    @Operation(summary = "根据报告类型获得模板")
    public  String getTemplateByType(@RequestBody Template template) throws IOException{
        return templateService.getTemplateByType(template);
    }

}
