UpdateRoomMessage.cs 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. namespace Studio.Scripts.HttpMessage
  5. {
  6. public class UpdateRoomMessage : BaseHttpMessage
  7. {
  8. public UpdateRoomBody body;
  9. public string token
  10. {
  11. set
  12. {
  13. headers["token"] = value;
  14. }
  15. }
  16. public UpdateRoomMessage()
  17. {
  18. messageModuleType = MessageModuleType.Room;
  19. methodType = HttpMethodType.Post;
  20. _path = "v1/updateRoom";
  21. headers = new Dictionary<string, string>();
  22. headers.Add("Content-Type", "application/json");
  23. headers.Add("token", "");
  24. _wwwForm = null;
  25. }
  26. public override WWWForm wwwForm
  27. {
  28. get
  29. {
  30. if (_wwwForm == null)
  31. {
  32. _wwwForm = GetWWWFrom<UpdateRoomBody>(body);
  33. }
  34. return _wwwForm;
  35. }
  36. }
  37. public override string ToBodyString()
  38. {
  39. return Newtonsoft.Json.JsonConvert.SerializeObject(body);
  40. }
  41. }
  42. public struct UpdateRoomBody
  43. {
  44. /// <summary>
  45. /// 房间ID
  46. /// </summary>
  47. public int roomID;
  48. /// <summary>
  49. /// 房间类型 1 是个人房间 2是公共房间
  50. /// </summary>
  51. public int type;
  52. /// <summary>
  53. /// 房间名称
  54. /// </summary>
  55. public string roomName;
  56. /// <summary>
  57. /// 房间信息说明
  58. /// </summary>
  59. public string roomExplain;
  60. /// <summary>
  61. /// 房间密码
  62. /// </summary>
  63. public string roomPassword;
  64. /// <summary>
  65. /// 人数上限
  66. /// </summary>
  67. public int maxMember;
  68. /// <summary>
  69. /// 公开房间类型 1 是只能浏览 2是 全功能
  70. /// </summary>
  71. public int roomType;
  72. }
  73. }