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.IvrSceneFlow;
|
import com.smartor.service.IIvrSceneFlowService;
|
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/ivrflow")
|
public class IvrSceneFlowController extends BaseController
|
{
|
@Autowired
|
private IIvrSceneFlowService ivrSceneFlowService;
|
|
/**
|
* 查询AI外呼流程列表
|
*/
|
//@PreAuthorize("@ss.hasPermi('smartor:ivrflow:list')")
|
@PostMapping("/list")
|
public TableDataInfo list(@RequestBody IvrSceneFlow ivrSceneFlow)
|
{
|
startPage();
|
List<IvrSceneFlow> list = ivrSceneFlowService.selectIvrSceneFlowList(ivrSceneFlow);
|
return getDataTable(list);
|
}
|
|
/**
|
* 导出AI外呼流程列表
|
*/
|
//@PreAuthorize("@ss.hasPermi('smartor:ivrflow:export')")
|
@Log(title = "AI外呼流程", businessType = BusinessType.EXPORT)
|
@PostMapping("/export")
|
public void export(HttpServletResponse response, IvrSceneFlow ivrSceneFlow)
|
{
|
List<IvrSceneFlow> list = ivrSceneFlowService.selectIvrSceneFlowList(ivrSceneFlow);
|
ExcelUtil<IvrSceneFlow> util = new ExcelUtil<IvrSceneFlow>(IvrSceneFlow.class);
|
util.exportExcel(response, list, "AI外呼流程数据");
|
}
|
|
/**
|
* 获取AI外呼流程详细信息
|
*/
|
//@PreAuthorize("@ss.hasPermi('smartor:ivrflow:query')")
|
@GetMapping(value = "/{flowid}")
|
public AjaxResult getInfo(@PathVariable("flowid") Long flowid)
|
{
|
return success(ivrSceneFlowService.selectIvrSceneFlowByFlowid(flowid));
|
}
|
|
/**
|
* 新增AI外呼流程
|
*/
|
//@PreAuthorize("@ss.hasPermi('smartor:ivrflow:add')")
|
@Log(title = "AI外呼流程", businessType = BusinessType.INSERT)
|
@PostMapping("/add")
|
public AjaxResult add(@RequestBody IvrSceneFlow ivrSceneFlow)
|
{
|
return toAjax(ivrSceneFlowService.insertIvrSceneFlow(ivrSceneFlow));
|
}
|
|
/**
|
* 修改AI外呼流程
|
*/
|
//@PreAuthorize("@ss.hasPermi('smartor:ivrflow:edit')")
|
@Log(title = "AI外呼流程", businessType = BusinessType.UPDATE)
|
@PostMapping("/edit")
|
public AjaxResult edit(@RequestBody IvrSceneFlow ivrSceneFlow)
|
{
|
return toAjax(ivrSceneFlowService.updateIvrSceneFlow(ivrSceneFlow));
|
}
|
|
/**
|
* 删除AI外呼流程
|
*/
|
//@PreAuthorize("@ss.hasPermi('smartor:ivrflow:remove')")
|
@Log(title = "AI外呼流程", businessType = BusinessType.DELETE)
|
@GetMapping("/remove/{flowids}")
|
public AjaxResult remove(@PathVariable Long[] flowids)
|
{
|
return toAjax(ivrSceneFlowService.deleteIvrSceneFlowByFlowids(flowids));
|
}
|
}
|