guoyuji
2024-05-23 ef5a518c3e2c1fe41aa60f56ca31ddafa0cb1561
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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;
 
 
@RestController
@RequestMapping("/menu")
 
public class SysMenuController {
    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(lang));
 
    }
}