You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

72 lines
1.5 KiB
C#

10 months ago
using DS.Module.Core;
using FluentValidation;
namespace DS.WMS.Core.Sys.Dtos;
10 months ago
/// <summary>
/// 数据权限请求实体
/// </summary>
public class DataRuleReq
{
/// <summary>
/// 主键Id
/// </summary>
public long Id { get; set; }
10 months ago
/// <summary>
/// 资源标识权限ID
/// </summary>
public long PermissionId { get; set; }
10 months ago
/// <summary>
/// 中文视图名
/// </summary>
public string ColumnView { get; set; }
10 months ago
/// <summary>
/// 权限规则
/// </summary>
public string DataRules { get; set; }
/// <summary>
/// 权限实体
/// </summary>
public string PermissionEntity { get; set; }
10 months ago
/// <summary>
/// 数据权限描述
/// </summary>
public string Description { get; set; }
/// <summary>
/// 排序
/// </summary>
public int? OrderNo { get; set; } = 100;
10 months ago
/// <summary>
/// 状态 0 启用 1 禁用
/// </summary>
public StatusEnum? Status { get; set; } = StatusEnum.Enable;
10 months ago
/// <summary>
/// 备注
/// </summary>
public string Note { get; set; } = "";
}
/// <summary>
/// 验证
/// </summary>
public class DataRuleReqValidator : AbstractValidator<DataRuleReq>
{
/// <summary>
/// 构造函数
/// </summary>
public DataRuleReqValidator()
{
this.RuleFor(o => o.PermissionId)
.NotEmpty().WithName("权限模块Id");
this.RuleFor(o => o.ColumnView)
.NotEmpty().WithName("中文视图名");
}
}