From b8d62de41ff7e1e0549061308aa11f68cf881ed9 Mon Sep 17 00:00:00 2001 From: 13693261870 <252740454@qq.com> Date: 星期三, 16 七月 2025 17:01:20 +0800 Subject: [PATCH] 修改所有的controller --- se-system/src/main/java/com/terra/system/controller/sys/RoleController.java | 82 +++++++++++++++++++++-------------------- 1 files changed, 42 insertions(+), 40 deletions(-) diff --git a/se-system/src/main/java/com/terra/system/controller/sys/RoleController.java b/se-system/src/main/java/com/terra/system/controller/sys/RoleController.java index 9912fac..26ed8ab 100644 --- a/se-system/src/main/java/com/terra/system/controller/sys/RoleController.java +++ b/se-system/src/main/java/com/terra/system/controller/sys/RoleController.java @@ -8,12 +8,14 @@ import com.terra.system.service.all.PermsService; import com.terra.system.service.sys.RoleService; import com.terra.system.service.sys.TokenService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; import javax.annotation.Resource; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletRequest; import java.util.List; @@ -23,7 +25,7 @@ * @author SWS * @date 2022-09.28 */ -@Api(tags = "杩愮淮绠$悊\\瑙掕壊绠$悊") +@Tag(name = "杩愮淮绠$悊\\瑙掕壊绠$悊") @RestController @RequestMapping("/role") public class RoleController extends BaseController { @@ -37,10 +39,10 @@ PermsService permsService; @SysLog() - @ApiOperation(value = "鏌ヨ璁板綍鏁�") - @ApiImplicitParams({ - @ApiImplicitParam(name = "name", value = "鍚嶇О", dataType = "String", paramType = "query", example = "Admin"), - @ApiImplicitParam(name = "depid", value = "鍗曚綅ID", dataType = "Integer", paramType = "query", example = "1") + @Operation(summary = "鏌ヨ璁板綍鏁�") + @Parameters({ + @Parameter(name = "name", description = "鍚嶇О", in = ParameterIn.QUERY, example = "Admin"), + @Parameter(name = "depid", description = "鍗曚綅ID", in = ParameterIn.QUERY, example = "1") }) @GetMapping({"/selectCount"}) public ResponseMsg<Integer> selectCount(String name, Integer depid) { @@ -54,12 +56,12 @@ } @SysLog() - @ApiOperation(value = "鍒嗛〉鏌ヨ") - @ApiImplicitParams({ - @ApiImplicitParam(name = "name", value = "鍚嶇О", dataType = "String", paramType = "query", example = "Admin"), - @ApiImplicitParam(name = "depid", value = "鍗曚綅ID", dataType = "Integer", paramType = "query", example = "1"), - @ApiImplicitParam(name = "pageSize", value = "姣忛〉鏉℃暟", dataType = "Integer", paramType = "query", example = "10"), - @ApiImplicitParam(name = "pageIndex", value = "鍒嗛〉鏁帮紙浠�1寮�濮嬶級", dataType = "Integer", paramType = "query", example = "1") + @Operation(summary = "鍒嗛〉鏌ヨ") + @Parameters({ + @Parameter(name = "name", description = "鍚嶇О", in = ParameterIn.QUERY, example = "Admin"), + @Parameter(name = "depid", description = "鍗曚綅ID", in = ParameterIn.QUERY, example = "1"), + @Parameter(name = "pageSize", description = "姣忛〉鏉℃暟", in = ParameterIn.QUERY, example = "10"), + @Parameter(name = "pageIndex", description = "鍒嗛〉鏁帮紙浠�1寮�濮嬶級", in = ParameterIn.QUERY, example = "1") }) @GetMapping(value = "/selectByPage") public ResponseMsg<List<RoleEntity>> selectByPage(String name, Integer depid, Integer pageSize, Integer pageIndex) { @@ -77,12 +79,12 @@ } @SysLog() - @ApiOperation(value = "鍒嗛〉鏌ヨ骞惰繑鍥炶褰曟暟") - @ApiImplicitParams({ - @ApiImplicitParam(name = "name", value = "鍚嶇О", dataType = "String", paramType = "query", example = "Admin"), - @ApiImplicitParam(name = "depid", value = "鍗曚綅ID", dataType = "Integer", paramType = "query", example = "1"), - @ApiImplicitParam(name = "pageSize", value = "姣忛〉鏉℃暟", dataType = "Integer", paramType = "query", example = "10"), - @ApiImplicitParam(name = "pageIndex", value = "鍒嗛〉鏁帮紙浠�1寮�濮嬶級", dataType = "Integer", paramType = "query", example = "1") + @Operation(summary = "鍒嗛〉鏌ヨ骞惰繑鍥炶褰曟暟") + @Parameters({ + @Parameter(name = "name", description = "鍚嶇О", in = ParameterIn.QUERY, example = "Admin"), + @Parameter(name = "depid", description = "鍗曚綅ID", in = ParameterIn.QUERY, example = "1"), + @Parameter(name = "pageSize", description = "姣忛〉鏉℃暟", in = ParameterIn.QUERY, example = "10"), + @Parameter(name = "pageIndex", description = "鍒嗛〉鏁帮紙浠�1寮�濮嬶級", in = ParameterIn.QUERY, example = "1") }) @GetMapping(value = "/selectByPageAndCount") public ResponseMsg<List<RoleEntity>> selectByPageAndCount(String name, Integer depid, Integer pageSize, Integer pageIndex) { @@ -105,9 +107,9 @@ } @SysLog() - @ApiOperation(value = "鎻掑叆涓�鏉�") - @ApiImplicitParams({ - @ApiImplicitParam(name = "entity", value = "瀹炰綋绫�", dataType = "RoleEntity", paramType = "body", example = "") + @Operation(summary = "鎻掑叆涓�鏉�") + @Parameters({ + @Parameter(name = "entity", description = "瀹炰綋绫�", example = "") }) @PostMapping(value = "/insertRole", produces = "application/json; charset=UTF-8") public ResponseMsg<Integer> insertRole(@RequestBody RoleEntity entity, HttpServletRequest req) { @@ -127,9 +129,9 @@ } @SysLog() - @ApiOperation(value = "鎻掑叆澶氭潯") - @ApiImplicitParams({ - @ApiImplicitParam(name = "list", value = "瀹炰綋绫婚泦鍚�", dataType = "List<RoleEntity>", paramType = "body", example = "") + @Operation(summary = "鎻掑叆澶氭潯") + @Parameters({ + @Parameter(name = "list", description = "瀹炰綋绫婚泦鍚�", schema = @Schema(type = "array"), example = "") }) @PostMapping(value = "/insertRoles", produces = "application/json; charset=UTF-8") public ResponseMsg<Integer> insertRoles(@RequestBody List<RoleEntity> list, HttpServletRequest req) { @@ -151,9 +153,9 @@ } @SysLog() - @ApiOperation(value = "鍒犻櫎涓�鏉�") - @ApiImplicitParams({ - @ApiImplicitParam(name = "id", value = "ID", dataType = "Integer", paramType = "query", example = "1") + @Operation(summary = "鍒犻櫎涓�鏉�") + @Parameters({ + @Parameter(name = "id", description = "ID", in = ParameterIn.QUERY, example = "1") }) @GetMapping(value = "/deleteRole") public ResponseMsg<Integer> deleteRole(int id) { @@ -168,9 +170,9 @@ } @SysLog() - @ApiOperation(value = "鍒犻櫎澶氭潯") - @ApiImplicitParams({ - @ApiImplicitParam(name = "ids", value = "ID鏁扮粍", dataType = "List<Integer>", paramType = "query", example = "1,2") + @Operation(summary = "鍒犻櫎澶氭潯") + @Parameters({ + @Parameter(name = "ids", description = "ID鏁扮粍", schema = @Schema(type = "array"), in = ParameterIn.QUERY, example = "1,2") }) @GetMapping(value = "/deleteAuths") public ResponseMsg<Integer> deleteRoles(@RequestParam List<Integer> ids) { @@ -189,9 +191,9 @@ } @SysLog() - @ApiOperation(value = "鏇存柊涓�鏉�") - @ApiImplicitParams({ - @ApiImplicitParam(name = "entity", value = "瀹炰綋绫�", dataType = "RoleEntity", paramType = "body", example = "") + @Operation(summary = "鏇存柊涓�鏉�") + @Parameters({ + @Parameter(name = "entity", description = "瀹炰綋绫�", example = "") }) @ResponseBody @PostMapping(value = "/updateRole", produces = "application/json; charset=UTF-8") @@ -212,9 +214,9 @@ } @SysLog() - @ApiOperation(value = "鏍规嵁ID鏌ヨ") - @ApiImplicitParams({ - @ApiImplicitParam(name = "id", value = "ID", dataType = "Integer", paramType = "query", example = "1") + @Operation(summary = "鏍规嵁ID鏌ヨ") + @Parameters({ + @Parameter(name = "id", description = "ID", in = ParameterIn.QUERY, example = "1") }) @GetMapping(value = "/selectRole") public ResponseMsg<RoleEntity> selectRole(int id) { @@ -228,7 +230,7 @@ } @SysLog() - @ApiOperation(value = "鏌ヨ鎵�鏈�") + @Operation(summary = "鏌ヨ鎵�鏈�") @GetMapping(value = "/selectRoleAll") public ResponseMsg<List<RoleEntity>> selectRoleAll() { try { -- Gitblit v1.9.3