Config.java 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. package com.hc.request;
  2. import com.hc.model.BuildConfig;
  3. /**
  4. * 浩传请求配置
  5. */
  6. public final class Config {
  7. /**
  8. * 正确返回
  9. */
  10. public static final String RESPONSE_SUCCESS = "200";
  11. /**
  12. * 一般错误返回
  13. */
  14. public static final String RESPONSE_ERROR = "-1";
  15. /**
  16. * 未登陆
  17. */
  18. public static final String RESPONSE_NO_LOGIN = "-2";
  19. /**
  20. * 没有数据
  21. */
  22. public static final String RESPONSE_NO_DATA = "-3";
  23. /**
  24. * 浩传数据请求接口
  25. */
  26. public static class URL {
  27. private static final String BASE = BuildConfig.Domain + BuildConfig.port ;
  28. /**
  29. * 查询素材是否已经收藏
  30. */
  31. public static final String IS_COLLECT = BASE + "/index.php?m=Home&c=DuduApi&a=isCollect";
  32. /**
  33. * 添加观看历史,我的收藏
  34. */
  35. public static final String COLLECT = BASE + "/index.php?m=Home&c=DuduApi&a=upWatchCollectLog";
  36. /**
  37. * 删除观看历史,我的收藏
  38. */
  39. public static final String COLLECT_CANCEL = BASE + "/index.php?m=Home&c=DuduApi&a=delWatchCollectLog";
  40. /**
  41. * 新安装用户收集
  42. */
  43. public static final String COLLECT_NEW_USE = BASE + "/index.php?m=Home&c=TvApi&a=downloadMac";
  44. /**
  45. * 播放时长收集
  46. */
  47. public static final String COLLECT_PLAY_TIME = BASE + "/index.php?m=Home&c=TvApi&a=upWatchCollectLog&type=1";
  48. /**
  49. * 更新订购结果
  50. */
  51. public static final String UPDATE_ORDER = BASE + "/index.php?m=Home&c=Order&a=saveOrderResult";
  52. }
  53. /**
  54. * 数据请求入参
  55. */
  56. public static class PARAMS {
  57. /**
  58. * 用户ID
  59. */
  60. public static final String UID = "uid";
  61. /**
  62. * 素材ID
  63. */
  64. public static final String SOURCE_ID = "source_id";
  65. /**
  66. * 类型。<p>
  67. * 请求为{@link URL#COLLECT}时,对应值为{@link VALUES#COLLECT_TYPE_COLLECTION}和{@link VALUES#COLLECT_TYPE_HISTORY}
  68. */
  69. public static final String TYPE = "type";
  70. /**
  71. * mac地址
  72. */
  73. public static final String MAC = "mac_address";
  74. /**
  75. * 播放时长
  76. */
  77. public static final String PLAY_TIME = "play_time";
  78. }
  79. /**
  80. * 数据请求参数值
  81. */
  82. public static class VALUES {
  83. /**
  84. * 观看历史
  85. */
  86. public static final String COLLECT_TYPE_HISTORY = "1";
  87. /**
  88. * 我的收藏
  89. */
  90. public static final String COLLECT_TYPE_COLLECTION = "2";
  91. }
  92. /**
  93. * 请求类型
  94. */
  95. public static class WHAT {
  96. /**
  97. * 查询素材是否已经收藏
  98. */
  99. public static final int IS_COLLECT = 1;
  100. /**
  101. * 添加观看历史,我的收藏
  102. */
  103. public static final int COLLECT = 2;
  104. /**
  105. * 取消收藏
  106. */
  107. public static final int COLLECT_CANCEL = 3;
  108. /**
  109. * 更新订购
  110. */
  111. public static final int UPDATE_ORDER = 4;
  112. }
  113. public static class RESPONSE {
  114. public static final String CODE_COLLECT_SUCCESS = "0";
  115. public static final String CODE_NO_COLLECT = "1";
  116. public static final String CODE_HAD_COLLECT = "2";
  117. }
  118. }