feat: 实现用户头像上传功能
- 创建头像上传API接口 (POST /api/v1/users/:id/avatar) - 实现完整的头像上传逻辑,包含权限验证和文件处理 - 添加头像图片处理功能,支持自动压缩和居中裁剪 - 完善静态文件服务,支持头像访问 - 创建完整的API测试用例 - 更新任务进度文档 任务11已完成,项目完成率提升至37.5%
This commit is contained in:
@ -215,6 +215,19 @@ type UpdateUserResponse struct {
|
||||
Data User `json:"data"`
|
||||
}
|
||||
|
||||
type UploadAvatarData struct {
|
||||
AvatarUrl string `json:"avatar_url"`
|
||||
}
|
||||
|
||||
type UploadAvatarRequest struct {
|
||||
Id int64 `path:"id"`
|
||||
}
|
||||
|
||||
type UploadAvatarResponse struct {
|
||||
BaseResponse
|
||||
Data UploadAvatarData `json:"data"`
|
||||
}
|
||||
|
||||
type UploadPhotoRequest struct {
|
||||
Title string `json:"title" validate:"required"`
|
||||
Description string `json:"description,optional"`
|
||||
|
||||
Reference in New Issue
Block a user