namespace CommonUtil
{
///
/// 生成报文
///
public class TopResult
{
///
/// 生成返回报文
///
/// 返回数据
/// 是否执行成功
/// 错误码
/// 描述
///
public static TopResultDTO GetTopResultDTO(T response, bool isSuccess, int code, string msg)
{
return new TopResultDTO
{
Success = isSuccess,
Code = code,
Msg = msg,
Response = response
};
}
///
/// 生成返回报文
///
/// 返回数据
/// 是否执行成功
/// 错误码
/// 描述
/// 页码
/// 页大小
/// 总数
///
public static TopResultDTO> GetTopPageResultDTO(T response, bool isSuccess, int code, string msg, int currentPage, int pageSize, int totalCount)
{
return new TopResultDTO>
{
Success = isSuccess,
Code = code,
Msg = msg,
Response = new TopPageResultDTO
{
PageNo = currentPage,
TotalCount = totalCount,
PageSize = pageSize,
Data = response
}
};
}
///
/// 生成返回报文
///
/// 是否执行成功
/// 错误码
/// 描述
///
public static TopResultDTO GetTopResultDTO(bool isSuccess, int code, string msg)
{
return new TopResultDTO
{
Success = isSuccess,
Code = code,
Msg = msg,
};
}
}
}