Authored by zhangxiaoru

guang star

@@ -10,8 +10,6 @@ const resourcesProcess = require(`${utils}/resources-process`); @@ -10,8 +10,6 @@ const resourcesProcess = require(`${utils}/resources-process`);
10 const logger = global.yoho.logger; 10 const logger = global.yoho.logger;
11 const helpers = global.yoho.helpers; 11 const helpers = global.yoho.helpers;
12 const _ = require('lodash'); 12 const _ = require('lodash');
13 -const serviceAPI = global.yoho.ServiceAPI;  
14 -const api = global.yoho.API;  
15 13
16 const contentCode = contentCodeConfig.guang; 14 const contentCode = contentCodeConfig.guang;
17 15
@@ -26,9 +24,13 @@ module.exports = class extends global.yoho.BaseModel { @@ -26,9 +24,13 @@ module.exports = class extends global.yoho.BaseModel {
26 * @return {[array]} 24 * @return {[array]}
27 */ 25 */
28 _getResources(page) { 26 _getResources(page) {
29 - return serviceAPI.get('operations/api/v5/resource/get', {  
30 - content_code: contentCode[page],  
31 - platform: 'iphone' 27 + return this.get({
  28 + url: 'operations/api/v5/resource/get',
  29 + data: {
  30 + content_code: contentCode[page],
  31 + platform: 'iphone'
  32 + },
  33 + api: global.yoho.ServiceAPI
32 }, { 34 }, {
33 cache: true 35 cache: true
34 }).then((result) => { 36 }).then((result) => {
@@ -165,9 +167,12 @@ module.exports = class extends global.yoho.BaseModel { @@ -165,9 +167,12 @@ module.exports = class extends global.yoho.BaseModel {
165 * 星潮首页 167 * 星潮首页
166 */ 168 */
167 getIndexData() { 169 getIndexData() {
168 - return api.get('', {  
169 - method: 'app.starClass.index',  
170 - code: '8adc27fcf5676f356602889afcfd2a8e' 170 + return this.get({
  171 + data: {
  172 + method: 'app.starClass.index',
  173 + code: '8adc27fcf5676f356602889afcfd2a8e'
  174 + },
  175 + api: global.yoho.API
171 }, { 176 }, {
172 cache: true 177 cache: true
173 }).then((result) => { 178 }).then((result) => {
@@ -184,12 +189,15 @@ module.exports = class extends global.yoho.BaseModel { @@ -184,12 +189,15 @@ module.exports = class extends global.yoho.BaseModel {
184 * 明星专题 189 * 明星专题
185 */ 190 */
186 getDetailData(params, uid) { 191 getDetailData(params, uid) {
187 - return api.get('', {  
188 - method: 'app.starClass.lastTagArticle',  
189 - tag: params.tag,  
190 - page: params.page || 1,  
191 - size: 10,  
192 - uid: uid 192 + return this.get({
  193 + data: {
  194 + method: 'app.starClass.lastTagArticle',
  195 + tag: params.tag,
  196 + page: params.page || 1,
  197 + size: 10,
  198 + uid: uid
  199 + },
  200 + api: global.yoho.API
193 }, { 201 }, {
194 cache: true 202 cache: true
195 }).then((result) => { 203 }).then((result) => {
@@ -237,10 +245,14 @@ module.exports = class extends global.yoho.BaseModel { @@ -237,10 +245,14 @@ module.exports = class extends global.yoho.BaseModel {
237 * 星搭配 245 * 星搭配
238 */ 246 */
239 getCollocationListData(params, uid) { 247 getCollocationListData(params, uid) {
240 - return serviceAPI.get('guang/api/v5/article/getStarClassroomArticleList', Object.assign({  
241 - limit: '20',  
242 - uid: uid  
243 - }, params), { 248 + return this.get({
  249 + url: 'guang/api/v5/article/getStarClassroomArticleList',
  250 + data: Object.assign({
  251 + limit: '20',
  252 + uid: uid
  253 + }, params),
  254 + api: global.yoho.ServiceAPI
  255 + }, {
244 cache: true 256 cache: true
245 }).then((result) => { 257 }).then((result) => {
246 if (result && result.code === 200) { 258 if (result && result.code === 200) {
@@ -260,11 +272,14 @@ module.exports = class extends global.yoho.BaseModel { @@ -260,11 +272,14 @@ module.exports = class extends global.yoho.BaseModel {
260 }); 272 });
261 } 273 }
262 274
263 - return api.get('', {  
264 - method: params.type === 'del' ? 'app.sns.cancelFavorBackCount' : 'app.sns.setFavorBackCount',  
265 - client_type: 'h5',  
266 - article_id: params.articleId,  
267 - uid: uid 275 + return this.get({
  276 + data: {
  277 + method: params.type === 'del' ? 'app.sns.cancelFavorBackCount' : 'app.sns.setFavorBackCount',
  278 + client_type: 'h5',
  279 + article_id: params.articleId,
  280 + uid: uid
  281 + },
  282 + api: global.yoho.API
268 }); 283 });
269 } 284 }
270 }; 285 };