根据要求,仅首页的推荐和搜索功能使用 back_jwlll
服务,其他功能使用已有的其他后端服务。
仅用于首页推荐和搜索功能
/search
)/user_tags
)/recommend_tags
)/user_based_recommend
)用于帖子相关功能
/posts/{id}
)/posts
)/posts/{id}/like
)/posts/{id}/comments
)用于用户相关功能
/api/user/{id}
)/api/follow/{id}
)/api/user/{id}/favorites
)用于审核相关功能
/areview
)/apostlist
)/src/api/search_jwlll.js
http://127.0.0.1:5000
http://10.126.59.25:5714
/src/api/posts_api.js
(新增){id, user_id, content, created_at, replies}
{id, user_name, content, create_time}
getComments
方法中进行字段映射{title, content, tags, category, type, media_files}
{title, content, type, media_urls, status}
uploadPost
方法中进行数据转换HomeFeed.jsx
- 推荐和搜索功能,继续使用JWLLL服务PostDetailJWLLL.jsx
- 帖子详情、点赞、评论功能,自动切换到WZY服务UploadPageJWLLL.jsx
- 帖子上传功能,自动切换到WZY服务如需要,其他组件可以导入 posts_api.js
来使用统一的帖子和用户API。
用户{user_id}
格式生成提供了 test_api.js
文件来验证API服务分工是否正确:
import { runAllTests } from './test_api.js' // 运行所有测试 runAllTests()
首页搜索测试
帖子详情测试
帖子上传测试
确保以下服务正常运行:
curl http://127.0.0.1:5000/word2vec_status
curl http://10.126.59.25:5714/posts
curl http://10.126.59.25:5715/api/current-user
curl http://10.126.59.25:5713/health
(如果有)