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.IvrTaskcall; import com.smartor.service.IIvrTaskcallService; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.core.page.TableDataInfo; /** * 语音任务呼叫Controller * * @author smartor * @date 2023-03-24 */ @RestController @RequestMapping("/smartor/ivrtaskcall") public class IvrTaskcallController extends BaseController { @Autowired private IIvrTaskcallService ivrTaskcallService; /** * 查询语音任务呼叫列表 */ @PreAuthorize("@ss.hasPermi('smartor:ivrtaskcall:list')") @GetMapping("/list") public TableDataInfo list(IvrTaskcall ivrTaskcall) { startPage(); List list = ivrTaskcallService.selectIvrTaskcallList(ivrTaskcall); return getDataTable(list); } /** * 导出语音任务呼叫列表 */ @PreAuthorize("@ss.hasPermi('smartor:ivrtaskcall:export')") @Log(title = "语音任务呼叫", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, IvrTaskcall ivrTaskcall) { List list = ivrTaskcallService.selectIvrTaskcallList(ivrTaskcall); ExcelUtil util = new ExcelUtil(IvrTaskcall.class); util.exportExcel(response, list, "语音任务呼叫数据"); } /** * 获取语音任务呼叫详细信息 */ @PreAuthorize("@ss.hasPermi('smartor:ivrtaskcall:query')") @GetMapping(value = "/{callid}") public AjaxResult getInfo(@PathVariable("callid") Long callid) { return success(ivrTaskcallService.selectIvrTaskcallByCallid(callid)); } /** * 新增语音任务呼叫 */ @PreAuthorize("@ss.hasPermi('smartor:ivrtaskcall:add')") @Log(title = "语音任务呼叫", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody IvrTaskcall ivrTaskcall) { return toAjax(ivrTaskcallService.insertIvrTaskcall(ivrTaskcall)); } /** * 修改语音任务呼叫 */ @PreAuthorize("@ss.hasPermi('smartor:ivrtaskcall:edit')") @Log(title = "语音任务呼叫", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody IvrTaskcall ivrTaskcall) { return toAjax(ivrTaskcallService.updateIvrTaskcall(ivrTaskcall)); } /** * 删除语音任务呼叫 */ @PreAuthorize("@ss.hasPermi('smartor:ivrtaskcall:remove')") @Log(title = "语音任务呼叫", businessType = BusinessType.DELETE) @DeleteMapping("/{callids}") public AjaxResult remove(@PathVariable Long[] callids) { return toAjax(ivrTaskcallService.deleteIvrTaskcallByCallids(callids)); } }