GetArtDetailMessage.cs 1.6 KB

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