| | |
| | | package com.ruoyi.admin.controller; |
| | | |
| | | import com.ruoyi.admin.netty.NettyChannelMap; |
| | | import com.ruoyi.admin.netty.NettyWebSocketController; |
| | | import com.ruoyi.admin.request.UserDataCountRequest; |
| | | import com.ruoyi.admin.service.MasterWorkerService; |
| | | import com.ruoyi.admin.service.UserService; |
| | |
| | | import com.ruoyi.order.api.entity.OrderResultVO; |
| | | import com.ruoyi.order.api.feignClient.OrderClient; |
| | | import com.ruoyi.system.api.model.LoginUser; |
| | | import io.netty.channel.ChannelHandlerContext; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | |
| | | private OrderClient orderClient; |
| | | @Resource |
| | | private TokenService tokenService; |
| | | |
| | | /** |
| | | * netty测试 |
| | | * |
| | | * @param workerId 请求参数 |
| | | */ |
| | | @ApiOperation(value = "netty测试", tags = {"后台-首页"}) |
| | | @GetMapping(value = "/nettySend") |
| | | public R<?> nettySend(@RequestParam Integer workerId) { |
| | | ChannelHandlerContext context = NettyChannelMap.getData(String.valueOf(workerId)); |
| | | if (null != context) { |
| | | NettyWebSocketController.sendMsgToClient(context, "您有一条新的订单,请注意查收!"); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 用户数据统计 |