GetAvatarListMessage.cs 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. /********************************************************************************
  5. ** Company: YC
  6. ** auth: CaoTing
  7. ** date: 2021\5\19
  8. ** desc: 获取头像列表
  9. *******************************************************************************/
  10. namespace Studio.Scripts.HttpMessage
  11. {
  12. public class GetAvatarListMessage : BaseHttpMessage
  13. {
  14. public AvatarBody 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<AvatarBody>(_path, body);
  27. return _path;
  28. }
  29. }
  30. public GetAvatarListMessage()
  31. {
  32. messageModuleType = MessageModuleType.Login;
  33. methodType = HttpMethodType.Get;
  34. _path = "v1/avatar";
  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<AvatarBody>(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 AvatarBody
  57. {
  58. /// <summary>
  59. /// 登陆设备来源
  60. /// </summary>
  61. //public string source;
  62. }
  63. }