chenlu
2024-06-07 2f640b1038fa331954f78ed1f4317212cf5bb34d
north-glass-erp/src/main/java/com/example/erp/controller/userInfo/SysMenuController.java
@@ -1,11 +1,13 @@
package com.example.erp.controller.userInfo;
import cn.dev33.satoken.annotation.SaCheckLogin;
import com.example.erp.common.CacheUtil;
import com.example.erp.common.Result;
import com.example.erp.service.userInfo.SysMenuService;
import com.example.erp.tools.netty.MyChannelHandlerPool;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@@ -14,16 +16,21 @@
@RequestMapping("/menu")
public class SysMenuController {
    @Autowired
    private CacheUtil cacheUtil;
    @Autowired
    private SysMenuService sysMenuService;
    @GetMapping
    public Result getMenu(){
    private final CacheUtil cacheUtil;
    private final SysMenuService sysMenuService;
    public SysMenuController(CacheUtil cacheUtil, SysMenuService sysMenuService) {
        this.cacheUtil = cacheUtil;
        this.sysMenuService = sysMenuService;
    }
    @SaCheckLogin
    @GetMapping("/getMenu/{lang}")
    public Result getMenu(@PathVariable String lang){
        MyChannelHandlerPool myChannelHandlerPool = new MyChannelHandlerPool();
        //myChannelHandlerPool.sendMsg("123");
        //MyChannelHandlerPool.channelGroup.writeAndFlush( new TextWebSocketFrame("123123"));
        return Result.seccess(sysMenuService.getMenu());
        return Result.seccess(sysMenuService.getMenu(lang));
    }
}