星火直播PC
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.

SocketMsgManger.cs 4.9KB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. using Newtonsoft.Json;
  2. using System.Collections.Generic;
  3. using XHZB.Model;
  4. namespace XHZB.Desktop.WebSocket
  5. {
  6. internal class SocketMsgManger
  7. {
  8. /// <summary>
  9. /// 创建直播
  10. /// </summary>
  11. /// <returns></returns>
  12. public static string offlineMsg()
  13. {
  14. SocketModel msg = new SocketModel
  15. {
  16. c = 1001,
  17. rid = APP.ClassroomAdd,
  18. d = "pc",
  19. u = 1,
  20. s=1,
  21. b = new BodyModel
  22. {
  23. stname = APP.LoginUser.username,
  24. stid = APP.LoginUser.userid,
  25. stpic=APP.LoginUser.headpic
  26. },
  27. f = APP.LoginUser.userid,
  28. t = new List<int>()
  29. };
  30. return JsonConvert.SerializeObject(msg);
  31. }
  32. /// <summary>
  33. /// 进入直播
  34. /// </summary>
  35. /// <returns></returns>
  36. public static string GetIntoMsg()
  37. {
  38. SocketModel msg = new SocketModel
  39. {
  40. c = 2001,
  41. rid = APP.ClassroomAdd,
  42. d = "pc",
  43. u = 1,
  44. s = 1,
  45. b = new BodyModel
  46. {
  47. stname = APP.LoginUser.username,
  48. stid = APP.LoginUser.userid,
  49. stpic = APP.LoginUser.headpic
  50. },
  51. f = APP.LoginUser.userid,
  52. t = new List<int>()
  53. };
  54. return JsonConvert.SerializeObject(msg);
  55. }
  56. /// <summary>
  57. /// 关闭直播
  58. /// </summary>
  59. /// <returns></returns>
  60. public static string NolineMsg()
  61. {
  62. SocketModel msg = new SocketModel
  63. {
  64. c = 1002,
  65. rid = APP.ClassroomAdd,
  66. d = "pc",
  67. u = 1,
  68. s = 1,
  69. b = new BodyModel(),
  70. f = APP.LoginUser.userid,
  71. t = new List<int>()
  72. };
  73. return JsonConvert.SerializeObject(msg);
  74. }
  75. /// <summary>
  76. /// 抢答
  77. /// </summary>
  78. /// <returns></returns>
  79. public static string RushToAnswerMsg()
  80. {
  81. SocketModel msg = new SocketModel
  82. {
  83. c = 1021,
  84. rid = APP.ClassroomAdd,
  85. d = "pc",
  86. u = 1,
  87. s = 1,
  88. b = new BodyModel(),
  89. f = APP.LoginUser.userid,
  90. t = new List<int>()
  91. };
  92. return JsonConvert.SerializeObject(msg);
  93. }
  94. /// <summary>
  95. /// 结束抢答
  96. /// </summary>
  97. /// <returns></returns>
  98. public static string RushToAnswerEndMsg()
  99. {
  100. SocketModel msg = new SocketModel
  101. {
  102. c = 1022,
  103. rid = APP.ClassroomAdd,
  104. d = "pc",
  105. u = 1,
  106. s = 1,
  107. b = new BodyModel(),
  108. f = APP.LoginUser.userid,
  109. t = new List<int>()
  110. };
  111. return JsonConvert.SerializeObject(msg);
  112. }
  113. /// <summary>
  114. /// 随机点名
  115. /// </summary>
  116. /// <returns></returns>
  117. public static string RandomRollCallMsg(int userid)
  118. {
  119. SocketModel msg = new SocketModel
  120. {
  121. c = 1031,
  122. rid = APP.ClassroomAdd,
  123. d = "pc",
  124. u = 1,
  125. s = 1,
  126. b = new BodyModel(),
  127. f = APP.LoginUser.userid,
  128. t = new List<int>(),
  129. };
  130. msg.t.Add(userid);
  131. return JsonConvert.SerializeObject(msg);
  132. }
  133. /// <summary>
  134. /// 随机点名结束
  135. /// </summary>
  136. /// <returns></returns>
  137. public static string RandomRollCallEndMsg()
  138. {
  139. SocketModel msg = new SocketModel
  140. {
  141. c = 1032,
  142. rid = APP.ClassroomAdd,
  143. d = "pc",
  144. u = 1,
  145. s = 1,
  146. b = new BodyModel(),
  147. f = APP.LoginUser.userid,
  148. t = new List<int>(),
  149. };
  150. return JsonConvert.SerializeObject(msg);
  151. }
  152. /// <summary>
  153. /// 获取消息
  154. /// </summary>
  155. /// <returns></returns>
  156. public static string AddMsg()
  157. {
  158. SocketModel msg = new SocketModel
  159. {
  160. c = 1040,
  161. rid = APP.ClassroomAdd,
  162. d = "pc",
  163. u = 1,
  164. s = 1,
  165. b = new BodyModel(),
  166. f = APP.LoginUser.userid,
  167. t = new List<int>(),
  168. };
  169. return JsonConvert.SerializeObject(msg);
  170. }
  171. }
  172. }