package com.ruoyi.web.controller.smartor; 
 | 
  
 | 
import com.ruoyi.common.annotation.Log; 
 | 
import com.ruoyi.common.core.controller.BaseController; 
 | 
import com.ruoyi.common.core.domain.AjaxResult; 
 | 
import com.ruoyi.common.core.domain.entity.SysUser; 
 | 
import com.ruoyi.common.core.page.TableDataInfo; 
 | 
import com.ruoyi.common.enums.BusinessType; 
 | 
import com.ruoyi.common.utils.poi.ExcelUtil; 
 | 
import com.smartor.domain.IvrLibaExtemplate; 
 | 
import com.smartor.service.IIvrLibaExtemplateService; 
 | 
import io.swagger.annotations.Api; 
 | 
import io.swagger.annotations.ApiOperation; 
 | 
import org.springframework.beans.factory.annotation.Autowired; 
 | 
import org.springframework.security.access.prepost.PreAuthorize; 
 | 
import org.springframework.web.bind.annotation.*; 
 | 
  
 | 
import javax.servlet.http.HttpServletResponse; 
 | 
import java.util.List; 
 | 
  
 | 
/** 
 | 
 * 通过模板Controller 
 | 
 * 
 | 
 * @author ruoyi 
 | 
 * @date 2023-12-27 
 | 
 */ 
 | 
@Api(description = "通过模板") 
 | 
@RestController 
 | 
@RequestMapping("/smartor/extemplate") 
 | 
public class IvrLibaExtemplateController extends BaseController { 
 | 
    @Autowired 
 | 
    private IIvrLibaExtemplateService ivrLibaExtemplateService; 
 | 
  
 | 
    /** 
 | 
     * 查询通过模板列表 
 | 
     */ 
 | 
    @ApiOperation("查询通过模板列表") 
 | 
    //@PreAuthorize("@ss.hasPermi('smartor:extemplate:list')") 
 | 
    @PostMapping("/list") 
 | 
    public TableDataInfo list(@RequestBody IvrLibaExtemplate ivrLibaExtemplate) { 
 | 
        startPage(); 
 | 
        List<IvrLibaExtemplate> list = ivrLibaExtemplateService.selectIvrLibaExtemplateList(ivrLibaExtemplate); 
 | 
        return getDataTable(list); 
 | 
    } 
 | 
  
 | 
    /** 
 | 
     * 导出通过模板列表 
 | 
     */ 
 | 
    @ApiOperation("导出通过模板列表") 
 | 
    //@PreAuthorize("@ss.hasPermi('smartor:extemplate:export')") 
 | 
    @Log(title = "通过模板", businessType = BusinessType.EXPORT) 
 | 
    @PostMapping("/export") 
 | 
    public void export(HttpServletResponse response, IvrLibaExtemplate ivrLibaExtemplate) { 
 | 
        List<IvrLibaExtemplate> list = ivrLibaExtemplateService.selectIvrLibaExtemplateList(ivrLibaExtemplate); 
 | 
        ExcelUtil<IvrLibaExtemplate> util = new ExcelUtil<IvrLibaExtemplate>(IvrLibaExtemplate.class); 
 | 
        util.exportExcel(response, list, "通过模板数据"); 
 | 
    } 
 | 
  
 | 
    /** 
 | 
     * 获取通过模板详细信息 
 | 
     */ 
 | 
    @ApiOperation("获取通过模板详细信息") 
 | 
    //@PreAuthorize("@ss.hasPermi('smartor:extemplate:query')") 
 | 
    @GetMapping(value = "/{ID}") 
 | 
    public AjaxResult getInfo(@PathVariable("ID") String ID) { 
 | 
        return success(ivrLibaExtemplateService.selectIvrLibaExtemplateByID(ID)); 
 | 
    } 
 | 
  
 | 
    /** 
 | 
     * 新增通过模板 
 | 
     */ 
 | 
    @ApiOperation("新增通过模板") 
 | 
    //@PreAuthorize("@ss.hasPermi('smartor:extemplate:add')") 
 | 
    @Log(title = "通过模板", businessType = BusinessType.INSERT) 
 | 
    @PostMapping("/add") 
 | 
    public AjaxResult add(@RequestBody IvrLibaExtemplate ivrLibaExtemplate) { 
 | 
        SysUser user = getLoginUser().getUser(); 
 | 
        ivrLibaExtemplate.setOrgid(user.getOrgid()); 
 | 
        return AjaxResult.success(ivrLibaExtemplateService.insertIvrLibaExtemplate(ivrLibaExtemplate)); 
 | 
    } 
 | 
  
 | 
    /** 
 | 
     * 修改通过模板 
 | 
     */ 
 | 
    @ApiOperation("修改通过模板") 
 | 
    //@PreAuthorize("@ss.hasPermi('smartor:extemplate:edit')") 
 | 
    @Log(title = "通过模板", businessType = BusinessType.UPDATE) 
 | 
    @PostMapping("/edit") 
 | 
    public AjaxResult edit(@RequestBody IvrLibaExtemplate ivrLibaExtemplate) { 
 | 
        return toAjax(ivrLibaExtemplateService.updateIvrLibaExtemplate(ivrLibaExtemplate)); 
 | 
    } 
 | 
  
 | 
    /** 
 | 
     * 删除通过模板 
 | 
     */ 
 | 
    @ApiOperation("删除通过模板") 
 | 
    //@PreAuthorize("@ss.hasPermi('smartor:extemplate:remove')") 
 | 
    @Log(title = "通过模板", businessType = BusinessType.DELETE) 
 | 
    @GetMapping("/remove/{IDs}") 
 | 
    public AjaxResult remove(@PathVariable Long[] IDs) { 
 | 
        return toAjax(ivrLibaExtemplateService.deleteIvrLibaExtemplateByIDs(IDs)); 
 | 
    } 
 | 
} 
 |