This repository has been archived by the owner on Nov 15, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
154 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -130,3 +130,46 @@ export function deleteNewsComment(newsId, commentId) { | |
validateStatus: s => s === 204 | ||
}); | ||
} | ||
|
||
/** | ||
* 获取资讯打赏列表 | ||
* @author mutoe <[email protected]> | ||
* @export | ||
* @param {number} newsId | ||
* @param {Object} params | ||
* @param {number} [params.limit] | ||
* @param {number} [params.offset] | ||
* @param {string} [params.order] asc 正序 desc 倒序 | ||
* @param {string} [params.order_type] date 按时间 amount 按金额 | ||
* @returns | ||
*/ | ||
export function getNewsRewards(newsId, params) { | ||
const url = `/news/${newsId}/rewards`; | ||
return api.get(url, { params, validateStatus: s => s === 200 }); | ||
} | ||
|
||
/** | ||
* 打赏资讯 | ||
* @author mutoe <[email protected]> | ||
* @export | ||
* @param {number} newsId | ||
* @param {Object} payload | ||
* @param {number} payload.amount 打赏金额 | ||
* @returns | ||
*/ | ||
export function rewardNews(newsId, payload) { | ||
const url = `/news/${newsId}/new-rewards`; | ||
return api.post(url, payload, { validateStatus: s => s === 201 }); | ||
} | ||
|
||
/** | ||
* 获得资讯统计 | ||
* @author mutoe <[email protected]> | ||
* @export | ||
* @param {number} newsId | ||
* @returns | ||
*/ | ||
export function getRewardInfo(newsId) { | ||
const url = `/news/${newsId}/rewards/sum`; | ||
return api.get(url, { validateStatus: s => s === 200 }); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters