RoomListMessage.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. namespace Studio.Scripts.HttpMessage
  5. {
  6. public class RoomListMessage : BaseHttpMessage
  7. {
  8. public RoomListBody body;
  9. public string token
  10. {
  11. set
  12. {
  13. headers["token"] = value;
  14. }
  15. }
  16. public RoomListMessage()
  17. {
  18. messageModuleType = MessageModuleType.Room;
  19. methodType = HttpMethodType.Post;
  20. _path = "v1/roomList";
  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<RoomListBody>(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 RoomListBody
  43. {
  44. }
  45. }