package com.ruoyi.web.controller.smartor; import com.ruoyi.common.annotation.Log; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.utils.poi.ExcelUtil; import com.smartor.domain.IvrLibaTemplateTarget; import com.smartor.service.IIvrLibaTemplateTargetService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; import java.util.List; /** * 模版问题指标库Controller * * @author ruoyi * @date 2023-12-23 */ @Api(description = " 模版问题指标库") @RestController @RequestMapping("/smartor/templatetarget") public class IvrLibaTemplateTargetController extends BaseController { @Autowired private IIvrLibaTemplateTargetService ivrLibaTemplateTargetService; /** * 查询模版问题指标库列表 */ @ApiOperation("查询模版问题指标库列表") @PreAuthorize("@ss.hasPermi('system:target:list')") @PostMapping("/list") public TableDataInfo list(@RequestBody IvrLibaTemplateTarget ivrLibaTemplateTarget) { startPage(); List list = ivrLibaTemplateTargetService.selectIvrLibaTemplateTargetList(ivrLibaTemplateTarget); return getDataTable(list); } /** * 导出模版问题指标库列表 */ @ApiOperation("导出模版问题指标库列表") @PreAuthorize("@ss.hasPermi('system:target:export')") @Log(title = "模版问题指标库", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, IvrLibaTemplateTarget ivrLibaTemplateTarget) { List list = ivrLibaTemplateTargetService.selectIvrLibaTemplateTargetList(ivrLibaTemplateTarget); ExcelUtil util = new ExcelUtil(IvrLibaTemplateTarget.class); util.exportExcel(response, list, "模版问题指标库数据"); } /** * 获取模版问题指标库详细信息 */ @ApiOperation("获取模版问题指标库详细信息") @PreAuthorize("@ss.hasPermi('system:target:query')") @GetMapping(value = "/getInfo/{ID}") public AjaxResult getInfo(@PathVariable("ID") Long ID) { return success(ivrLibaTemplateTargetService.selectIvrLibaTemplateTargetByID(ID)); } /** * 新增模版问题指标库 */ @ApiOperation("新增模版问题指标库") @PreAuthorize("@ss.hasPermi('system:target:add')") @Log(title = "模版问题指标库", businessType = BusinessType.INSERT) @PostMapping("/add") public AjaxResult add(@RequestBody IvrLibaTemplateTarget ivrLibaTemplateTarget) { return toAjax(ivrLibaTemplateTargetService.insertIvrLibaTemplateTarget(ivrLibaTemplateTarget)); } /** * 修改模版问题指标库 */ @ApiOperation("修改模版问题指标库") @PreAuthorize("@ss.hasPermi('system:target:edit')") @Log(title = "模版问题指标库", businessType = BusinessType.UPDATE) @PostMapping("/edit") public AjaxResult edit(@RequestBody IvrLibaTemplateTarget ivrLibaTemplateTarget) { return toAjax(ivrLibaTemplateTargetService.updateIvrLibaTemplateTarget(ivrLibaTemplateTarget)); } /** * 删除模版问题指标库 */ @ApiOperation("删除模版问题指标库") @PreAuthorize("@ss.hasPermi('system:target:remove')") @Log(title = "模版问题指标库", businessType = BusinessType.DELETE) @GetMapping("/remove/{IDs}") public AjaxResult remove(@PathVariable Long[] IDs) { return toAjax(ivrLibaTemplateTargetService.deleteIvrLibaTemplateTargetByIDs(IDs)); } }