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.

65 lines
1.5 KiB
C#

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

using FluentValidation;
namespace DS.WMS.Core.System.Dtos;
/// <summary>
/// 公告录入实体
/// </summary>
public class NoticeInput
{
public string Id { get; set; }
/// <summary>
/// 标题
/// </summary>
public string Title { get; set; }
/// <summary>
/// 类型
/// </summary>
public string Type { get; set; }
/// <summary>
/// 内容
/// </summary>
public string Content { get; set; }
/// <summary>
/// 优先级
/// </summary>
public string Level { get; set; } = "L";
/// <summary>
/// Desc:截至日期
/// Default:
/// Nullable:True
/// </summary>
public DateTime? EndTime { get; set; }
/// <summary>
/// 通告对象类型 CLIENT:指定客户ALL:全体客户)
/// </summary>
public string MsgType { get; set; }
/// <summary>
/// 指定客户
/// </summary>
public string ClientIds { get; set; }
}
/// <summary>
/// 验证
/// </summary>
public class NoticeInputValidator : AbstractValidator<NoticeInput>
{
/// <summary>
/// 构造函数
/// </summary>
public NoticeInputValidator()
{
this.RuleFor(o => o.Title)
.NotEmpty().WithMessage("标题");
this.RuleFor(o => o.Content)
.NotEmpty().WithMessage("公告内容");
this.RuleFor(o => o.Type)
.NotEmpty().WithMessage("公告类型");
this.RuleFor(o => o.EndTime)
.NotEmpty().WithMessage("截止日期");
}
}