|
@@ -0,0 +1,58 @@
|
|
|
|
+package com.sky.ioc.controller.data;
|
|
|
|
+
|
|
|
|
+import com.sky.ioc.entity.domain.data.Building;
|
|
|
|
+import com.sky.ioc.entity.domain.data.Template;
|
|
|
|
+import com.sky.ioc.service.data.TemplateService;
|
|
|
|
+import com.sky.ioc.tool.ReturnMsg;
|
|
|
|
+import io.swagger.annotations.Api;
|
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
+
|
|
|
|
+@Api(tags = "数据管理--模板")
|
|
|
|
+@Slf4j
|
|
|
|
+@RestController
|
|
|
|
+@RequestMapping("/data")
|
|
|
|
+public class TemplateController {
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ TemplateService templateService;
|
|
|
|
+
|
|
|
|
+ @ApiOperation("删除模板")
|
|
|
|
+ @DeleteMapping(value = "/template")
|
|
|
|
+ public ReturnMsg delTemplate(Integer id) {
|
|
|
|
+ return templateService.delTemplate(id);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @ApiOperation("批量删除模板")
|
|
|
|
+ @DeleteMapping(value = "/batch_delete_template")
|
|
|
|
+ public ReturnMsg batchDelTemplate(String template_ids) {
|
|
|
|
+ return templateService.batchDel(template_ids);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @ApiOperation("修改模板")
|
|
|
|
+ @PutMapping(value = "/template")
|
|
|
|
+ public ReturnMsg editTemplate(Template template) {
|
|
|
|
+ return templateService.editTemplate(template);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @ApiOperation("添加模板")
|
|
|
|
+ @PostMapping(value = "/template")
|
|
|
|
+ public ReturnMsg addTemplate(Template template) {
|
|
|
|
+ return templateService.addTemplate(template);
|
|
|
|
+ }
|
|
|
|
+ @ApiOperation("获取模板详情")
|
|
|
|
+ @GetMapping(value = "/template")
|
|
|
|
+ public ReturnMsg getTemplate(Integer id) {
|
|
|
|
+ return templateService.getById(id);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @ApiOperation("获取模板列表")
|
|
|
|
+ @GetMapping(value = "/template_list")
|
|
|
|
+ public ReturnMsg getTemplateList(String template_name,String template_format,String template_type,String report_type,
|
|
|
|
+ @RequestParam(defaultValue = "1") Integer page,@RequestParam(defaultValue = "20") Integer page_size) {
|
|
|
|
+ return templateService.getList(template_name,template_format,template_type,report_type,page,page_size);
|
|
|
|
+ }
|
|
|
|
+}
|