UpdateSettingsMessage.cs 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. /********************************************************************************
  5. ** Company: YC
  6. ** auth: CaoTing
  7. ** date: 2021\5\21
  8. ** desc: 更新设置
  9. *******************************************************************************/
  10. namespace Studio.Scripts.HttpMessage
  11. {
  12. public class UpdateSettingsMessage : BaseHttpMessage
  13. {
  14. public UpdateSettingsBody body;
  15. public string token
  16. {
  17. set
  18. {
  19. headers["token"] = value;
  20. }
  21. }
  22. public UpdateSettingsMessage()
  23. {
  24. messageModuleType = MessageModuleType.Set;
  25. methodType = HttpMethodType.Post;
  26. _path = "v1/updateSettings";
  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<UpdateSettingsBody>(body);
  39. }
  40. return _wwwForm;
  41. }
  42. }
  43. public override string ToBodyString()
  44. {
  45. return Newtonsoft.Json.JsonConvert.SerializeObject(body);
  46. }
  47. }
  48. public struct UpdateSettingsBody
  49. {
  50. /// <summary>
  51. /// 摄像头开关
  52. /// </summary>
  53. public bool camera;
  54. /// <summary>
  55. /// 麦克风开关
  56. /// </summary>
  57. public bool mic;
  58. /// <summary>
  59. /// 分辨率: 1.高分辨率1280*960 2.中分辨率640*480 3.低分辨率320*240
  60. /// </summary>
  61. public int ratio;
  62. /// <summary>
  63. /// 帧率: 1.15FPS 2.30FPS 3.60FPS
  64. /// </summary>
  65. public int fps;
  66. /// <summary>
  67. /// 管理设置
  68. /// </summary>
  69. public int fmss;
  70. }
  71. }