You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
68 lines
2.3 KiB
68 lines
2.3 KiB
using Application.Domain.Entities;
|
|
using Infrastructure.Application;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel.DataAnnotations;
|
|
|
|
namespace Application.Models
|
|
{
|
|
[Display(Name = "用户")]
|
|
public class EditUserModel : EditModel
|
|
{
|
|
[Required(ErrorMessage = nameof(RequiredAttribute))]
|
|
[RegularExpression("^[a-zA-Z0-9]+$", ErrorMessage = "用户名只能由数字和字母组成")]
|
|
[StringLength(30, MinimumLength = 5, ErrorMessage = "用户名长度为5-30")]
|
|
[Display(Name = "用户名")]
|
|
public string UserName { get; set; }
|
|
|
|
[StringLength(100, MinimumLength = 6, ErrorMessage = "密码长度范围为{2}-{1}")]
|
|
[DataType(DataType.Password)]
|
|
[Display(Name = "登录密码")]
|
|
public string Password { get; set; }
|
|
|
|
[DataType(DataType.EmailAddress)]
|
|
[RegularExpression(@"^\w+@\w+\.\w+$", ErrorMessage = "邮箱格式错误")]
|
|
[Display(Name = "邮箱")]
|
|
public string Email { get; set; }
|
|
|
|
[RegularExpression(@"^\d{11}$", ErrorMessage = "手机号格式错误")]
|
|
[DataType(DataType.PhoneNumber)]
|
|
[Display(Name = "手机号")]
|
|
public string PhoneNumber { get; set; }
|
|
|
|
[Display(Name = "昵称")]
|
|
[Required(ErrorMessage = nameof(RequiredAttribute))]
|
|
public string NickName { get; set; }
|
|
|
|
[Display(Name = "头像")]
|
|
[DataType(DataType.ImageUrl)]
|
|
public string Avatar { get; set; }
|
|
|
|
[Display(Name = "面部图像")]
|
|
[DataType(DataType.ImageUrl)]
|
|
public string FaceImage { get; set; }
|
|
|
|
[Display(Name = "性别")]
|
|
[UIHint("RadioButtonList")]
|
|
[Required(ErrorMessage = nameof(RequiredAttribute))]
|
|
public Sex Sex { get; set; }
|
|
|
|
[DataType(DataType.Date)]
|
|
[Display(Name = "生日")]
|
|
public DateTime? Birthday { get; set; }
|
|
|
|
[Display(Name = "登录锁定")]
|
|
public bool LockoutEnabled { get; set; }
|
|
|
|
[Display(Name = "解锁时间")]
|
|
[DataType(DataType.DateTime)]
|
|
public DateTimeOffset? LockoutEnd { get; set; }
|
|
|
|
[Display(Name = "登录失败")]
|
|
public int AccessFailedCount { get; set; }
|
|
|
|
[DataType("MultiSelectList")]
|
|
[Display(Name = "角色")]
|
|
public List<Guid> Roles { get; set; } = new List<Guid>();
|
|
}
|
|
} |