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.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
6 changed files
with
183 additions
and
71 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 |
---|---|---|
|
@@ -253,6 +253,19 @@ export function rewardPost(postId, data) { | |
return api.post(url, data, { validateStatus: s => s === 201 }); | ||
} | ||
|
||
/** | ||
* 获取帖子详情 | ||
* @author mutoe <[email protected]> | ||
* @export | ||
* @param {number} groupId | ||
* @param {number} postId | ||
* @returns | ||
*/ | ||
export function getGroupPost(groupId, postId) { | ||
const url = `/plus-group/groups/${groupId}/posts/${postId}`; | ||
return api.get(url, { validateStatus: s => s === 200 }); | ||
} | ||
|
||
/** | ||
* 创建帖子 | ||
* @author mutoe <[email protected]> | ||
|
@@ -472,6 +485,20 @@ export function changePermissions(groupId, params) { | |
return api.patch(url, params, { validateStatus: s => s === 204 }); | ||
} | ||
|
||
/** | ||
* 管理员置顶帖子 | ||
* @author mutoe <[email protected]> | ||
* @export | ||
* @param {number} postId | ||
* @param {Object} params | ||
* @param {number} params.day | ||
* @returns | ||
*/ | ||
export function pinnedPost(postId, params) { | ||
const url = `/plus-group/pinned/posts/${postId}/create`; | ||
return api.post(url, params, { validateStatus: s => s === 201 }); | ||
} | ||
|
||
/** | ||
* 管理员取消置顶帖子 | ||
* @author mutoe <[email protected]> | ||
|
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
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
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 |
---|---|---|
|
@@ -174,5 +174,16 @@ export default { | |
const { postId } = payload; | ||
const { data } = await api.unpinnedPost(postId); | ||
return data; | ||
}, | ||
|
||
/** | ||
* 获取帖子详情 | ||
* @author mutoe <[email protected]> | ||
* @returns | ||
*/ | ||
async getPostDetail(store, payload) { | ||
const { postId, groupId } = payload; | ||
const { data } = await api.getGroupPost(groupId, postId); | ||
return data; | ||
} | ||
}; |