模型修改
This commit is contained in:
parent
82137d3ae9
commit
1e0f75ed3a
@ -601,6 +601,19 @@ public class MyRegistrationDto
|
||||
public string ProjectNames { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新头像URL输入
|
||||
/// </summary>
|
||||
public class UpdateAvatarUrlInput
|
||||
{
|
||||
/// <summary>
|
||||
/// 头像图片URL
|
||||
/// </summary>
|
||||
[Required(ErrorMessage = "头像URL不能为空")]
|
||||
[MaxLength(500, ErrorMessage = "头像URL不能超过500个字符")]
|
||||
public string AvatarUrl { get; set; } = string.Empty;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新头像输出
|
||||
/// </summary>
|
||||
|
||||
@ -721,19 +721,14 @@ public class MyController : IDynamicApiController
|
||||
/// <summary>
|
||||
/// 更新头像 - 使用图片URL
|
||||
/// </summary>
|
||||
/// <param name="avatarUrl">头像图片URL</param>
|
||||
/// <param name="input">头像URL输入</param>
|
||||
/// <returns>更新后的头像信息</returns>
|
||||
[HttpPost("avatar/url")]
|
||||
[DisplayName("更新头像URL")]
|
||||
public async Task<UpdateAvatarOutput> UpdateAvatarByUrl([FromBody] string avatarUrl)
|
||||
public async Task<UpdateAvatarOutput> UpdateAvatarByUrl([FromBody] UpdateAvatarUrlInput input)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(avatarUrl))
|
||||
{
|
||||
throw Oops.Bah("头像URL不能为空");
|
||||
}
|
||||
|
||||
// 验证URL格式
|
||||
if (!Uri.TryCreate(avatarUrl, UriKind.Absolute, out _))
|
||||
if (!Uri.TryCreate(input.AvatarUrl, UriKind.Absolute, out _))
|
||||
{
|
||||
throw Oops.Bah("头像URL格式不正确");
|
||||
}
|
||||
@ -746,13 +741,13 @@ public class MyController : IDynamicApiController
|
||||
throw Oops.Bah("用户信息不存在");
|
||||
}
|
||||
|
||||
user.Avatar = avatarUrl;
|
||||
user.Avatar = input.AvatarUrl;
|
||||
user.UpdatedTime = DateTime.Now;
|
||||
await _appUserRepository.UpdateAsync(user);
|
||||
|
||||
return new UpdateAvatarOutput
|
||||
{
|
||||
AvatarUrl = avatarUrl
|
||||
AvatarUrl = input.AvatarUrl
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@ -3482,6 +3482,16 @@
|
||||
报名项目集合
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:YD_Event.Application.Client.Dtos.UpdateAvatarUrlInput">
|
||||
<summary>
|
||||
更新头像URL输入
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:YD_Event.Application.Client.Dtos.UpdateAvatarUrlInput.AvatarUrl">
|
||||
<summary>
|
||||
头像图片URL
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:YD_Event.Application.Client.Dtos.UpdateAvatarOutput">
|
||||
<summary>
|
||||
更新头像输出
|
||||
@ -3810,11 +3820,11 @@
|
||||
<param name="file">头像图片文件</param>
|
||||
<returns>更新后的头像信息</returns>
|
||||
</member>
|
||||
<member name="M:YD_Event.Application.Client.MyController.UpdateAvatarByUrl(System.String)">
|
||||
<member name="M:YD_Event.Application.Client.MyController.UpdateAvatarByUrl(YD_Event.Application.Client.Dtos.UpdateAvatarUrlInput)">
|
||||
<summary>
|
||||
更新头像 - 使用图片URL
|
||||
</summary>
|
||||
<param name="avatarUrl">头像图片URL</param>
|
||||
<param name="input">头像URL输入</param>
|
||||
<returns>更新后的头像信息</returns>
|
||||
</member>
|
||||
<member name="M:YD_Event.Application.Client.MyController.ProcessAvatarImage(System.IO.Stream)">
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user