From 3acec3660921f22b58bdaa85d61a2fcfba8e6c98 Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期三, 21 六月 2023 10:11:31 +0800
Subject: [PATCH] 问卷列表
---
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/SvyCategoryController.java | 54 +++++++++++++++++++++++++-----------------------------
1 files changed, 25 insertions(+), 29 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..ccb0e4e 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,15 @@
-package com.smartor.controller;
+package com.ruoyi.web.controller.smartor;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
+
+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 +21,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;
@@ -39,8 +37,7 @@
*/
@PreAuthorize("@ss.hasPermi('smartor:svycategory:list')")
@GetMapping("/list")
- public TableDataInfo list(SvyCategory svyCategory)
- {
+ public TableDataInfo list(SvyCategory svyCategory) {
startPage();
List<SvyCategory> list = svyCategoryService.selectSvyCategoryList(svyCategory);
return getDataTable(list);
@@ -52,21 +49,20 @@
@PreAuthorize("@ss.hasPermi('smartor:svycategory:export')")
@Log(title = "闂嵎鍒嗙被", businessType = BusinessType.EXPORT)
@PostMapping("/export")
- public void export(HttpServletResponse response, SvyCategory svyCategory)
- {
+ public void export(HttpServletResponse response, SvyCategory svyCategory) {
List<SvyCategory> list = svyCategoryService.selectSvyCategoryList(svyCategory);
ExcelUtil<SvyCategory> util = new ExcelUtil<SvyCategory>(SvyCategory.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,9 +70,9 @@
*/
@PreAuthorize("@ss.hasPermi('smartor:svycategory:add')")
@Log(title = "闂嵎鍒嗙被", businessType = BusinessType.INSERT)
+ @ApiOperation("鏂板闂嵎鍒嗙被")
@PostMapping
- public AjaxResult add(@RequestBody SvyCategory svyCategory)
- {
+ public AjaxResult add(@RequestBody SvyCategory svyCategory) {
return toAjax(svyCategoryService.insertSvyCategory(svyCategory));
}
@@ -85,9 +81,9 @@
*/
@PreAuthorize("@ss.hasPermi('smartor:svycategory:edit')")
@Log(title = "闂嵎鍒嗙被", businessType = BusinessType.UPDATE)
+ @ApiOperation("淇敼闂嵎鍒嗙被")
@PutMapping
- public AjaxResult edit(@RequestBody SvyCategory svyCategory)
- {
+ public AjaxResult edit(@RequestBody SvyCategory svyCategory) {
return toAjax(svyCategoryService.updateSvyCategory(svyCategory));
}
@@ -96,9 +92,9 @@
*/
@PreAuthorize("@ss.hasPermi('smartor:svycategory:remove')")
@Log(title = "闂嵎鍒嗙被", businessType = BusinessType.DELETE)
- @DeleteMapping("/{ids}")
- public AjaxResult remove(@PathVariable Long[] ids)
- {
+ @ApiOperation("鍒犻櫎闂嵎鍒嗙被")
+ @DeleteMapping("/{ids}")
+ public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(svyCategoryService.deleteSvyCategoryByIds(ids));
}
}
--
Gitblit v1.9.3