ModifyRoleMessage.cs 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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 ModifyRoleMessage : BaseHttpMessage
  13. {
  14. public ModifyRoleBody 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<ModifyRoleBody>(_path, body);
  27. return _path;
  28. }
  29. }
  30. public ModifyRoleMessage()
  31. {
  32. messageModuleType = MessageModuleType.Set;
  33. methodType = HttpMethodType.Post;
  34. _path = "v1/modifyRole";
  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<ModifyRoleBody>(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 ModifyRoleBody
  57. {
  58. public string avatar;
  59. public string nickName;
  60. }
  61. }