Files
quyun/frontend/admin/src/api/postService.js
Rogee 65d40fa631
Some checks failed
build quyun / Build (push) Failing after 1m26s
feat: 添加作品购买人列表功能
2025-12-20 23:09:01 +08:00

35 lines
888 B
JavaScript

import httpClient from './httpClient';
export const postService = {
getPosts({ page = 1, limit = 10, keyword = '' } = {}) {
return httpClient.get('/posts', {
params: {
page,
limit,
keyword: keyword.trim()
}
});
},
getPost(id) {
return httpClient.get(`/posts/${id}`);
},
createPost(post) {
return httpClient.post('/posts', post);
},
updatePost(id, post) {
return httpClient.put(`/posts/${id}`, post);
},
deletePost(id) {
return httpClient.delete(`/posts/${id}`);
},
sendTo(id, userId) {
return httpClient.post(`/posts/${id}/send-to/${userId}`);
},
getBuyers(id, { page = 1, limit = 10 } = {}) {
return httpClient.get(`/posts/${id}/buyers`, {
params: { page, limit }
});
},
}