You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
using GDZZ.Core;
|
|
|
|
|
using GDZZ.Core.Entity;
|
|
|
|
|
using GDZZ.Core.Service;
|
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
|
using Microsoft.AspNetCore.SignalR;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using Furion.DependencyInjection;
|
|
|
|
|
using Furion.DynamicApiController;
|
|
|
|
|
|
|
|
|
|
namespace GDZZ.Application.Service.LiveChat
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 即时聊天
|
|
|
|
|
/// </summary>
|
|
|
|
|
[ApiDescriptionSettings("Application", Name = "LiveChat", Order = 1)]
|
|
|
|
|
public class LiveChatService:Hub<ILiveChatService> ,ILiveChatService, IDynamicApiController, ITransient
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 聊天总线
|
|
|
|
|
/// </summary>
|
|
|
|
|
private readonly IHubContext<ChatHub, IChatClient> _chatHubContext;
|
|
|
|
|
|
|
|
|
|
private readonly SqlSugarRepository<OnlineUser> sysOnlineUerRep; // 在线用户表仓储
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 聊天服务
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="chatHubContext"></param>
|
|
|
|
|
/// <param name="_sysOnlineUerRep"></param>
|
|
|
|
|
public LiveChatService(IHubContext<ChatHub, IChatClient> chatHubContext,
|
|
|
|
|
SqlSugarRepository<OnlineUser> _sysOnlineUerRep)
|
|
|
|
|
{
|
|
|
|
|
this.sysOnlineUerRep = _sysOnlineUerRep;
|
|
|
|
|
_chatHubContext = chatHubContext;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|