using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Runtime.Serialization;
|
using System.Text;
|
using System.Threading.Tasks;
|
|
namespace iWareSda
|
{
|
/// <summary>
|
/// SDA服务返回的实体类
|
/// </summary>
|
[Serializable]
|
[DataContract]
|
//增加 DataContract DataMember 是为了生成调用不自动生成k_BackingField后缀
|
public class SdaResEntity
|
{
|
public SdaResEntity()
|
{
|
this.result = false;
|
}
|
/// <summary>
|
/// 返回结果
|
/// </summary>
|
[DataMember]
|
public bool result { get; set; }
|
|
[DataMember]
|
public object resData { get; set; }
|
|
/// <summary>
|
/// 返回信息(包含正常和错误的信息)
|
/// </summary>
|
[DataMember]
|
public string resMsg { get; set; }
|
|
|
public static SdaResEntity Success(string _resMsg)
|
{
|
return new SdaResEntity()
|
{
|
result = true,
|
resMsg = _resMsg
|
};
|
}
|
public static SdaResEntity Success(string _resMsg, object _resData)
|
{
|
return new SdaResEntity()
|
{
|
result = true,
|
resData = _resData,
|
resMsg = _resMsg
|
};
|
}
|
|
public static SdaResEntity Failure(string _resMsg)
|
{
|
return new SdaResEntity()
|
{
|
result = false,
|
resMsg = _resMsg
|
};
|
}
|
public static SdaResEntity Failure(string _resMsg, object _resData)
|
{
|
return new SdaResEntity()
|
{
|
result = false,
|
resData = _resData,
|
resMsg = _resMsg
|
};
|
}
|
}
|
}
|