Authored by 郝肖肖

'live-ctx'

@@ -72,9 +72,14 @@ module.exports = class extends global.yoho.BaseModel { @@ -72,9 +72,14 @@ module.exports = class extends global.yoho.BaseModel {
72 72
73 // 获取精选视频 73 // 获取精选视频
74 _getBestList() { 74 _getBestList() {
75 - return liveAPI.get('v1/living/best', {}, { 75 + return this.get({
  76 + api: liveAPI,
  77 + url: 'v1/living/best',
  78 + data: {},
  79 + param: {
76 code: 200, 80 code: 200,
77 cache: false 81 cache: false
  82 + }
78 }).then(result => { 83 }).then(result => {
79 let list = result && result.data || []; 84 let list = result && result.data || [];
80 85
@@ -107,9 +112,14 @@ module.exports = class extends global.yoho.BaseModel { @@ -107,9 +112,14 @@ module.exports = class extends global.yoho.BaseModel {
107 112
108 // 获取直播中所有视频 113 // 获取直播中所有视频
109 _getLivingList() { 114 _getLivingList() {
110 - return liveAPI.get('v1/living/listing', {}, { 115 + return this.get({
  116 + api: liveAPI,
  117 + url: 'v1/living/listing',
  118 + data: {},
  119 + param: {
111 code: 200, 120 code: 200,
112 cache: false 121 cache: false
  122 + }
113 }).then(result => { 123 }).then(result => {
114 return result && result.data || []; 124 return result && result.data || [];
115 }); 125 });
@@ -117,9 +127,14 @@ module.exports = class extends global.yoho.BaseModel { @@ -117,9 +127,14 @@ module.exports = class extends global.yoho.BaseModel {
117 127
118 // 获取直播预告列表 128 // 获取直播预告列表
119 _getPrelivingList() { 129 _getPrelivingList() {
120 - return liveAPI.get('v1/living/starting', {}, { 130 + return this.get({
  131 + api: liveAPI,
  132 + url: 'v1/living/starting',
  133 + data: {},
  134 + param: {
121 code: 200, 135 code: 200,
122 cache: false 136 cache: false
  137 + }
123 }).then(result => { 138 }).then(result => {
124 let list = result && result.data || []; 139 let list = result && result.data || [];
125 140
@@ -132,9 +147,14 @@ module.exports = class extends global.yoho.BaseModel { @@ -132,9 +147,14 @@ module.exports = class extends global.yoho.BaseModel {
132 147
133 // 获取回看列表 148 // 获取回看列表
134 _getRecordList() { 149 _getRecordList() {
135 - return liveAPI.get('v1/living/replaying', {}, { 150 + return this.get({
  151 + api: liveAPI,
  152 + url: 'v1/living/replaying',
  153 + data: {},
  154 + param: {
136 code: 200, 155 code: 200,
137 cache: false 156 cache: false
  157 + }
138 }).then(result => { 158 }).then(result => {
139 return result && result.data || []; 159 return result && result.data || [];
140 }); 160 });
@@ -153,12 +173,16 @@ module.exports = class extends global.yoho.BaseModel { @@ -153,12 +173,16 @@ module.exports = class extends global.yoho.BaseModel {
153 173
154 // 获取 回放视屏 信息 174 // 获取 回放视屏 信息
155 fetchReplayInfo(videoID) { 175 fetchReplayInfo(videoID) {
156 - let url = 'v1/living/detail';  
157 let data = { video_id: videoID }; 176 let data = { video_id: videoID };
158 - let options = { cache: true };  
159 177
160 - return liveAPI.get(url, data, options)  
161 - .then(result => { 178 + return this.get({
  179 + api: liveAPI,
  180 + url: 'v1/living/detail',
  181 + data: data,
  182 + param: {
  183 + cache: true
  184 + }
  185 + }).then(result => {
162 if (result && result.data) { 186 if (result && result.data) {
163 let d = result.data; 187 let d = result.data;
164 188
@@ -182,10 +206,13 @@ module.exports = class extends global.yoho.BaseModel { @@ -182,10 +206,13 @@ module.exports = class extends global.yoho.BaseModel {
182 206
183 // 获取 直播视屏 信息 207 // 获取 直播视屏 信息
184 fetchLiveInfo(roomID) { 208 fetchLiveInfo(roomID) {
185 - let url = 'v1/living/detail';  
186 let data = { room_id: roomID }; 209 let data = { room_id: roomID };
187 210
188 - return liveAPI.get(url, data).then(result => { 211 + return this.get({
  212 + api: liveAPI,
  213 + url: 'v1/living/detail',
  214 + data: data
  215 + }).then(result => {
189 if (result && result.data) { 216 if (result && result.data) {
190 let d = result.data; 217 let d = result.data;
191 218
@@ -216,18 +243,27 @@ module.exports = class extends global.yoho.BaseModel { @@ -216,18 +243,27 @@ module.exports = class extends global.yoho.BaseModel {
216 243
217 // 获取 直播 弹幕 host 244 // 获取 直播 弹幕 host
218 getBarrageHost(type) { 245 getBarrageHost(type) {
219 - return liveAPI.get('v1/system/gethosts', { type }); 246 + return this.get({
  247 + api: liveAPI,
  248 + url: 'v1/system/gethosts',
  249 + data: { type }
  250 + });
220 } 251 }
221 252
222 getReplyBarrage(videoID, startTime, timeInterval) { 253 getReplyBarrage(videoID, startTime, timeInterval) {
223 - const url = 'v1/living/getreplaybarrage';  
224 const data = { 254 const data = {
225 startTime, 255 startTime,
226 timeInterval, 256 timeInterval,
227 video_id: videoID 257 video_id: videoID
228 }; 258 };
229 - const options = { cache: true };  
230 259
231 - return liveAPI.get(url, data, options); 260 + return this.get({
  261 + api: liveAPI,
  262 + url: 'v1/living/getreplaybarrage',
  263 + data: data,
  264 + param: {
  265 + cache: true
  266 + }
  267 + });
232 } 268 }
233 }; 269 };