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.IvrLibaExtemplateCategory; import com.smartor.service.IIvrLibaExtemplateCategoryService; 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/category") public class IvrLibaExtemplateCategoryController extends BaseController { @Autowired private IIvrLibaExtemplateCategoryService ivrLibaExtemplateCategoryService; /** * 查询通用模板分类列表 */ @ApiOperation("查询通用模板分类列表") //@PreAuthorize("@ss.hasPermi('smartor:category:list')") @PostMapping("/list") public TableDataInfo list(@RequestBody IvrLibaExtemplateCategory ivrLibaExtemplateCategory) { startPage(); List list = ivrLibaExtemplateCategoryService.selectIvrLibaExtemplateCategoryList(ivrLibaExtemplateCategory); return getDataTable(list); } /** * 导出通用模板分类列表 */ @ApiOperation("导出通用模板分类列表") //@PreAuthorize("@ss.hasPermi('smartor:category:export')") @Log(title = "通用模板分类", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, IvrLibaExtemplateCategory ivrLibaExtemplateCategory) { List list = ivrLibaExtemplateCategoryService.selectIvrLibaExtemplateCategoryList(ivrLibaExtemplateCategory); ExcelUtil util = new ExcelUtil(IvrLibaExtemplateCategory.class); util.exportExcel(response, list, "通用模板分类数据"); } /** * 获取通用模板分类详细信息 */ @ApiOperation("获取通用模板分类详细信息") //@PreAuthorize("@ss.hasPermi('smartor:category:query')") @GetMapping(value = "/getInfo/{intertcatid}") public AjaxResult getInfo(@PathVariable("intertcatid") Long intertcatid) { return success(ivrLibaExtemplateCategoryService.selectIvrLibaExtemplateCategoryByIntertcatid(intertcatid)); } /** * 新增通用模板分类 */ @ApiOperation("新增通用模板分类") //@PreAuthorize("@ss.hasPermi('smartor:category:add')") @Log(title = "通用模板分类", businessType = BusinessType.INSERT) @PostMapping("/add") public AjaxResult add(@RequestBody IvrLibaExtemplateCategory ivrLibaExtemplateCategory) { SysUser user = getLoginUser().getUser(); ivrLibaExtemplateCategory.setOrgid(user.getOrgid()); return toAjax(ivrLibaExtemplateCategoryService.insertIvrLibaExtemplateCategory(ivrLibaExtemplateCategory)); } /** * 修改通用模板分类 */ @ApiOperation("修改通用模板分类") //@PreAuthorize("@ss.hasPermi('smartor:category:edit')") @Log(title = "通用模板分类", businessType = BusinessType.UPDATE) @PostMapping("/edit") public AjaxResult edit(@RequestBody IvrLibaExtemplateCategory ivrLibaExtemplateCategory) { return toAjax(ivrLibaExtemplateCategoryService.updateIvrLibaExtemplateCategory(ivrLibaExtemplateCategory)); } /** * 删除通用模板分类 */ @ApiOperation("删除通用模板分类") //@PreAuthorize("@ss.hasPermi('smartor:category:remove')") @Log(title = "通用模板分类", businessType = BusinessType.DELETE) @GetMapping("/remove/{intertcatids}") public AjaxResult remove(@PathVariable Long[] intertcatids) { return toAjax(ivrLibaExtemplateCategoryService.deleteIvrLibaExtemplateCategoryByIntertcatids(intertcatids)); } }