using Furion.InstantMessaging;
|
using Microsoft.AspNetCore.SignalR;
|
using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Text;
|
using System.Threading.Tasks;
|
using WCS.Application.Service.WcsDevice.Dto;
|
|
namespace WCS.Application.Hub;
|
/// <summary>
|
///
|
/// </summary>
|
[MapHub("/hubs/CheckTask")]
|
public class CheckTaskHub : Hub<ICheckTaskHub>
|
{
|
private readonly IHubContext<CheckTaskHub, ICheckTaskHub> _checkTaskHubContext;
|
|
public CheckTaskHub(IHubContext<CheckTaskHub, ICheckTaskHub> checkTaskHubContext)
|
{
|
_checkTaskHubContext = checkTaskHubContext;
|
}
|
|
/// <summary>
|
/// 连接
|
/// </summary>
|
/// <returns></returns>
|
public override async Task OnConnectedAsync()
|
{
|
await base.OnConnectedAsync();
|
}
|
|
/// <summary>
|
/// 断开
|
/// </summary>
|
/// <param name="exception"></param>
|
/// <returns></returns>
|
public override async Task OnDisconnectedAsync(Exception exception)
|
{
|
await base.OnDisconnectedAsync(exception);
|
}
|
|
/// <summary>
|
/// 下发分拣任务
|
/// </summary>
|
/// <returns></returns>
|
public async Task PublicCheckTask(WcsDeviceTaskOrderDto context)
|
{
|
await _checkTaskHubContext.Clients.All.PublicCheckTask(context);
|
}
|
}
|