chore: update pom.xml Lombok config and deploy settings

- Update Maven compiler plugin to support Lombok annotation processing
- Add deploy.conf for automated deployment
- Update backend models and controllers
- Update frontend pages and API
This commit is contained in:
2026-03-04 12:21:29 +08:00
parent 4646fbc9b5
commit 6f2dc27fbc
20 changed files with 352 additions and 151 deletions

View File

@@ -203,11 +203,15 @@ export function getFoodList(data) {
}
/**
* 获取食物详情
* @param {String} id - 食物ID名称
* 获取食物详情(后端仅接受 Long 类型 id传 name 会 400
* @param {Number|String} id - 食物ID(必须为数字,不能传名称
*/
export function getFoodDetail(id) {
return request.get('tool/food/detail/' + id);
const numId = typeof id === 'number' && !isNaN(id) ? id : parseInt(String(id), 10);
if (isNaN(numId)) {
return Promise.reject(new Error('食物详情接口需要数字ID当前传入: ' + id));
}
return request.get('tool/food/detail/' + numId);
}
/**
@@ -284,20 +288,22 @@ export function publishCommunityPost(data) {
/**
* 点赞/取消点赞
* @param {Number} postId - 内容ID
* @param {Number} postId - 内容ID(会被转为数字以匹配后端 Long
* @param {Boolean} isLike - 是否点赞true/false
*/
export function toggleLike(postId, isLike) {
return request.post('tool/community/like', { postId, isLike });
const id = typeof postId === 'number' && !isNaN(postId) ? postId : parseInt(postId, 10);
return request.post('tool/community/like', { postId: id, isLike: !!isLike });
}
/**
* 收藏/取消收藏
* @param {Number} postId - 内容ID
* @param {Number} postId - 内容ID(会被转为数字以匹配后端 Long
* @param {Boolean} isCollect - 是否收藏true/false
*/
export function toggleCollect(postId, isCollect) {
return request.post('tool/community/collect', { postId, isCollect });
const id = typeof postId === 'number' && !isNaN(postId) ? postId : parseInt(postId, 10);
return request.post('tool/community/collect', { postId: id, isCollect: !!isCollect });
}
/**