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.IvrLibaExtemplate; import com.smartor.service.IIvrLibaExtemplateService; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.core.page.TableDataInfo; /** * 扩展话术模板库Controller * * @author smartor * @date 2023-03-22 */ @RestController @RequestMapping("/smartor/ivrextemplate") public class IvrLibaExtemplateController extends BaseController { @Autowired private IIvrLibaExtemplateService ivrLibaExtemplateService; /** * 查询扩展话术模板库列表 */ @PreAuthorize("@ss.hasPermi('smartor:ivrextemplate:list')") @GetMapping("/list") public TableDataInfo list(IvrLibaExtemplate ivrLibaExtemplate) { startPage(); List list = ivrLibaExtemplateService.selectIvrLibaExtemplateList(ivrLibaExtemplate); return getDataTable(list); } /** * 导出扩展话术模板库列表 */ @PreAuthorize("@ss.hasPermi('smartor:ivrextemplate:export')") @Log(title = "扩展话术模板库", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, IvrLibaExtemplate ivrLibaExtemplate) { List list = ivrLibaExtemplateService.selectIvrLibaExtemplateList(ivrLibaExtemplate); ExcelUtil util = new ExcelUtil(IvrLibaExtemplate.class); util.exportExcel(response, list, "扩展话术模板库数据"); } /** * 获取扩展话术模板库详细信息 */ @PreAuthorize("@ss.hasPermi('smartor:ivrextemplate:query')") @GetMapping(value = "/{subModuleID}") public AjaxResult getInfo(@PathVariable("subModuleID") String subModuleID) { return success(ivrLibaExtemplateService.selectIvrLibaExtemplateBySubModuleID(subModuleID)); } /** * 新增扩展话术模板库 */ @PreAuthorize("@ss.hasPermi('smartor:ivrextemplate:add')") @Log(title = "扩展话术模板库", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody IvrLibaExtemplate ivrLibaExtemplate) { return toAjax(ivrLibaExtemplateService.insertIvrLibaExtemplate(ivrLibaExtemplate)); } /** * 修改扩展话术模板库 */ @PreAuthorize("@ss.hasPermi('smartor:ivrextemplate:edit')") @Log(title = "扩展话术模板库", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody IvrLibaExtemplate ivrLibaExtemplate) { return toAjax(ivrLibaExtemplateService.updateIvrLibaExtemplate(ivrLibaExtemplate)); } /** * 删除扩展话术模板库 */ @PreAuthorize("@ss.hasPermi('smartor:ivrextemplate:remove')") @Log(title = "扩展话术模板库", businessType = BusinessType.DELETE) @DeleteMapping("/{subModuleIDs}") public AjaxResult remove(@PathVariable String[] subModuleIDs) { return toAjax(ivrLibaExtemplateService.deleteIvrLibaExtemplateBySubModuleIDs(subModuleIDs)); } }