Authored by zhangxiaoru

guang param

... ... @@ -4,7 +4,6 @@
* @date: 2016/09/07
*/
'use strict';
const api = global.yoho.API;
module.exports = class extends global.yoho.BaseModel {
... ... @@ -33,6 +32,9 @@ module.exports = class extends global.yoho.BaseModel {
param.fav_id = id;
param.method = 'app.favorite.cancel';
}
return api.post('', param);
return this.post({
data: param,
api: global.yoho.API
});
}
};
... ...
... ... @@ -4,8 +4,6 @@
* @date: 2016/09/07
*/
'use strict';
const serviceAPI = global.yoho.ServiceAPI;
const api = global.yoho.API;
module.exports = class extends global.yoho.BaseModel {
constructor(ctx) {
... ... @@ -26,9 +24,17 @@ module.exports = class extends global.yoho.BaseModel {
};
if (opt === 'cancel') {
return serviceAPI.get('guang/api/v2/praise/cancel', param);
return this.get({
url: 'guang/api/v2/praise/cancel',
data: param,
api: global.yoho.ServiceAPI
});
} else {
return serviceAPI.get('guang/api/v2/praise/setPraise', param);
return this.get({
url: 'guang/api/v2/praise/setPraise',
data: param,
api: global.yoho.ServiceAPI
});
}
}
... ... @@ -46,9 +52,17 @@ module.exports = class extends global.yoho.BaseModel {
};
if (opt === 'cancel') {
return serviceAPI.get('guang/api/v1/favorite/cancelFavorite', param);
return this.get({
url: 'guang/api/v1/favorite/cancelFavorite',
data: param,
api: global.yoho.ServiceAPI
});
} else {
return serviceAPI.get('guang/api/v1/favorite/setFavorite', param);
return this.get({
url: 'guang/api/v1/favorite/setFavorite',
data: param,
api: global.yoho.ServiceAPI
});
}
}
... ... @@ -73,9 +87,17 @@ module.exports = class extends global.yoho.BaseModel {
if (opt === 'ok') {
return api.get('app.favorite.add', param);
return this.get({
url: 'app.favorite.add',
data: param,
api: global.yoho.API
});
} else {
return api.get('app.favorite.cancel', param);
return this.get({
url: 'app.favorite.cancel',
data: param,
api: global.yoho.API
});
}
}
};
... ...
... ... @@ -66,8 +66,9 @@ module.exports = class extends global.yoho.BaseModel {
return this.get({
url: 'guang/api/v3/plustar/getlist',
data: param,
api: global.yoho.ServiceAPI
}, {cache: true}).then((result) => {
api: global.yoho.ServiceAPI,
param: {cache: true}
}).then((result) => {
if (result && result.code === 200) {
return this.formaData(result.data.data.list[0].data, gender);
} else {
... ... @@ -136,8 +137,9 @@ module.exports = class extends global.yoho.BaseModel {
order: 's_t_desc',
page: 1
},
api: global.yoho.API
}, {cache: true}).then((result) => {
api: global.yoho.API,
param: {cache: true}
}).then((result) => {
if (result && result.code === 200) {
... ... @@ -316,8 +318,9 @@ module.exports = class extends global.yoho.BaseModel {
data: {
id: id
},
api: global.yoho.ServiceAPI
}, {cache: true}).then((result) => {
api: global.yoho.ServiceAPI,
param: {cache: true}
}).then((result) => {
if (result && result.code === 200) {
let list = result.data || [];
let jumpToApp;
... ...
... ... @@ -30,9 +30,10 @@ module.exports = class extends global.yoho.BaseModel {
content_code: contentCode[page],
platform: 'iphone'
},
api: global.yoho.ServiceAPI
}, {
cache: true
api: global.yoho.ServiceAPI,
param: {
cache: true
}
}).then((result) => {
if (result && result.code === 200) {
return resourcesProcess(result.data);
... ... @@ -172,9 +173,10 @@ module.exports = class extends global.yoho.BaseModel {
method: 'app.starClass.index',
code: '8adc27fcf5676f356602889afcfd2a8e'
},
api: global.yoho.API
}, {
cache: true
api: global.yoho.API,
param: {
cache: true
}
}).then((result) => {
if (result && result.code === 200) {
return this._processIndexData(result);
... ... @@ -197,9 +199,10 @@ module.exports = class extends global.yoho.BaseModel {
size: 10,
uid: uid
},
api: global.yoho.API
}, {
cache: true
api: global.yoho.API,
param: {
cache: true
}
}).then((result) => {
if (result && result.code === 200) {
if (params.page > result.data.totalPage) {
... ... @@ -251,9 +254,10 @@ module.exports = class extends global.yoho.BaseModel {
limit: '20',
uid: uid
}, params),
api: global.yoho.ServiceAPI
}, {
cache: true
api: global.yoho.ServiceAPI,
param: {
cache: true
}
}).then((result) => {
if (result && result.code === 200) {
return this._processGuangData(result.data.list.artList);
... ...