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.IvrSceneRecall; import com.smartor.service.IIvrSceneRecallService; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.core.page.TableDataInfo; /** * AI外呼重拨配置Controller * * @author smartor * @date 2023-03-06 */ @RestController @RequestMapping("/smartor/ivrrecall") public class IvrSceneRecallController extends BaseController { @Autowired private IIvrSceneRecallService ivrSceneRecallService; /** * 查询AI外呼重拨配置列表 */ //@PreAuthorize("@ss.hasPermi('smartor:ivrrecall:list')") @PostMapping("/list") public TableDataInfo list(@RequestBody IvrSceneRecall ivrSceneRecall) { startPage(); List list = ivrSceneRecallService.selectIvrSceneRecallList(ivrSceneRecall); return getDataTable(list); } /** * 导出AI外呼重拨配置列表 */ //@PreAuthorize("@ss.hasPermi('smartor:ivrrecall:export')") @Log(title = "AI外呼重拨配置", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, IvrSceneRecall ivrSceneRecall) { List list = ivrSceneRecallService.selectIvrSceneRecallList(ivrSceneRecall); ExcelUtil util = new ExcelUtil(IvrSceneRecall.class); util.exportExcel(response, list, "AI外呼重拨配置数据"); } /** * 获取AI外呼重拨配置详细信息 */ //@PreAuthorize("@ss.hasPermi('smartor:ivrrecall:query')") @GetMapping(value = "/{recallid}") public AjaxResult getInfo(@PathVariable("recallid") Long recallid) { return success(ivrSceneRecallService.selectIvrSceneRecallByRecallid(recallid)); } /** * 新增AI外呼重拨配置 */ //@PreAuthorize("@ss.hasPermi('smartor:ivrrecall:add')") @Log(title = "AI外呼重拨配置", businessType = BusinessType.INSERT) @PostMapping("/add") public AjaxResult add(@RequestBody IvrSceneRecall ivrSceneRecall) { return toAjax(ivrSceneRecallService.insertIvrSceneRecall(ivrSceneRecall)); } /** * 修改AI外呼重拨配置 */ //@PreAuthorize("@ss.hasPermi('smartor:ivrrecall:edit')") @Log(title = "AI外呼重拨配置", businessType = BusinessType.UPDATE) @PostMapping("/edit") public AjaxResult edit(@RequestBody IvrSceneRecall ivrSceneRecall) { return toAjax(ivrSceneRecallService.updateIvrSceneRecall(ivrSceneRecall)); } /** * 删除AI外呼重拨配置 */ //@PreAuthorize("@ss.hasPermi('smartor:ivrrecall:remove')") @Log(title = "AI外呼重拨配置", businessType = BusinessType.DELETE) @GetMapping("/remove/{recallids}") public AjaxResult remove(@PathVariable Long[] recallids) { return toAjax(ivrSceneRecallService.deleteIvrSceneRecallByRecallids(recallids)); } }