Beispiel #1
0
 public object getChannels()
 {
     return(new
     {
         code = 0,
         channels = ImHelper.GetChanList().Select(a => new { a.chan, a.online })
     });
 }
Beispiel #2
0
 public async Task <AjaxResult <object> > GetChannels()
 {
     return(new AjaxResult <object>
     {
         code = 0,
         data = new { channels = ImHelper.GetChanList().Select(a => new { a.chan, a.online }) }
     });
 }
Beispiel #3
0
 public object getChannels()
 {
     return(new
     {
         code = 0,
         channels = ImHelper.GetChanList()
     });
 }
Beispiel #4
0
        public IEnumerable <WeatherForecast> Get()
        {
            Commont.LogCommont.SerilogActionExtention.CreateInstance().Info($"时间:{DateTime.Now.ToString()}");
            Commont.LogCommont.SerilogActionExtention.CreateInstance().Debug($"时间:{DateTime.Now.ToString()}");
            Commont.LogCommont.SerilogActionExtention.CreateInstance().Error($"时间:{DateTime.Now.ToString()}");
            Commont.LogCommont.SerilogActionExtention.CreateInstance().Warning($"时间:{DateTime.Now.ToString()}");

            string Ip      = this.Request.Headers["X-Real-IP"].FirstOrDefault() ?? this.Request.HttpContext.Connection.RemoteIpAddress.ToString();
            var    newGuid = Guid.NewGuid();

            ImHelper.JoinChan(Guid.NewGuid(), "demoChan");//群聊,绑定消息频道
            ImHelper.PrevConnectServer(newGuid, Ip);

            ImHelper.GetChanList().Select(a => new { a.chan, a.online });
            var temp2 = Guid.NewGuid();

            for (int i = 0; i < 10; i++)
            {
                var temp = Guid.NewGuid();
                temp2 = temp;
                ImHelper.PrevConnectServer(temp, Ip);
                ImHelper.JoinChan(temp, "demoChan");//群聊,绑定消息频道
            }
            ImHelper.SendChanMessage(newGuid, "demoChan", "hello word");
            ImHelper.SendMessage(newGuid, new[] { temp2 }, " SendMessage hello word ", false);

            var rng = new Random();

            return(Enumerable.Range(1, 5).Select(index => new WeatherForecast
            {
                Date = DateTime.Now.AddDays(index),
                TemperatureC = rng.Next(-20, 55),
                Summary = Summaries[rng.Next(Summaries.Length)]
            })
                   .ToArray());
        }