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.IvrLibIntent; 
 | 
import com.smartor.service.IIvrLibIntentService; 
 | 
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/ivrlibintent") 
 | 
public class IvrLibIntentController extends BaseController { 
 | 
    @Autowired 
 | 
    private IIvrLibIntentService ivrLibIntentService; 
 | 
  
 | 
    /** 
 | 
     * 查询AI意图库列表 
 | 
     */ 
 | 
    //@PreAuthorize("@ss.hasPermi('smartor:ivrlibintent:list')") 
 | 
    @PostMapping("/list") 
 | 
    public TableDataInfo list(@RequestBody IvrLibIntent ivrLibIntent) { 
 | 
        startPage(); 
 | 
        List<IvrLibIntent> list = ivrLibIntentService.selectIvrLibIntentList(ivrLibIntent); 
 | 
        return getDataTable(list); 
 | 
    } 
 | 
  
 | 
    /** 
 | 
     * 导出AI意图库列表 
 | 
     */ 
 | 
    //@PreAuthorize("@ss.hasPermi('smartor:ivrlibintent:export')") 
 | 
    @Log(title = "AI意图库", businessType = BusinessType.EXPORT) 
 | 
    @PostMapping("/export") 
 | 
    public void export(HttpServletResponse response, IvrLibIntent ivrLibIntent) { 
 | 
        List<IvrLibIntent> list = ivrLibIntentService.selectIvrLibIntentList(ivrLibIntent); 
 | 
        ExcelUtil<IvrLibIntent> util = new ExcelUtil<IvrLibIntent>(IvrLibIntent.class); 
 | 
        util.exportExcel(response, list, "AI意图库数据"); 
 | 
    } 
 | 
  
 | 
    /** 
 | 
     * 获取AI意图库详细信息 
 | 
     */ 
 | 
    //@PreAuthorize("@ss.hasPermi('smartor:ivrlibintent:query')") 
 | 
    @GetMapping(value = "/{intentid}") 
 | 
    public AjaxResult getInfo(@PathVariable("intentid") Long intentid) { 
 | 
        return success(ivrLibIntentService.selectIvrLibIntentByIntentid(intentid)); 
 | 
    } 
 | 
  
 | 
    /** 
 | 
     * 新增AI意图库 
 | 
     */ 
 | 
    //@PreAuthorize("@ss.hasPermi('smartor:ivrlibintent:add')") 
 | 
    @Log(title = "AI意图库", businessType = BusinessType.INSERT) 
 | 
    @PostMapping("/add") 
 | 
    public AjaxResult add(@RequestBody IvrLibIntent ivrLibIntent) { 
 | 
        SysUser user = getLoginUser().getUser(); 
 | 
        ivrLibIntent.setOrgid(user.getOrgid()); 
 | 
        return toAjax(ivrLibIntentService.insertIvrLibIntent(ivrLibIntent)); 
 | 
    } 
 | 
  
 | 
    /** 
 | 
     * 修改AI意图库 
 | 
     */ 
 | 
    //@PreAuthorize("@ss.hasPermi('smartor:ivrlibintent:edit')") 
 | 
    @Log(title = "AI意图库", businessType = BusinessType.UPDATE) 
 | 
    @PostMapping("/edit") 
 | 
    public AjaxResult edit(@RequestBody IvrLibIntent ivrLibIntent) { 
 | 
        return toAjax(ivrLibIntentService.updateIvrLibIntent(ivrLibIntent)); 
 | 
    } 
 | 
  
 | 
    /** 
 | 
     * 删除AI意图库 
 | 
     */ 
 | 
    //@PreAuthorize("@ss.hasPermi('smartor:ivrlibintent:remove')") 
 | 
    @Log(title = "AI意图库", businessType = BusinessType.DELETE) 
 | 
    @GetMapping("/remove/{intentids}") 
 | 
    public AjaxResult remove(@PathVariable Long[] intentids) { 
 | 
        return toAjax(ivrLibIntentService.deleteIvrLibIntentByIntentids(intentids)); 
 | 
    } 
 | 
} 
 |