Przeglądaj źródła

新增小程序菜单接口

tags/v1.0.0^2
chengwang 1 rok temu
rodzic
commit
30a00eb530
2 zmienionych plików z 101 dodań i 0 usunięć
  1. +99
    -0
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/controller/ApiMenuController.java
  2. +2
    -0
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/controller/MenuController.java

+ 99
- 0
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/controller/ApiMenuController.java Wyświetl plik

@@ -0,0 +1,99 @@
package com.tuoheng.admin.controller;

import com.tuoheng.admin.entity.Menu;
import com.tuoheng.admin.query.MenuQuery;
import com.tuoheng.admin.service.menu.IMenuService;
import com.tuoheng.common.core.annotation.Log;
import com.tuoheng.common.core.enums.LogType;
import com.tuoheng.common.core.utils.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
* 小程序菜单表 前端控制器
*
* @Author ChengWang
* @Date 2022/12/23
*/
@RestController
@RequestMapping("/apiMenu")
public class ApiMenuController {

@Autowired
private IMenuService menuService;

/**
* 获取菜单列表
* @param menuQuery
* @return
*/
@GetMapping("/index")
public JsonResult index(MenuQuery menuQuery){
return menuService.getList(menuQuery);
}

/**
* 获取菜单详情
* @param menuId
* @return
*/
@GetMapping("/info/{menuId}")
public JsonResult info(@PathVariable("menuId") Integer menuId) {
return menuService.info(menuId);
}

/**
* 添加菜单
*
* @param entity 实体对象
* @return
*/
@Log(title = "菜单管理", logType = LogType.INSERT)
@PostMapping("/add")
public JsonResult add(@RequestBody Menu entity) {
return menuService.edit(entity);
}

/**
* 编辑菜单
*
* @param entity 实体对象
* @return
*/
@Log(title = "菜单管理", logType = LogType.UPDATE)
// @RequiresPermissions("sys:menu:edit")
@PutMapping("/edit")
public JsonResult edit(@RequestBody Menu entity) {
return menuService.edit(entity);
}

/**
* 删除菜单
*
* @param menuId 菜单ID
* @return
*/
@Log(title = "菜单管理", logType = LogType.DELETE)
// @RequiresPermissions("sys:menu:delete")
@DeleteMapping("/delete/{menuId}")
public JsonResult delete(@PathVariable("menuId") Integer menuId) {
return menuService.deleteById(menuId);
}

/**
* 获取所有菜单列表
*
* @return
*/
@GetMapping("/getMenuAll")
public JsonResult getMenuAll() {
List<Menu> menuList = menuService.getMenuAll();
return JsonResult.success(menuList);
}




}

+ 2
- 0
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/controller/MenuController.java Wyświetl plik

@@ -13,6 +13,8 @@ import org.springframework.web.bind.annotation.*;
import java.util.List;

/**
* 系统菜单表 前端控制器
*
* @Author ChengWang
* @Date 2022/12/16
*/

Ładowanie…
Anuluj
Zapisz