using Newtonsoft.Json; using System.Collections.Generic; using XHZB.Model; namespace XHZB.Desktop.WebSocket { internal class SocketMsgManger { /// /// 创建直播 /// /// 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() }; return JsonConvert.SerializeObject(msg); } /// /// 进入直播 /// /// 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() }; return JsonConvert.SerializeObject(msg); } /// /// 关闭直播 /// /// 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() }; return JsonConvert.SerializeObject(msg); } /// /// 抢答 /// /// 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() }; return JsonConvert.SerializeObject(msg); } /// /// 结束抢答 /// /// 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() }; return JsonConvert.SerializeObject(msg); } /// /// 随机点名 /// /// 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(), }; msg.t.Add(userid); return JsonConvert.SerializeObject(msg); } /// /// 随机点名结束 /// /// 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(), }; return JsonConvert.SerializeObject(msg); } /// /// 获取消息 /// /// 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(), }; return JsonConvert.SerializeObject(msg); } } }