package com.yaoai.admin.menu;

import cn.dev33.satoken.annotation.SaCheckLogin;
import com.yaoai.admin.menu.dto.AdminMenuNode;
import com.yaoai.common.result.Result;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/admin-api/menus")
@RequiredArgsConstructor
@SaCheckLogin(type = "admin")
public class AdminMenuController {

    private final AdminMenuService adminMenuService;

    @GetMapping("/current")
    public Result<List<AdminMenuNode>> currentMenus() {
        return Result.ok(adminMenuService.currentMenus());
    }
}
