package com.ruoyi.web.controller.smartor; 
 | 
  
 | 
import java.util.List; 
 | 
import javax.servlet.http.HttpServletResponse; 
 | 
  
 | 
import com.ruoyi.common.core.domain.entity.SysUser; 
 | 
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.IvrScenecategory; 
 | 
import com.smartor.service.IIvrScenecategoryService; 
 | 
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/ivrscenecategory") 
 | 
public class IvrScenecategoryController extends BaseController { 
 | 
    @Autowired 
 | 
    private IIvrScenecategoryService ivrScenecategoryService; 
 | 
  
 | 
    /** 
 | 
     * 查询AI服务场景管理分类列表 
 | 
     */ 
 | 
    //@PreAuthorize("@ss.hasPermi('smartor:ivrscenecategory:list')") 
 | 
    @PostMapping("/list") 
 | 
    public TableDataInfo list(@RequestBody IvrScenecategory ivrScenecategory) { 
 | 
        startPage(); 
 | 
        List<IvrScenecategory> list = ivrScenecategoryService.selectIvrScenecategoryList(ivrScenecategory); 
 | 
        return getDataTable(list); 
 | 
    } 
 | 
  
 | 
    /** 
 | 
     * 导出AI服务场景管理分类列表 
 | 
     */ 
 | 
    //@PreAuthorize("@ss.hasPermi('smartor:ivrscenecategory:export')") 
 | 
    @Log(title = "AI服务场景管理分类", businessType = BusinessType.EXPORT) 
 | 
    @PostMapping("/export") 
 | 
    public void export(HttpServletResponse response, IvrScenecategory ivrScenecategory) { 
 | 
        List<IvrScenecategory> list = ivrScenecategoryService.selectIvrScenecategoryList(ivrScenecategory); 
 | 
        ExcelUtil<IvrScenecategory> util = new ExcelUtil<IvrScenecategory>(IvrScenecategory.class); 
 | 
        util.exportExcel(response, list, "AI服务场景管理分类数据"); 
 | 
    } 
 | 
  
 | 
    /** 
 | 
     * 获取AI服务场景管理分类详细信息 
 | 
     */ 
 | 
    //@PreAuthorize("@ss.hasPermi('smartor:ivrscenecategory:query')") 
 | 
    @GetMapping(value = "/{scenecatid}") 
 | 
    public AjaxResult getInfo(@PathVariable("scenecatid") Long scenecatid) { 
 | 
        return success(ivrScenecategoryService.selectIvrScenecategoryByScenecatid(scenecatid)); 
 | 
    } 
 | 
  
 | 
    /** 
 | 
     * 新增AI服务场景管理分类 
 | 
     */ 
 | 
    //@PreAuthorize("@ss.hasPermi('smartor:ivrscenecategory:add')") 
 | 
    @Log(title = "AI服务场景管理分类", businessType = BusinessType.INSERT) 
 | 
    @PostMapping("/add") 
 | 
    public AjaxResult add(@RequestBody IvrScenecategory ivrScenecategory) { 
 | 
        SysUser user = getLoginUser().getUser(); 
 | 
        ivrScenecategory.setOrgid(user.getOrgid()); 
 | 
        return toAjax(ivrScenecategoryService.insertIvrScenecategory(ivrScenecategory)); 
 | 
    } 
 | 
  
 | 
    /** 
 | 
     * 修改AI服务场景管理分类 
 | 
     */ 
 | 
    //@PreAuthorize("@ss.hasPermi('smartor:ivrscenecategory:edit')") 
 | 
    @Log(title = "AI服务场景管理分类", businessType = BusinessType.UPDATE) 
 | 
    @PostMapping("/edit") 
 | 
    public AjaxResult edit(@RequestBody IvrScenecategory ivrScenecategory) { 
 | 
        return toAjax(ivrScenecategoryService.updateIvrScenecategory(ivrScenecategory)); 
 | 
    } 
 | 
  
 | 
    /** 
 | 
     * 删除AI服务场景管理分类 
 | 
     */ 
 | 
    //@PreAuthorize("@ss.hasPermi('smartor:ivrscenecategory:remove')") 
 | 
    @Log(title = "AI服务场景管理分类", businessType = BusinessType.DELETE) 
 | 
    @GetMapping("/remove/{scenecatids}") 
 | 
    public AjaxResult remove(@PathVariable Long[] scenecatids) { 
 | 
        return toAjax(ivrScenecategoryService.deleteIvrScenecategoryByScenecatids(scenecatids)); 
 | 
    } 
 | 
} 
 |