feat: 个人信息修改
This commit is contained in:
@@ -3,6 +3,7 @@ package com.webgame.webgamebackend.service;
|
||||
import com.webgame.webgamebackend.common.dto.user.UpdateStatusRequest;
|
||||
import com.webgame.webgamebackend.common.dto.user.UpdateUserInfoRequest;
|
||||
import com.webgame.webgamebackend.common.dto.user.UserInfoResponse;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
/**
|
||||
* 用户服务接口
|
||||
@@ -32,4 +33,25 @@ public interface UserService {
|
||||
* @param request 状态更新请求
|
||||
*/
|
||||
void updateStatus(String accountId, UpdateStatusRequest request);
|
||||
|
||||
/**
|
||||
* 上传并更新当前登录用户的头像
|
||||
*
|
||||
* 文件会被保存到 uploads/avatars/{accountId}.jpg,并更新 DB 中的 avatar 字段。
|
||||
*
|
||||
* @param accountId 账号 ID
|
||||
* @param file 头像文件(前端已裁剪为 200×200 JPEG)
|
||||
* @return 更新后的用户信息
|
||||
*/
|
||||
UserInfoResponse uploadAvatar(String accountId, MultipartFile file);
|
||||
|
||||
/**
|
||||
* 删除当前登录用户的头像
|
||||
*
|
||||
* 删除磁盘文件,并将 DB 中 avatar 置为 null(前端会回退显示默认头像)。
|
||||
*
|
||||
* @param accountId 账号 ID
|
||||
* @return 更新后的用户信息
|
||||
*/
|
||||
UserInfoResponse deleteAvatar(String accountId);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user