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.
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Runtime.Serialization;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace Estsh.Core.Model.Result
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 公共返回结果对象
|
|
|
|
|
/// </summary>
|
|
|
|
|
[Serializable]
|
|
|
|
|
public class CommonResult
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// BaseResult构造函数
|
|
|
|
|
/// </summary>
|
|
|
|
|
public CommonResult()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// BaseResult构造函数
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="message">错误消息</param>
|
|
|
|
|
/// <param name="errcode">错误代码</param>
|
|
|
|
|
public CommonResult(string message, string errcode)
|
|
|
|
|
{
|
|
|
|
|
this.message = message;
|
|
|
|
|
this.ErrCode = errcode;
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 构造函数
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="message">错误消息</param>
|
|
|
|
|
/// <param name="success">成功或失败</param>
|
|
|
|
|
/// <param name="errcode">错误代码</param>
|
|
|
|
|
public CommonResult(string message, bool success, string errcode)
|
|
|
|
|
{
|
|
|
|
|
this.message = message;
|
|
|
|
|
this.ErrCode = errcode;
|
|
|
|
|
this.success = success;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 错误代码
|
|
|
|
|
/// </summary>
|
|
|
|
|
private string _errCode = "-1";
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 错误描述信息
|
|
|
|
|
/// </summary>
|
|
|
|
|
private string _message;
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 成功或失败
|
|
|
|
|
/// </summary>
|
|
|
|
|
private bool _success = false;
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 账户类型
|
|
|
|
|
/// </summary>
|
|
|
|
|
private string _accountType { get; set; }
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 用来传递的object内容
|
|
|
|
|
/// </summary>
|
|
|
|
|
[DataMember]
|
|
|
|
|
private object _resData;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 错误代码
|
|
|
|
|
/// </summary>
|
|
|
|
|
[DataMember]
|
|
|
|
|
public string ErrCode
|
|
|
|
|
{
|
|
|
|
|
get {
|
|
|
|
|
return _errCode;
|
|
|
|
|
}
|
|
|
|
|
set {
|
|
|
|
|
_errCode = value;
|
|
|
|
|
if (value == "0")
|
|
|
|
|
{
|
|
|
|
|
success= _success = true;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
success = _success = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 如果不成功,返回的错误描述信息
|
|
|
|
|
/// </summary>
|
|
|
|
|
[DataMember]
|
|
|
|
|
public string message
|
|
|
|
|
{
|
|
|
|
|
get {
|
|
|
|
|
return _message;
|
|
|
|
|
}
|
|
|
|
|
set { _message = value; }
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 成功返回true,失败返回false
|
|
|
|
|
/// </summary>
|
|
|
|
|
[DataMember]
|
|
|
|
|
public bool success
|
|
|
|
|
{
|
|
|
|
|
get {
|
|
|
|
|
if (ErrCode == "0")
|
|
|
|
|
{
|
|
|
|
|
_success = true;
|
|
|
|
|
}
|
|
|
|
|
return _success;
|
|
|
|
|
}
|
|
|
|
|
set {
|
|
|
|
|
_success = value;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 用来传递的object内容
|
|
|
|
|
/// </summary>
|
|
|
|
|
[DataMember]
|
|
|
|
|
public string accountType
|
|
|
|
|
{
|
|
|
|
|
get => _accountType;
|
|
|
|
|
set => _accountType = value;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 用来传递的object内容
|
|
|
|
|
/// </summary>
|
|
|
|
|
[DataMember]
|
|
|
|
|
public object resData
|
|
|
|
|
{
|
|
|
|
|
get => _resData;
|
|
|
|
|
set => _resData = value;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|