| import { api } from './auth'; // 复用已有的axios实例
|
| export const createPost = (title, content, authorId) => {
|
| return api.post('/help/posts', {
|
| export const getPosts = (page = 1, size = 5) => {
|
| return api.get('/help/posts', {
|
| export const getPostDetail = (postId) => {
|
| return api.get(`/help/posts/${postId}`);
|
| export const likePost = (postId) => {
|
| return api.post(`/help/posts/${postId}/like`);
|
| export const addPostComment = (postId, commentData) => {
|
| return api.post(`/help/posts/${postId}/comments`, commentData);
|