| | |
| | | import com.terra.system.service.all.PermsService; |
| | | import com.terra.system.service.sys.MenuService; |
| | | 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; |
| | |
| | | * @author sws |
| | | * @date 2022-09-23 |
| | | */ |
| | | @Api(tags= "运维管理\\菜单管理") |
| | | @Tag(name= "运维管理\\菜单管理") |
| | | @RestController |
| | | @RequestMapping("/menu") |
| | | public class MenuController extends BaseController { |
| | |
| | | PermsService permsService; |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "插入一条") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "entity", value = "实体类", dataType = "MenusEntity", paramType = "body", example = "") |
| | | @Operation(summary = "插入一条") |
| | | @Parameters({ |
| | | @Parameter(name = "entity", description = "实体类", example = "") |
| | | }) |
| | | @PostMapping(value = "/insertMenu", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> insertMenu(@RequestBody MenuEntity entity, HttpServletRequest req) { |
| | |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "插入多条") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "list", value = "实体类集合", dataType = "MenusEntity", paramType = "body", example = "") |
| | | @Operation(summary = "插入多条") |
| | | @Parameters({ |
| | | @Parameter(name = "list", description = "实体类集合", example = "") |
| | | }) |
| | | @PostMapping(value = "/insertMenus", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> insertMenus(@RequestBody List<MenuEntity> list, HttpServletRequest req) { |
| | |
| | | } |
| | | |
| | | @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 = "/deleteMenu") |
| | | public ResponseMsg<Integer> deleteMenu(int id) { |
| | |
| | | } |
| | | |
| | | @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 = "/deleteMenus") |
| | | public ResponseMsg<Integer> deleteMenus(@RequestParam List<Integer> ids) { |
| | |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "更新一条") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "entity", value = "实体类", dataType = "MenusEntity", paramType = "body", example = "") |
| | | @Operation(summary = "更新一条") |
| | | @Parameters({ |
| | | @Parameter(name = "entity", description = "实体类", example = "") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/updateMenu", produces = "application/json; charset=UTF-8") |
| | |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "更新多条") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "list", value = "实体类集合", dataType = "MenusEntity", paramType = "body", example = "") |
| | | @Operation(summary = "更新多条") |
| | | @Parameters({ |
| | | @Parameter(name = "list", description = "实体类集合", example = "") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/updateMenus", produces = "application/json; charset=UTF-8") |
| | |
| | | } |
| | | |
| | | @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 = "/selectMenu") |
| | | public ResponseMsg<MenuEntity> selectMenu(int id) { |
| | |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "查询所有") |
| | | @Operation(summary = "查询所有") |
| | | @GetMapping(value = "/selectMenuAll") |
| | | public ResponseMsg<List<MenuEntity>> selectMenuAll() { |
| | | try { |
| | |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "递归查询") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "name", value = "菜单名称", dataType = "String", paramType = "query", required = false, example = "管道基础大数据平台") |
| | | @Operation(summary = "递归查询") |
| | | @Parameters({ |
| | | @Parameter(name = "name", description = "菜单名称", in = ParameterIn.QUERY, required = false, example = "管道基础大数据平台") |
| | | }) |
| | | @GetMapping(value = "/selectMenuRecursive") |
| | | public ResponseMsg<Object> selectMenuRecursive(String name) { |