using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace iWare.Authorize
{
///
/// 方法返回实体
///
public class AuthorizeFunRetEntity
{
///
/// 方法返回结果
///
public bool result { get; set; }
///
/// 方法返回消息
///
public string resMsg { get; set; }
///
/// 方法警告消息
///
public string warnMsg { get; set; }
public object resData { get; set; }
///
/// 剩余天数
///
public double? remainingDays { get; set; }
///
/// 到期日期
///
public string expiryDate { get; set; }
///
/// 授权日期
///
public string issueDate { get; set; }
///
/// 项目名称
///
public string projectId { get; set; }
///
/// 授权类型
///
public string type { get; set; }
///
/// 绑定MAC
///
public string macAddress { get; set; }
///
/// 返回成功
///
///
///
public static AuthorizeFunRetEntity Success(string _resMsg, AuthorizeFunRetEntity newFun)
{
return new AuthorizeFunRetEntity()
{
result = true,
resMsg = _resMsg,
expiryDate = newFun?.expiryDate,
issueDate = newFun?.issueDate,
macAddress = newFun?.macAddress,
projectId = newFun?.projectId,
type = newFun?.type
};
}
///
/// 返回成功
///
///
///
public static AuthorizeFunRetEntity Success(string _resMsg, double _remainingDays, AuthorizeFunRetEntity newFun)
{
return new AuthorizeFunRetEntity()
{
result = true,
resMsg = _resMsg,
remainingDays = _remainingDays,
expiryDate = newFun.expiryDate,
issueDate = newFun.issueDate,
macAddress = newFun.macAddress,
projectId = newFun.projectId,
type = newFun.type
};
}
///
/// 返回成功
///
///
///
public static AuthorizeFunRetEntity Success(string _resMsg, double _remainingDays, string _warnMsg)
{
return new AuthorizeFunRetEntity()
{
result = true,
resMsg = _resMsg,
remainingDays = _remainingDays,
warnMsg = _warnMsg
};
}
///
/// 返回失败
///
///
///
public static AuthorizeFunRetEntity Fail(string _resMsg, object _resData = null)
{
return new AuthorizeFunRetEntity()
{
result = false,
resMsg = _resMsg,
resData = _resData
};
}
///
/// 返回失败
///
///
///
public static AuthorizeFunRetEntity Fail(string _resMsg, double _remainingDays, AuthorizeFunRetEntity newFun)
{
return new AuthorizeFunRetEntity()
{
result = false,
resMsg = _resMsg,
remainingDays = _remainingDays,
expiryDate = newFun.expiryDate,
issueDate = newFun.issueDate,
macAddress = newFun.macAddress,
projectId = newFun.projectId,
type = newFun.type
};
}
}
}