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.IvrSceneFlownode; 
 | 
import com.smartor.service.IIvrSceneFlownodeService; 
 | 
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/ivrflownode") 
 | 
public class IvrSceneFlownodeController extends BaseController 
 | 
{ 
 | 
    @Autowired 
 | 
    private IIvrSceneFlownodeService ivrSceneFlownodeService; 
 | 
  
 | 
    /** 
 | 
     * 查询AI外呼流程节点列表 
 | 
     */ 
 | 
    //@PreAuthorize("@ss.hasPermi('smartor:ivrflownode:list')") 
 | 
   @PostMapping("/list") 
 | 
    public TableDataInfo list(@RequestBody IvrSceneFlownode ivrSceneFlownode) 
 | 
    { 
 | 
        startPage(); 
 | 
        List<IvrSceneFlownode> list = ivrSceneFlownodeService.selectIvrSceneFlownodeList(ivrSceneFlownode); 
 | 
        return getDataTable(list); 
 | 
    } 
 | 
  
 | 
    /** 
 | 
     * 导出AI外呼流程节点列表 
 | 
     */ 
 | 
    //@PreAuthorize("@ss.hasPermi('smartor:ivrflownode:export')") 
 | 
    @Log(title = "AI外呼流程节点", businessType = BusinessType.EXPORT) 
 | 
    @PostMapping("/export") 
 | 
    public void export(HttpServletResponse response, IvrSceneFlownode ivrSceneFlownode) 
 | 
    { 
 | 
        List<IvrSceneFlownode> list = ivrSceneFlownodeService.selectIvrSceneFlownodeList(ivrSceneFlownode); 
 | 
        ExcelUtil<IvrSceneFlownode> util = new ExcelUtil<IvrSceneFlownode>(IvrSceneFlownode.class); 
 | 
        util.exportExcel(response, list, "AI外呼流程节点数据"); 
 | 
    } 
 | 
  
 | 
    /** 
 | 
     * 获取AI外呼流程节点详细信息 
 | 
     */ 
 | 
    //@PreAuthorize("@ss.hasPermi('smartor:ivrflownode:query')") 
 | 
    @GetMapping(value = "/{flownodeid}") 
 | 
    public AjaxResult getInfo(@PathVariable("flownodeid") Long flownodeid) 
 | 
    { 
 | 
        return success(ivrSceneFlownodeService.selectIvrSceneFlownodeByFlownodeid(flownodeid)); 
 | 
    } 
 | 
  
 | 
    /** 
 | 
     * 新增AI外呼流程节点 
 | 
     */ 
 | 
    //@PreAuthorize("@ss.hasPermi('smartor:ivrflownode:add')") 
 | 
    @Log(title = "AI外呼流程节点", businessType = BusinessType.INSERT) 
 | 
    @PostMapping("/add") 
 | 
    public AjaxResult add(@RequestBody IvrSceneFlownode ivrSceneFlownode) 
 | 
    { 
 | 
        return toAjax(ivrSceneFlownodeService.insertIvrSceneFlownode(ivrSceneFlownode)); 
 | 
    } 
 | 
  
 | 
    /** 
 | 
     * 修改AI外呼流程节点 
 | 
     */ 
 | 
    //@PreAuthorize("@ss.hasPermi('smartor:ivrflownode:edit')") 
 | 
    @Log(title = "AI外呼流程节点", businessType = BusinessType.UPDATE) 
 | 
    @PostMapping("/edit") 
 | 
    public AjaxResult edit(@RequestBody IvrSceneFlownode ivrSceneFlownode) 
 | 
    { 
 | 
        return toAjax(ivrSceneFlownodeService.updateIvrSceneFlownode(ivrSceneFlownode)); 
 | 
    } 
 | 
  
 | 
    /** 
 | 
     * 删除AI外呼流程节点 
 | 
     */ 
 | 
    //@PreAuthorize("@ss.hasPermi('smartor:ivrflownode:remove')") 
 | 
    @Log(title = "AI外呼流程节点", businessType = BusinessType.DELETE) 
 | 
    @GetMapping("/remove/{flownodeids}") 
 | 
    public AjaxResult remove(@PathVariable Long[] flownodeids) 
 | 
    { 
 | 
        return toAjax(ivrSceneFlownodeService.deleteIvrSceneFlownodeByFlownodeids(flownodeids)); 
 | 
    } 
 | 
} 
 |