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.

78 lines
1.9 KiB
C#

using DS.Module.Core;
using FluentValidation;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DS.WMS.Core.Map.Dtos
{
/// <summary>
/// 航线与港口关联信息请求
/// </summary>
public class RelationLaneAndPortReq
{
/// <summary>
/// 主键Id
/// </summary>
public long Id { get; set; }
/// <summary>
/// 模块(公用时为空字符串)
/// </summary>
public string? Module { get; set; }
/// <summary>
/// 航线Id
/// </summary>
public long LaneId { get; set; }
/// <summary>
/// 航线代码
/// </summary>
public string LaneCode { get; set; }
/// <summary>
/// 船司Id
/// </summary>
public long? CarrierId { get; set; }
/// <summary>
/// 船司代码
/// </summary>
public string CarrierCode { get; set; }
/// <summary>
/// 港口Id
/// </summary>
public long? PortId { get; set; }
/// <summary>
/// 港口代码
/// </summary>
public string PortCode { get; set; }
/// <summary>
/// 状态 0 启用 1 禁用
/// </summary>
public StatusEnum? Status { get; set; } = StatusEnum.Enable;
/// <summary>
/// 备注
/// </summary>
public string Note { get; set; } = "";
}
/// <summary>
/// 验证
/// </summary>
public class RelationLaneAndPortReqValidator : AbstractValidator<RelationLaneAndPortReq>
{
/// <summary>
/// 构造函数
/// </summary>
public RelationLaneAndPortReqValidator()
{
this.RuleFor(o => o.LaneCode)
.NotEmpty().WithName("航线代码");
this.RuleFor(o => o.PortCode)
.NotEmpty().WithName("港口代码");
}
}
}