JXAPIService.h 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. //
  2. // JXAPIService.h
  3. // AICity
  4. //
  5. // Created by TogetherWatch on 2025-10-13.
  6. // Feature: 003-ios-api-https - 剧星短剧平台API接入
  7. //
  8. #import <Foundation/Foundation.h>
  9. #import "JXDrama.h"
  10. #import "JXEpisode.h"
  11. #import "JXCategory.h"
  12. #import "JXInteraction.h"
  13. #import "JXNetworkManager.h"
  14. #import "JXHomeHeaderData.h"
  15. NS_ASSUME_NONNULL_BEGIN
  16. /**
  17. * 剧星平台API服务
  18. */
  19. @interface JXAPIService : NSObject
  20. + (instancetype)sharedService;
  21. // ==================== 首页相关API ====================
  22. /**
  23. * 获取首页头部数据
  24. * 包含:Banner轮播图、热门影片、热门短剧
  25. */
  26. - (void)getHomeHeaderDataWithSuccess:(void (^)(JXHomeHeaderData *headerData))success
  27. failure:(JXFailureBlock)failure;
  28. /**
  29. * 获取今日推荐列表(分页)
  30. */
  31. - (void)getDailyRecommendWithPage:(NSInteger)page
  32. pageSize:(NSInteger)pageSize
  33. success:(JXSuccessBlock)success
  34. failure:(JXFailureBlock)failure;
  35. // ==================== 内容相关API ====================
  36. /**
  37. * 获取分类列表
  38. */
  39. - (void)getCategoriesWithSuccess:(JXSuccessBlock)success
  40. failure:(JXFailureBlock)failure;
  41. /**
  42. * 获取短剧列表
  43. */
  44. - (void)getDramaListWithCategoryId:(nullable NSString *)categoryId
  45. page:(NSInteger)page
  46. pageSize:(NSInteger)pageSize
  47. success:(JXSuccessBlock)success
  48. failure:(JXFailureBlock)failure;
  49. /**
  50. * 获取短剧详情
  51. */
  52. - (void)getDramaDetailWithDramaId:(NSString *)dramaId
  53. success:(JXSuccessBlock)success
  54. failure:(JXFailureBlock)failure;
  55. /**
  56. * 搜索短剧
  57. */
  58. - (void)searchDramasWithKeyword:(NSString *)keyword
  59. page:(NSInteger)page
  60. pageSize:(NSInteger)pageSize
  61. success:(JXSuccessBlock)success
  62. failure:(JXFailureBlock)failure;
  63. /**
  64. * 获取交互数据
  65. */
  66. - (void)getInteractionDataWithDramaId:(NSString *)dramaId
  67. episodeId:(nullable NSString *)episodeId
  68. success:(JXSuccessBlock)success
  69. failure:(JXFailureBlock)failure;
  70. // ==================== 播放相关API ====================
  71. /**
  72. * 获取播放地址
  73. */
  74. - (void)getPlayURLWithEpisodeId:(NSString *)episodeId
  75. success:(JXSuccessBlock)success
  76. failure:(JXFailureBlock)failure;
  77. /**
  78. * 上报播放进度
  79. */
  80. - (void)reportPlaybackProgressWithEpisodeId:(NSString *)episodeId
  81. position:(NSInteger)position
  82. duration:(NSInteger)duration
  83. isCompleted:(BOOL)isCompleted
  84. success:(JXSuccessBlock)success
  85. failure:(JXFailureBlock)failure;
  86. /**
  87. * 获取播放进度
  88. */
  89. - (void)getPlaybackProgressWithEpisodeId:(NSString *)episodeId
  90. success:(JXSuccessBlock)success
  91. failure:(JXFailureBlock)failure;
  92. // ==================== 交互相关API ====================
  93. /**
  94. * 点赞/取消点赞
  95. */
  96. - (void)toggleLikeWithDramaId:(NSString *)dramaId
  97. episodeId:(NSString *)episodeId
  98. success:(JXSuccessBlock)success
  99. failure:(JXFailureBlock)failure;
  100. /**
  101. * 收藏/取消收藏
  102. */
  103. - (void)toggleFavoriteWithDramaId:(NSString *)dramaId
  104. success:(JXSuccessBlock)success
  105. failure:(JXFailureBlock)failure;
  106. /**
  107. * 关注/取消关注
  108. */
  109. - (void)toggleFollowWithDramaId:(NSString *)dramaId
  110. success:(JXSuccessBlock)success
  111. failure:(JXFailureBlock)failure;
  112. // ==================== 评论相关API ====================
  113. /**
  114. * 获取评论列表
  115. * @param dramaId 短剧ID
  116. * @param page 页码(从1开始)
  117. * @param pageSize 每页数量(默认20)
  118. */
  119. - (void)getCommentsWithDramaId:(NSString *)dramaId
  120. page:(NSInteger)page
  121. pageSize:(NSInteger)pageSize
  122. success:(JXSuccessBlock)success
  123. failure:(JXFailureBlock)failure;
  124. /**
  125. * 提交评论
  126. * @param dramaId 短剧ID
  127. * @param content 评论内容(最多500字符)
  128. */
  129. - (void)submitCommentWithDramaId:(NSString *)dramaId
  130. content:(NSString *)content
  131. success:(JXSuccessBlock)success
  132. failure:(JXFailureBlock)failure;
  133. /**
  134. * 点赞评论
  135. * @param commentId 评论ID
  136. */
  137. - (void)likeCommentWithCommentId:(long long)commentId
  138. success:(JXSuccessBlock)success
  139. failure:(JXFailureBlock)failure;
  140. /**
  141. * 回复评论
  142. * @param commentId 评论ID
  143. * @param content 回复内容
  144. */
  145. - (void)replyCommentWithCommentId:(long long)commentId
  146. content:(NSString *)content
  147. success:(JXSuccessBlock)success
  148. failure:(JXFailureBlock)failure;
  149. // ==================== 合集相关API ====================
  150. /**
  151. * 获取剧集合集列表
  152. * @param dramaId 短剧ID
  153. */
  154. - (void)getEpisodesWithDramaId:(NSString *)dramaId
  155. success:(JXSuccessBlock)success
  156. failure:(JXFailureBlock)failure;
  157. /**
  158. * 增加播放次数
  159. * @param dramaId 短剧ID
  160. */
  161. - (void)incrementPlayCountWithDramaId:(NSString *)dramaId
  162. success:(JXSuccessBlock)success
  163. failure:(JXFailureBlock)failure;
  164. @end
  165. NS_ASSUME_NONNULL_END