Files
ThingsGateway/framework/admin/ThingsGateway.Admin.Application/System/Services/UserCenter/Dto/UserCenterInput.cs
Kimdiego2098 a17a15e5d7 迁移4.0
2023-11-18 22:43:36 +08:00

60 lines
1.9 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#region copyright
//------------------------------------------------------------------------------
// 此代码版权声明为全文件覆盖,如有原作者特别声明,会在下方手动补充
// 此代码版权除特别声明外的代码归作者本人Diego所有
// 源代码使用协议遵循本仓库的开源协议及附加协议
// Gitee源代码仓库https://gitee.com/diego2098/ThingsGateway
// Github源代码仓库https://github.com/kimdiego2098/ThingsGateway
// 使用文档https://diego2098.gitee.io/thingsgateway-docs/
// QQ群605534569
//------------------------------------------------------------------------------
#endregion
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
namespace ThingsGateway.Admin.Application;
/// <summary>
/// 编辑个人信息参数
/// </summary>
public class UpdateInfoInput : SysUser
{
/// <summary>
/// Id
/// </summary>
[MinValue(1, ErrorMessage = "Id不能为空")]
public override long Id { get; set; }
}
/// <summary>
/// 修改密码
/// </summary>
public class PasswordInfoInput : BaseIdInput, IValidatableObject
{
/// <summary>
/// 旧密码
/// </summary>
[Description("旧密码")]
[Required(ErrorMessage = "不能为空")]
public string OldPassword { get; set; }
/// <summary>
/// 新密码
/// </summary>
[Description("新密码")]
[Required(ErrorMessage = "不能为空")]
public string NewPassword { get; set; }
/// <summary>
/// 确认密码
/// </summary>
[Description("确认密码")]
[Required(ErrorMessage = "不能为空")]
public string ConfirmPassword { get; set; }
/// <inheritdoc/>
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
{
if (NewPassword != ConfirmPassword)
yield return new ValidationResult("两次密码不一致", new[] { nameof(ConfirmPassword) });
}
}