package com.smartor.controller; import java.util.List; import javax.servlet.http.HttpServletResponse; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import com.ruoyi.common.annotation.Log; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.enums.BusinessType; import com.smartor.domain.IvrLibaTemplatetarget; import com.smartor.service.IIvrLibaTemplatetargetService; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.core.page.TableDataInfo; /** * 话术模板库话术指标Controller * * @author smartor * @date 2023-03-22 */ @RestController @RequestMapping("/smartor/ivrtemplatetarget") public class IvrLibaTemplatetargetController extends BaseController { @Autowired private IIvrLibaTemplatetargetService ivrLibaTemplatetargetService; /** * 查询话术模板库话术指标列表 */ @PreAuthorize("@ss.hasPermi('smartor:ivrtemplatetarget:list')") @GetMapping("/list") public TableDataInfo list(IvrLibaTemplatetarget ivrLibaTemplatetarget) { startPage(); List list = ivrLibaTemplatetargetService.selectIvrLibaTemplatetargetList(ivrLibaTemplatetarget); return getDataTable(list); } /** * 导出话术模板库话术指标列表 */ @PreAuthorize("@ss.hasPermi('smartor:ivrtemplatetarget: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, "话术模板库话术指标数据"); } /** * 获取话术模板库话术指标详细信息 */ @PreAuthorize("@ss.hasPermi('smartor:ivrtemplatetarget:query')") @GetMapping(value = "/{templateTargetID}") public AjaxResult getInfo(@PathVariable("templateTargetID") String templateTargetID) { return success(ivrLibaTemplatetargetService.selectIvrLibaTemplatetargetByTemplateTargetID(templateTargetID)); } /** * 新增话术模板库话术指标 */ @PreAuthorize("@ss.hasPermi('smartor:ivrtemplatetarget:add')") @Log(title = "话术模板库话术指标", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody IvrLibaTemplatetarget ivrLibaTemplatetarget) { return toAjax(ivrLibaTemplatetargetService.insertIvrLibaTemplatetarget(ivrLibaTemplatetarget)); } /** * 修改话术模板库话术指标 */ @PreAuthorize("@ss.hasPermi('smartor:ivrtemplatetarget:edit')") @Log(title = "话术模板库话术指标", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody IvrLibaTemplatetarget ivrLibaTemplatetarget) { return toAjax(ivrLibaTemplatetargetService.updateIvrLibaTemplatetarget(ivrLibaTemplatetarget)); } /** * 删除话术模板库话术指标 */ @PreAuthorize("@ss.hasPermi('smartor:ivrtemplatetarget:remove')") @Log(title = "话术模板库话术指标", businessType = BusinessType.DELETE) @DeleteMapping("/{templateTargetIDs}") public AjaxResult remove(@PathVariable String[] templateTargetIDs) { return toAjax(ivrLibaTemplatetargetService.deleteIvrLibaTemplatetargetByTemplateTargetIDs(templateTargetIDs)); } }