123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177 |
- using Newtonsoft.Json;
- using System.Collections.Generic;
- using XHZB.Model;
-
- namespace XHZB.Desktop.WebSocket
- {
- internal class SocketMsgManger
- {
- /// <summary>
- /// 创建直播
- /// </summary>
- /// <returns></returns>
- public static string offlineMsg()
- {
- SocketModel msg = new SocketModel
- {
- c = 1001,
- rid = APP.ClassroomAdd,
- d = "pc",
- u = 1,
- s=1,
- b = new BodyModel
- {
- stname = APP.LoginUser.username,
- stid = APP.LoginUser.userid,
- stpic=APP.LoginUser.headpic
- },
-
-
- f = APP.LoginUser.userid,
- t = new List<int>()
- };
- return JsonConvert.SerializeObject(msg);
- }
- /// <summary>
- /// 进入直播
- /// </summary>
- /// <returns></returns>
- public static string GetIntoMsg()
- {
- SocketModel msg = new SocketModel
- {
- c = 2001,
- rid = APP.ClassroomAdd,
- d = "pc",
- u = 1,
- s = 1,
- b = new BodyModel
- {
- stname = APP.LoginUser.username,
- stid = APP.LoginUser.userid,
- stpic = APP.LoginUser.headpic
- },
-
-
- f = APP.LoginUser.userid,
- t = new List<int>()
- };
- return JsonConvert.SerializeObject(msg);
- }
- /// <summary>
- /// 关闭直播
- /// </summary>
- /// <returns></returns>
- public static string NolineMsg()
- {
- SocketModel msg = new SocketModel
- {
- c = 1002,
- rid = APP.ClassroomAdd,
- d = "pc",
- u = 1,
- s = 1,
- b = new BodyModel(),
- f = APP.LoginUser.userid,
- t = new List<int>()
- };
- return JsonConvert.SerializeObject(msg);
- }
- /// <summary>
- /// 抢答
- /// </summary>
- /// <returns></returns>
- public static string RushToAnswerMsg()
- {
- SocketModel msg = new SocketModel
- {
- c = 1021,
- rid = APP.ClassroomAdd,
- d = "pc",
- u = 1,
- s = 1,
- b = new BodyModel(),
- f = APP.LoginUser.userid,
- t = new List<int>()
- };
- return JsonConvert.SerializeObject(msg);
- }
- /// <summary>
- /// 结束抢答
- /// </summary>
- /// <returns></returns>
- public static string RushToAnswerEndMsg()
- {
- SocketModel msg = new SocketModel
- {
- c = 1022,
- rid = APP.ClassroomAdd,
- d = "pc",
- u = 1,
- s = 1,
- b = new BodyModel(),
- f = APP.LoginUser.userid,
- t = new List<int>()
- };
- return JsonConvert.SerializeObject(msg);
- }
- /// <summary>
- /// 随机点名
- /// </summary>
- /// <returns></returns>
- public static string RandomRollCallMsg(int userid)
- {
- SocketModel msg = new SocketModel
- {
- c = 1031,
- rid = APP.ClassroomAdd,
- d = "pc",
- u = 1,
- s = 1,
- b = new BodyModel(),
- f = APP.LoginUser.userid,
- t = new List<int>(),
- };
- msg.t.Add(userid);
- return JsonConvert.SerializeObject(msg);
- }
- /// <summary>
- /// 随机点名结束
- /// </summary>
- /// <returns></returns>
- public static string RandomRollCallEndMsg()
- {
- SocketModel msg = new SocketModel
- {
- c = 1032,
- rid = APP.ClassroomAdd,
- d = "pc",
- u = 1,
- s = 1,
- b = new BodyModel(),
- f = APP.LoginUser.userid,
- t = new List<int>(),
- };
- return JsonConvert.SerializeObject(msg);
- }
- /// <summary>
- /// 获取消息
- /// </summary>
- /// <returns></returns>
- public static string AddMsg()
- {
- SocketModel msg = new SocketModel
- {
- c = 1040,
- rid = APP.ClassroomAdd,
- d = "pc",
- u = 1,
- s = 1,
- b = new BodyModel(),
- f = APP.LoginUser.userid,
- t = new List<int>(),
- };
- return JsonConvert.SerializeObject(msg);
- }
- }
- }
|