using DS.Module.Core.Extensions;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DS.Module.DjyRulesEngine
{
///
/// 规则引擎封装请求
///
public class RuleEngineReq
{
///
/// 请求报文表头(head)
///
public HeadInfo Head { get; set; }
///
/// 请求报文表体(main)
///
public MainInfo Main { get; set; }
public RuleEngineReq()
{
Head = new HeadInfo();
Main = new MainInfo();
}
}
public class HeadInfo {
public HeadInfo()
{
GID = DateTime.Now.DateToTimeStamp();
MessageType = "SHIP_ORDER_COMPARE";
SenderId = "Dongsheng8";
SenderName = "东胜8平台";
ReceiverId = "RulesEngine";
ReceiverName = "大简云规则引擎";
Version = "1.0";
RequestDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
RequestAction = "Compare";
}
///
/// 报文惟一主键
///
public string GID { get; set; } = DateTime.Now.DateToTimeStamp();
///
/// 报文类型
///
public string MessageType { get; set; } = "SHIP_ORDER_COMPARE";
///
/// 发送方代码
///
public string SenderId { get; set; } = "Dongsheng8";
///
/// 发送方名称
///
public string SenderName { get; set; } = "东胜8平台";
///
/// 接收方代码
///
public string ReceiverId { get; set; } = "RulesEngine";
///
/// 接收方名称 大简云规则引擎
///
public string ReceiverName { get; set; } = "大简云规则引擎";
///
/// 请求方登录TOKEN
///
public string Token { get; set; } = "";
///
/// 版本号
///
public string Version { get; set; } = "1.0";
///
/// 请求时间
///
public string RequestDate { get; set; } = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
///
/// 请求操作类型
///
public string RequestAction { get; set; } = "Compare";
///
/// 请求授权KEY
///
public string SenderKey { get; set; }
}
public class MainInfo
{
public MainInfo() {
ProjectCode = [ "OCEAN_BOOKING" ];
BusinessInfo = new RulesEngineOrderBookingMainBusinessInfo();
}
///
/// 项目代码 项目代码可以传多个,具体按照业务分类来定义,默认传OCEAN_BOOKING
///
public string[] ProjectCode { get; set; } = { "OCEAN_BOOKING" };
///
/// 请求报文表体的海运主业务信息(main.businessInfo)
///
public RulesEngineOrderBookingMainBusinessInfo BusinessInfo { get; set; }
}
}