123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel.DataAnnotations;
- using VCommon.VApplication.Auditing.DataAnnotations;
- using VCommon.VApplication.Dto;
- using VCommon.VAutoMapper;
- using VCommonCoreExample.Entity;
- namespace VCommonCoreExample.AppServices.System.Users.Dto
- {
- public class UserListRequest : PagedRequest, IStringSearchFilter, IPassiveFilter
- {
- public string Search { get; set; }
- public bool? IsEnable { get; set; }
- public DateTimeRange CreateOn { get; set; }
- }
- [AutoMapFrom(typeof(User))]
- public class UserDto : EntityDto, IHaveName
- {
- [AutoMapJsonConvert()]
- public Guid[] Roles { get; set; }
- public string Name { get; set; }
- public string LoginName { get; set; }
- public bool IsEnable { get; set; }
- }
- public class UserListOutput : IPagedResult<UserDto>
- {
- public IReadOnlyCollection<NamedEntityDto> AvailableRoles { get; set; }
- public UserListOutput(int totalRecord, IReadOnlyList<UserDto> items)
- {
- TotalRecord = totalRecord;
- Items = items;
- }
- public int TotalRecord { get; }
- [SimplifyAuditingLog]
- public IReadOnlyList<UserDto> Items { get; }
- }
- public class UserFormPrepOutput
- {
- public UserDto Output { get; set; }
- public IReadOnlyCollection<NamedEntityDto> AvailableRoles { get; }
- public UserFormPrepOutput(IReadOnlyCollection<NamedEntityDto> availableRoles)
- {
- AvailableRoles = availableRoles;
- }
- }
- public class UserCreateInput
- {
- [Required]
- [AutoMapJsonConvert]
- public Guid[] Roles { get; set; }
- [Required]
- public string Name { get; set; }
- [Required]
- public string LoginName { get; set; }
- [Required]
- public string Password { get; set; }
- public bool IsEnable { get; set; }
- }
- public class UserUpdateInput : EntityDto
- {
- [Required]
- [AutoMapJsonConvert]
- public Guid[] Roles { get; set; }
- [Required]
- public string Name { get; set; }
- [Required]
- public string LoginName { get; set; }
- public string Password { get; set; }
- public bool IsEnable { get; set; }
- }
- }
|