WebRequest_Structure.cs 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312
  1. using UnityEngine;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System;
  5. namespace EZXR.Glass.Network.WebRequest
  6. {
  7. public partial class UnityWebRequest :MonoBehaviour
  8. {
  9. [Serializable]
  10. /// <summary>
  11. /// 请求数据用的基础请求类
  12. /// </summary>
  13. public class ReqBase
  14. {
  15. /// <summary>
  16. /// 用户登陆后的标识,登录接口本字段可为空
  17. /// </summary>
  18. public string token;
  19. /// <summary>
  20. /// 请求包签名,防止重放攻击,生成规则为md5(secret+|+t),其中secret是用户成功登录后返回的,t是请求url中携带的时间戳。
  21. /// </summary>
  22. public string signature;
  23. /// <summary>
  24. /// 客户端当前版本号,格式x.x.x
  25. /// </summary>
  26. public string versionno;
  27. /// <summary>
  28. /// 版本协议号,格式x.x,默认为1.0
  29. /// </summary>
  30. public string protocolno;
  31. /// <summary>
  32. /// 网络接入点名称,如uninet,cmnet,uniw
  33. /// </summary>
  34. public string apn;
  35. public string environment;
  36. public string bizid;
  37. public ReqBase()
  38. {
  39. token = "";
  40. signature = "";
  41. versionno = "1.0.0";
  42. protocolno = "1.0";
  43. apn = "uniw";
  44. environment = "kr1r4ndd";
  45. bizid = "mhlaqph8";
  46. }
  47. public ReqBase(string _token, string _signature, string _versionno, string _protocolno, string _apn, string _environment, string _bizid)
  48. {
  49. token = _token;
  50. signature = _signature;
  51. versionno = _versionno;
  52. protocolno = _protocolno;
  53. apn = _apn;
  54. environment = _environment;
  55. bizid = _bizid;
  56. }
  57. }
  58. [Serializable]
  59. public class RespBase
  60. {
  61. /// <summary>
  62. /// 返回状态码
  63. /// </summary>
  64. public string code;
  65. /// <summary>
  66. /// 服务器返回描述
  67. /// </summary>
  68. public string desc;
  69. }
  70. #region GetProductCategories,获得产品分类列表
  71. #region GetProductCategories_Request
  72. [Serializable]
  73. public class GetProductCategories_Request_Root
  74. {
  75. public ReqBase reqbase = new ReqBase();
  76. }
  77. #endregion
  78. #region GetProductCategories_Response
  79. [Serializable]
  80. public class GetProductCategories_RespparamItem:IComparable
  81. {
  82. /// <summary>
  83. /// 决定此Item在列表中的显示位置
  84. /// </summary>
  85. public int cid;
  86. /// <summary>
  87. /// 分类名称
  88. /// </summary>
  89. public string name;
  90. /// <summary>
  91. /// 分类图标路径
  92. /// </summary>
  93. public string pic;
  94. public int CompareTo(object obj)
  95. {
  96. int result;
  97. try
  98. {
  99. GetProductCategories_RespparamItem gpcri = obj as GetProductCategories_RespparamItem;
  100. if (this.cid > gpcri.cid)
  101. {
  102. result = 1;
  103. }
  104. else if (this.cid < gpcri.cid)
  105. {
  106. result = -1;
  107. }
  108. else
  109. {
  110. result = 0;
  111. }
  112. return result;
  113. }
  114. catch (Exception ex)
  115. {
  116. throw new Exception(ex.Message);
  117. }
  118. }
  119. }
  120. [Serializable]
  121. public class GetProductCategories_Response_Root
  122. {
  123. public RespBase respbase = new RespBase();
  124. public List <GetProductCategories_RespparamItem > respparam = new List<GetProductCategories_RespparamItem>();
  125. }
  126. #endregion
  127. #endregion
  128. #region GetProductList,获得具体分类下的产品列表
  129. #region GetProductList_Request
  130. [Serializable]
  131. public class GetProductList_Request_Root
  132. {
  133. public ReqBase reqbase = new ReqBase();
  134. public int reqparam;
  135. }
  136. #endregion
  137. #region GetProductList_Response
  138. /// <summary>
  139. /// 产品模型信息
  140. /// </summary>
  141. [Serializable]
  142. public class GetProductList_JZModel
  143. {
  144. public int mid;
  145. public string name;
  146. public string url;
  147. /// <summary>
  148. /// 算法类型,如果类型是模型,则本字段不为空 1.SLAM 2.3DLM
  149. /// </summary>
  150. public string algotype;
  151. /// <summary>
  152. /// 模型大小
  153. /// </summary>
  154. public int size;
  155. }
  156. /// <summary>
  157. /// 产品纹理信息
  158. /// </summary>
  159. [Serializable]
  160. public class GetProductList_JZTexture
  161. {
  162. /// <summary>
  163. /// 贴图的tid
  164. /// </summary>
  165. public int tid;
  166. /// <summary>
  167. /// 更改颜色列表中显示的小图icon
  168. /// </summary>
  169. public string pic;
  170. /// <summary>
  171. /// 模型真正用到的贴图
  172. /// </summary>
  173. public string chartlet;
  174. /// <summary>
  175. /// 纹理名称
  176. /// </summary>
  177. public string name;
  178. }
  179. /// <summary>
  180. /// 这个产品属于哪个分类
  181. /// </summary>
  182. [Serializable]
  183. public class Category
  184. {
  185. /// <summary>
  186. ///
  187. /// </summary>
  188. public int cid;
  189. /// <summary>
  190. /// 其他
  191. /// </summary>
  192. public string name;
  193. }
  194. /// <summary>
  195. /// 单个产品信息
  196. /// </summary>
  197. [Serializable]
  198. public class GetProductList_RespparamItem:IComparable
  199. {
  200. public Category category = new Category();
  201. /// <summary>
  202. /// 产品id
  203. /// </summary>
  204. public int pid;
  205. /// <summary>
  206. /// 产品名称
  207. /// </summary>
  208. public string name;
  209. /// <summary>
  210. /// 产品的图标地址
  211. /// </summary>
  212. public List<string> piclist = new List<string>();
  213. /// <summary>
  214. /// 产品的长宽高
  215. /// </summary>
  216. public string dimension;
  217. /// <summary>
  218. /// 产品价格
  219. /// </summary>
  220. public int price;
  221. public GetProductList_JZModel model;
  222. public UnityEngine.Object obj;
  223. /// <summary>
  224. /// 产品拥有的纹理信息
  225. /// </summary>
  226. public List<GetProductList_JZTexture> textures = new List<GetProductList_JZTexture>();
  227. /// <summary>
  228. /// 是否被收藏了
  229. /// </summary>
  230. public bool collected;
  231. public int CompareTo(object obj)
  232. {
  233. int result;
  234. try
  235. {
  236. GetProductList_RespparamItem gplri = obj as GetProductList_RespparamItem;
  237. if (this.pid > gplri.pid)
  238. {
  239. result = 1;
  240. }
  241. else if (this.pid < gplri.pid)
  242. {
  243. result = -1;
  244. }
  245. else
  246. {
  247. result = 0;
  248. }
  249. return result;
  250. }
  251. catch (Exception ex)
  252. {
  253. throw new Exception(ex.Message);
  254. }
  255. }
  256. }
  257. [Serializable]
  258. public class GetProductList_Response_Root
  259. {
  260. public RespBase respbase = new RespBase();
  261. public List <GetProductList_RespparamItem > respparam = new List<GetProductList_RespparamItem>();
  262. }
  263. #endregion
  264. #endregion
  265. #region ProductCollect,产品收藏
  266. #region ProductCollect_Request
  267. [Serializable]
  268. public class ProductCollect_Reqparam
  269. {
  270. public int pid;
  271. public bool collect;
  272. public ProductCollect_Reqparam()
  273. {
  274. }
  275. public ProductCollect_Reqparam(int pid, bool collect)
  276. {
  277. this.pid = pid;
  278. this.collect = collect;
  279. }
  280. }
  281. [Serializable]
  282. public class ProductCollect_Request_Root
  283. {
  284. public ReqBase reqbase = new ReqBase();
  285. public ProductCollect_Reqparam reqparam = new ProductCollect_Reqparam();
  286. }
  287. #endregion
  288. #endregion
  289. }
  290. }