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.IvrLibScriptcategory; 
 | 
import com.smartor.service.IIvrLibScriptcategoryService; 
 | 
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/ivrlibscriptcategory") 
 | 
public class IvrLibScriptcategoryController extends BaseController 
 | 
{ 
 | 
    @Autowired 
 | 
    private IIvrLibScriptcategoryService ivrLibScriptcategoryService; 
 | 
  
 | 
    /** 
 | 
     * 查询AI话术库分类列表 
 | 
     */ 
 | 
    //@PreAuthorize("@ss.hasPermi('smartor:ivrlibscriptcategory:list')") 
 | 
   @PostMapping("/list") 
 | 
    public TableDataInfo list(@RequestBody IvrLibScriptcategory ivrLibScriptcategory) 
 | 
    { 
 | 
        startPage(); 
 | 
        List<IvrLibScriptcategory> list = ivrLibScriptcategoryService.selectIvrLibScriptcategoryList(ivrLibScriptcategory); 
 | 
        return getDataTable(list); 
 | 
    } 
 | 
  
 | 
    /** 
 | 
     * 导出AI话术库分类列表 
 | 
     */ 
 | 
    //@PreAuthorize("@ss.hasPermi('smartor:ivrlibscriptcategory:export')") 
 | 
    @Log(title = "AI话术库分类", businessType = BusinessType.EXPORT) 
 | 
    @PostMapping("/export") 
 | 
    public void export(HttpServletResponse response, IvrLibScriptcategory ivrLibScriptcategory) 
 | 
    { 
 | 
        List<IvrLibScriptcategory> list = ivrLibScriptcategoryService.selectIvrLibScriptcategoryList(ivrLibScriptcategory); 
 | 
        ExcelUtil<IvrLibScriptcategory> util = new ExcelUtil<IvrLibScriptcategory>(IvrLibScriptcategory.class); 
 | 
        util.exportExcel(response, list, "AI话术库分类数据"); 
 | 
    } 
 | 
  
 | 
    /** 
 | 
     * 获取AI话术库分类详细信息 
 | 
     */ 
 | 
    //@PreAuthorize("@ss.hasPermi('smartor:ivrlibscriptcategory:query')") 
 | 
    @GetMapping(value = "/{categoryid}") 
 | 
    public AjaxResult getInfo(@PathVariable("categoryid") Long categoryid) 
 | 
    { 
 | 
        return success(ivrLibScriptcategoryService.selectIvrLibScriptcategoryByCategoryid(categoryid)); 
 | 
    } 
 | 
  
 | 
    /** 
 | 
     * 新增AI话术库分类 
 | 
     */ 
 | 
    //@PreAuthorize("@ss.hasPermi('smartor:ivrlibscriptcategory:add')") 
 | 
    @Log(title = "AI话术库分类", businessType = BusinessType.INSERT) 
 | 
    @PostMapping("/add") 
 | 
    public AjaxResult add(@RequestBody IvrLibScriptcategory ivrLibScriptcategory) 
 | 
    { 
 | 
        SysUser user = getLoginUser().getUser(); 
 | 
        ivrLibScriptcategory.setOrgid(user.getOrgid()); 
 | 
        return toAjax(ivrLibScriptcategoryService.insertIvrLibScriptcategory(ivrLibScriptcategory)); 
 | 
    } 
 | 
  
 | 
    /** 
 | 
     * 修改AI话术库分类 
 | 
     */ 
 | 
    //@PreAuthorize("@ss.hasPermi('smartor:ivrlibscriptcategory:edit')") 
 | 
    @Log(title = "AI话术库分类", businessType = BusinessType.UPDATE) 
 | 
    @PostMapping("/edit") 
 | 
    public AjaxResult edit(@RequestBody IvrLibScriptcategory ivrLibScriptcategory) 
 | 
    { 
 | 
        return toAjax(ivrLibScriptcategoryService.updateIvrLibScriptcategory(ivrLibScriptcategory)); 
 | 
    } 
 | 
  
 | 
    /** 
 | 
     * 删除AI话术库分类 
 | 
     */ 
 | 
    //@PreAuthorize("@ss.hasPermi('smartor:ivrlibscriptcategory:remove')") 
 | 
    @Log(title = "AI话术库分类", businessType = BusinessType.DELETE) 
 | 
    @GetMapping("/remove/{categoryids}") 
 | 
    public AjaxResult remove(@PathVariable Long[] categoryids) 
 | 
    { 
 | 
        return toAjax(ivrLibScriptcategoryService.deleteIvrLibScriptcategoryByCategoryids(categoryids)); 
 | 
    } 
 | 
} 
 |