From 01a79d5b431b71cc79cf5f6cc92cd4f3432781dd Mon Sep 17 00:00:00 2001 From: liusheng <337615773@qq.com> Date: 星期二, 30 四月 2024 12:39:54 +0800 Subject: [PATCH] 代码提交 --- ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/SvyCategoryController.java | 81 ++++++++++++++++++++++------------------ 1 files changed, 45 insertions(+), 36 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/SvyCategoryController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/SvyCategoryController.java index dfe83ea..340cf00 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/SvyCategoryController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/SvyCategoryController.java @@ -1,17 +1,17 @@ -package com.smartor.controller; +package com.ruoyi.web.controller.smartor; import java.util.List; import javax.servlet.http.HttpServletResponse; + +import com.smartor.domain.IvrLibaScriptAssortVO; +import com.smartor.domain.SvyCategoryVO; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiModelProperty; +import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.tags.Tag; 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 org.springframework.web.bind.annotation.*; import com.ruoyi.common.annotation.Log; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; @@ -23,14 +23,14 @@ /** * 闂嵎鍒嗙被Controller - * + * * @author ruoyi * @date 2023-03-02 */ +@Api(description = "闂嵎鍒嗙被") @RestController @RequestMapping("/smartor/svycategory") -public class SvyCategoryController extends BaseController -{ +public class SvyCategoryController extends BaseController { @Autowired private ISvyCategoryService svyCategoryService; @@ -38,11 +38,10 @@ * 鏌ヨ闂嵎鍒嗙被鍒楄〃 */ @PreAuthorize("@ss.hasPermi('smartor:svycategory:list')") - @GetMapping("/list") - public TableDataInfo list(SvyCategory svyCategory) - { - startPage(); - List<SvyCategory> list = svyCategoryService.selectSvyCategoryList(svyCategory); + @PostMapping("/list") + public TableDataInfo list(@RequestBody SvyCategory svyCategory) { +// startPage(); + List<SvyCategoryVO> list = svyCategoryService.selectSvyCategoryList(svyCategory); return getDataTable(list); } @@ -52,21 +51,20 @@ @PreAuthorize("@ss.hasPermi('smartor:svycategory:export')") @Log(title = "闂嵎鍒嗙被", businessType = BusinessType.EXPORT) @PostMapping("/export") - public void export(HttpServletResponse response, SvyCategory svyCategory) - { - List<SvyCategory> list = svyCategoryService.selectSvyCategoryList(svyCategory); - ExcelUtil<SvyCategory> util = new ExcelUtil<SvyCategory>(SvyCategory.class); + public void export(HttpServletResponse response, SvyCategory svyCategory) { + List<SvyCategoryVO> list = svyCategoryService.selectSvyCategoryList(svyCategory); + ExcelUtil<SvyCategoryVO> util = new ExcelUtil<SvyCategoryVO>(SvyCategoryVO.class); util.exportExcel(response, list, "闂嵎鍒嗙被鏁版嵁"); } /** - * 鑾峰彇闂嵎鍒嗙被璇︾粏淇℃伅 + * 鑾峰彇闂嵎鍒嗙被淇℃伅閫氳繃鍒嗙被鍚嶇О */ - @PreAuthorize("@ss.hasPermi('smartor:svycategory:query')") - @GetMapping(value = "/{id}") - public AjaxResult getInfo(@PathVariable("id") Long id) - { - return success(svyCategoryService.selectSvyCategoryById(id)); + // @PreAuthorize("@ss.hasPermi('smartor:svycategory:query')") + @ApiOperation("鑾峰彇闂嵎鍒嗙被璇︾粏淇℃伅锛堥棶鍗风被鍒級") + @PostMapping(value = "/getInfo") + public TableDataInfo getInfo(@RequestParam(required = false) String categoryname) { + return getDataTable(svyCategoryService.selectSvyCategoryById(categoryname)); } /** @@ -74,10 +72,21 @@ */ @PreAuthorize("@ss.hasPermi('smartor:svycategory:add')") @Log(title = "闂嵎鍒嗙被", businessType = BusinessType.INSERT) - @PostMapping - public AjaxResult add(@RequestBody SvyCategory svyCategory) - { + @ApiOperation("鏂板闂嵎鍒嗙被") + @PostMapping("/add") + public AjaxResult add(@RequestBody SvyCategory svyCategory) { return toAjax(svyCategoryService.insertSvyCategory(svyCategory)); + } + + /** + * 鏂板闂嵎鍒嗙被鏍� + */ + @PreAuthorize("@ss.hasPermi('system:assort:add')") + @Log(title = "闂璇濇湳鍒嗙被搴�", businessType = BusinessType.INSERT) + @ApiOperation("鏂板闂嵎鍒嗙被鏍�") + @PostMapping("/addtree") + public AjaxResult addtree(@RequestBody SvyCategoryVO svyCategoryVO) { + return toAjax(svyCategoryService.insertSvyCategoryTree(svyCategoryVO)); } /** @@ -85,9 +94,9 @@ */ @PreAuthorize("@ss.hasPermi('smartor:svycategory:edit')") @Log(title = "闂嵎鍒嗙被", businessType = BusinessType.UPDATE) - @PutMapping - public AjaxResult edit(@RequestBody SvyCategory svyCategory) - { + @ApiOperation("淇敼闂嵎鍒嗙被") + @PostMapping("/edit") + public AjaxResult edit(@RequestBody SvyCategory svyCategory) { return toAjax(svyCategoryService.updateSvyCategory(svyCategory)); } @@ -96,9 +105,9 @@ */ @PreAuthorize("@ss.hasPermi('smartor:svycategory:remove')") @Log(title = "闂嵎鍒嗙被", businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}") - public AjaxResult remove(@PathVariable Long[] ids) - { + @ApiOperation("鍒犻櫎闂嵎鍒嗙被") + @GetMapping("/remove/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) { return toAjax(svyCategoryService.deleteSvyCategoryByIds(ids)); } } -- Gitblit v1.9.3