2024-09-27 12:21:17 +08:00
|
|
|
package cn.bunny.services.controller;
|
|
|
|
|
2024-10-03 15:52:02 +08:00
|
|
|
import cn.bunny.dao.dto.system.menuIcon.MenuIconAddDto;
|
|
|
|
import cn.bunny.dao.dto.system.menuIcon.MenuIconDto;
|
|
|
|
import cn.bunny.dao.dto.system.menuIcon.MenuIconUpdateDto;
|
2024-09-29 16:51:50 +08:00
|
|
|
import cn.bunny.dao.entity.system.MenuIcon;
|
|
|
|
import cn.bunny.dao.pojo.result.PageResult;
|
|
|
|
import cn.bunny.dao.pojo.result.Result;
|
2024-10-01 22:23:00 +08:00
|
|
|
import cn.bunny.dao.pojo.result.ResultCodeEnum;
|
2024-10-09 16:46:16 +08:00
|
|
|
import cn.bunny.dao.vo.system.MenuIconVo;
|
2024-09-29 16:51:50 +08:00
|
|
|
import cn.bunny.services.service.MenuIconService;
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
import io.swagger.v3.oas.annotations.Operation;
|
|
|
|
import io.swagger.v3.oas.annotations.Parameter;
|
2024-09-27 12:21:17 +08:00
|
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
2024-10-01 22:23:00 +08:00
|
|
|
import jakarta.validation.Valid;
|
2024-09-29 16:51:50 +08:00
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
2024-10-01 22:23:00 +08:00
|
|
|
import org.springframework.web.bind.annotation.*;
|
2024-09-29 16:51:50 +08:00
|
|
|
import reactor.core.publisher.Mono;
|
2024-09-27 12:21:17 +08:00
|
|
|
|
2024-10-01 22:23:00 +08:00
|
|
|
import java.util.List;
|
|
|
|
|
2024-09-27 12:21:17 +08:00
|
|
|
/**
|
|
|
|
* <p>
|
2024-10-01 22:23:00 +08:00
|
|
|
* 系统菜单图标表 前端控制器
|
2024-09-27 12:21:17 +08:00
|
|
|
* </p>
|
|
|
|
*
|
|
|
|
* @author Bunny
|
2024-10-02 14:48:56 +08:00
|
|
|
* @since 2024-10-02 12:18:29
|
2024-09-27 12:21:17 +08:00
|
|
|
*/
|
2024-10-01 22:23:00 +08:00
|
|
|
@Tag(name = "系统菜单图标", description = "系统菜单图标相关接口")
|
2024-09-27 12:21:17 +08:00
|
|
|
@RestController
|
2024-10-02 14:48:56 +08:00
|
|
|
@RequestMapping("admin/menuIcon")
|
2024-09-27 12:21:17 +08:00
|
|
|
public class MenuIconController {
|
|
|
|
|
2024-09-29 16:51:50 +08:00
|
|
|
@Autowired
|
|
|
|
private MenuIconService menuIconService;
|
|
|
|
|
2024-10-01 22:23:00 +08:00
|
|
|
@Operation(summary = "分页查询系统菜单图标", description = "分页查询系统菜单图标")
|
2024-09-29 16:51:50 +08:00
|
|
|
@GetMapping("getMenuIconList/{page}/{limit}")
|
|
|
|
public Mono<Result<PageResult<MenuIconVo>>> getMenuIconList(
|
|
|
|
@Parameter(name = "page", description = "当前页", required = true)
|
|
|
|
@PathVariable("page") Integer page,
|
|
|
|
@Parameter(name = "limit", description = "每页记录数", required = true)
|
|
|
|
@PathVariable("limit") Integer limit,
|
|
|
|
MenuIconDto dto) {
|
|
|
|
Page<MenuIcon> pageParams = new Page<>(page, limit);
|
|
|
|
PageResult<MenuIconVo> pageResult = menuIconService.getMenuIconList(pageParams, dto);
|
|
|
|
return Mono.just(Result.success(pageResult));
|
2024-10-05 21:18:37 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
@Operation(summary = "获取查询图标名称列表", description = "获取查询图标名称列表")
|
|
|
|
@GetMapping("getIconNameList")
|
|
|
|
public Mono<Result<List<MenuIconVo>>> getIconNameList(String iconName) {
|
|
|
|
List<MenuIconVo> voList = menuIconService.getIconNameList(iconName);
|
|
|
|
return Mono.just(Result.success(voList));
|
2024-09-29 16:51:50 +08:00
|
|
|
}
|
2024-10-01 22:23:00 +08:00
|
|
|
|
|
|
|
@Operation(summary = "添加系统菜单图标", description = "添加系统菜单图标")
|
|
|
|
@PostMapping("addMenuIcon")
|
|
|
|
public Mono<Result<String>> addMenuIcon(@Valid @RequestBody MenuIconAddDto dto) {
|
2024-10-02 14:48:56 +08:00
|
|
|
menuIconService.addMenuIcon(dto);
|
2024-10-01 22:23:00 +08:00
|
|
|
return Mono.just(Result.success(ResultCodeEnum.ADD_SUCCESS));
|
|
|
|
}
|
|
|
|
|
|
|
|
@Operation(summary = "更新系统菜单图标", description = "更新系统菜单图标")
|
|
|
|
@PutMapping("updateMenuIcon")
|
|
|
|
public Mono<Result<String>> updateMenuIcon(@Valid @RequestBody MenuIconUpdateDto dto) {
|
|
|
|
menuIconService.updateMenuIcon(dto);
|
|
|
|
return Mono.just(Result.success(ResultCodeEnum.UPDATE_SUCCESS));
|
|
|
|
}
|
|
|
|
|
|
|
|
@Operation(summary = "删除系统菜单图标", description = "删除系统菜单图标")
|
|
|
|
@DeleteMapping("deleteMenuIcon")
|
|
|
|
public Mono<Result<String>> deleteMenuIcon(@RequestBody List<Long> ids) {
|
|
|
|
menuIconService.deleteMenuIcon(ids);
|
|
|
|
return Mono.just(Result.success(ResultCodeEnum.DELETE_SUCCESS));
|
|
|
|
}
|
2024-09-27 12:21:17 +08:00
|
|
|
}
|