All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.yes.tools.generator.controller.MenuController Maven / Gradle / Ivy

There is a newer version: 2.0.4
Show newest version
package org.yes.tools.generator.controller;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.yes.tools.core.result.CommonResult;
import org.yes.tools.generator.io.MenuIo;
import org.yes.tools.generator.model.MenuModel;
import org.yes.tools.generator.model.MenuVo;

import java.util.List;

/**
 * @author Co.
 * @name ProjectController
 * @date 2023/4/3 23:04
 */
@Tag(name = "菜单管理")
@RestController(value = "generatorMenuController")
public class MenuController {

    @Autowired
    private MenuIo menuIo;

    @Operation(summary = "获取菜单列表")
    @GetMapping("api/menu/getList")
    public CommonResult> getProjectList(@RequestParam("projectItemId") String projectItemId) {
        List menuList = menuIo.getMenuTreeList(projectItemId);
        return CommonResult.success(menuList);
    }

    @Operation(summary = "获取菜单列表")
    @GetMapping("api/menu/getOneMenuList")
    public CommonResult> getOneMenuList(@RequestParam("projectItemId") String projectItemId) {
        List oneMenuList = menuIo.getOneMenuList(projectItemId);
        return CommonResult.success(oneMenuList);
    }

    @Operation(summary = "保存菜单列表")
    @PostMapping("api/menu/saveMenu")
    public CommonResult saveMenu(@RequestBody MenuModel model) {
        Boolean aBoolean = menuIo.saveMenu(model);
        return CommonResult.success(aBoolean);
    }

    @Operation(summary = "获取菜单详情")
    @GetMapping("api/menu/getMenuDtl")
    public CommonResult getMenuDtl(@RequestParam("id") String id) {
        MenuModel menuDtl = menuIo.getMenuDtl(id);
        return CommonResult.success(menuDtl);
    }

    @Operation(summary = "更新菜单列表")
    @PostMapping("api/menu/modifyMenu")
    public CommonResult modifyMenu(@RequestBody MenuModel model) {
        Boolean aBoolean = menuIo.modifyMenu(model);
        return CommonResult.success(aBoolean);
    }

    @Operation(summary = "删除菜单")
    @GetMapping("api/menu/deleteMenu")
    public CommonResult deleteMenu(@RequestParam("id") String id) {
        Boolean aBoolean = menuIo.deleteMenu(id);
        return CommonResult.success(aBoolean);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy