SearchArtListMessage.cs 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. /********************************************************************************
  5. ** Company: YC
  6. ** auth: PeiTengFei
  7. ** date: 2021\7\5
  8. ** desc: 搜索资源列表
  9. *******************************************************************************/
  10. namespace Studio.Scripts.HttpMessage
  11. {
  12. public class SearchArtListMessage : BaseHttpMessage
  13. {
  14. public SearchAirBody body;
  15. public string token
  16. {
  17. set
  18. {
  19. headers["token"] = value;
  20. }
  21. }
  22. public SearchArtListMessage()
  23. {
  24. messageModuleType = MessageModuleType.Room;
  25. methodType = HttpMethodType.Post;
  26. _path = "v1/searchArtRole";
  27. headers = new Dictionary<string, string>();
  28. headers.Add("Content-Type", "application/json");
  29. headers.Add("token", "");
  30. _wwwForm = null;
  31. }
  32. public override WWWForm wwwForm
  33. {
  34. get
  35. {
  36. if (_wwwForm == null)
  37. {
  38. _wwwForm = GetWWWFrom<SearchAirBody>(body);
  39. }
  40. return _wwwForm;
  41. }
  42. }
  43. public override string ToBodyString()
  44. {
  45. return Newtonsoft.Json.JsonConvert.SerializeObject(body);
  46. }
  47. public struct SearchAirBody
  48. {
  49. /// <summary>
  50. /// 资源类型
  51. /// </summary>
  52. public int artType;
  53. /// <summary>
  54. /// 搜索关键字
  55. /// </summary>
  56. public string keywords;
  57. /// <summary>
  58. /// 文件类型
  59. /// </summary>
  60. public int fileType;
  61. }
  62. }
  63. }