Initial project
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
import {
|
||||
axios,
|
||||
CaptchaData,
|
||||
Comment,
|
||||
CommentPage,
|
||||
CommentReply,
|
||||
CommentReplyPage,
|
||||
CommentReplyView,
|
||||
CommentView,
|
||||
PageResult
|
||||
} from "~/index";
|
||||
|
||||
const BASE_URI = "/comment";
|
||||
|
||||
async function page(commentPage: CommentPage): Promise<PageResult<CommentView>> {
|
||||
return axios.post(`${BASE_URI}/list`, commentPage);
|
||||
}
|
||||
|
||||
async function create(captchaData: CaptchaData<Comment>): Promise<void> {
|
||||
return axios.post(`${BASE_URI}/create`, captchaData);
|
||||
}
|
||||
|
||||
async function pageReply(commentReplyPage: CommentReplyPage): Promise<PageResult<CommentReplyView>> {
|
||||
return axios.post(`${BASE_URI}/reply/list`, commentReplyPage);
|
||||
}
|
||||
|
||||
async function createReply(captchaData: CaptchaData<CommentReply>): Promise<void> {
|
||||
return axios.post(`${BASE_URI}/reply/create`, captchaData);
|
||||
}
|
||||
|
||||
export default {
|
||||
page,
|
||||
create,
|
||||
createReply,
|
||||
pageReply
|
||||
};
|
||||
Reference in New Issue
Block a user