package cn.cslg.pas.controller; import cn.cslg.pas.common.core.base.Constants; import cn.cslg.pas.common.dto.HightlightTemplateDTO; import cn.cslg.pas.common.dto.ImportTaskDTO; import cn.cslg.pas.common.model.cronModel.Records; import cn.cslg.pas.common.utils.Response; import cn.cslg.pas.common.vo.HightlightTemplateVO; import cn.cslg.pas.domain.business.HightlightTemplate; import cn.cslg.pas.factorys.businessFactory.Business; import cn.cslg.pas.service.business.HightlightTemplateService; import io.swagger.v3.oas.annotations.Operation; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import java.util.List; /** * 高亮 * @Author xiexiang * @Date 2024/1/12 */ @Slf4j @RequestMapping(Constants.API_XiaoSHI + "/hightlightTemplate") @RestController public class HightlightTemplateController { @Autowired private HightlightTemplateService hightlightTemplateService; @Operation(summary = "添加高亮") @PostMapping("/saveOrUpdate") public Response saveOrUpdate(@RequestBody HightlightTemplateDTO hightlightTemplateDTO) throws Exception { HightlightTemplate hightlightTemplate = hightlightTemplateService.saveOrUpdate(hightlightTemplateDTO); Records records = new Records(); records.setData(hightlightTemplate); return Response.success(records); } @Operation(summary = "查询高亮") @GetMapping("/query") public Response queryHightlight(Integer projectId) throws Exception { List hightlightTemplateVOS = hightlightTemplateService.getHightlight(projectId); Records records = new Records(); records.setData(hightlightTemplateVOS); return Response.success(records); } @Operation(summary = "删除高亮") @PostMapping("/delete") public Response delete(@RequestBody List ids) throws Exception { List deleteIds = hightlightTemplateService.deleteHightlight(ids); Records records = new Records(); records.setData(deleteIds); return Response.success(records); } }