GetSettingsMessage.cs 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. /********************************************************************************
  5. ** Company: YC
  6. ** auth: CaoTing
  7. ** date: 2021\5
  8. ** desc: 获取设置
  9. *******************************************************************************/
  10. namespace Studio.Scripts.HttpMessage
  11. {
  12. public class GetSettingsMessage : BaseHttpMessage
  13. {
  14. public GetSettingsBody body;
  15. public string token
  16. {
  17. set
  18. {
  19. headers["token"] = value;
  20. }
  21. }
  22. public override string path
  23. {
  24. get
  25. {
  26. _path = GetHttpGetForm<GetSettingsBody>(_path, body);
  27. return _path;
  28. }
  29. }
  30. public GetSettingsMessage()
  31. {
  32. messageModuleType = MessageModuleType.Set;
  33. methodType = HttpMethodType.Get;
  34. _path = "v1/getSettings";
  35. headers = new Dictionary<string, string>();
  36. headers.Add("Content-Type", "application/json");
  37. headers.Add("token", "");
  38. _wwwForm = null;
  39. }
  40. public override WWWForm wwwForm
  41. {
  42. get
  43. {
  44. if (_wwwForm == null)
  45. {
  46. _wwwForm = GetWWWFrom<GetSettingsBody>(body);
  47. }
  48. return _wwwForm;
  49. }
  50. }
  51. public override string ToBodyString()
  52. {
  53. return Newtonsoft.Json.JsonConvert.SerializeObject(body);
  54. }
  55. }
  56. public struct GetSettingsBody
  57. {
  58. /// <summary>
  59. /// 房间id
  60. /// </summary>
  61. // public int roomID;
  62. }
  63. }