package io.gisbi.menu.server;

import io.gisbi.api.menu.MenuApi;
import io.gisbi.api.menu.vo.MenuVO;
import io.gisbi.i18n.I18n;
import io.gisbi.menu.dao.auto.entity.CoreMenu;
import io.gisbi.menu.manage.MenuManage;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

@RestController
@RequestMapping("/menu")
public class MenuServer implements MenuApi {

    @Resource
    private MenuManage menuManage;

    @Override
    public List<MenuVO> query() {
        List<CoreMenu> coreMenus = menuManage.coreMenus();
        return menuManage.query(new ArrayList<>(coreMenus));
    }
}
