智慧建筑第三方功能集成微服务,目的是聚集所有涉及到第三方厂商调用的功能,按照业务功能划分不同微服务
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
|
namespace Video.Application
|
|
|
|
|
|
{
|
|
|
|
|
|
public class ApiResult<T>
|
|
|
|
|
|
{
|
|
|
|
|
|
public int Code { get; set; }
|
|
|
|
|
|
public string Msg { get; set; }
|
|
|
|
|
|
public string InnerMsg { get; set; }
|
|
|
|
|
|
public T Data { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public static ApiResult<T> IsSuccess(T data, string msg = "请求成功")
|
|
|
|
|
|
{
|
|
|
|
|
|
return new ApiResult<T>() { Code = 200, Data = data, Msg = msg };
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 服务端处理错误
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="msg"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
public static ApiResult<T> IsFail(string msg)
|
|
|
|
|
|
{
|
|
|
|
|
|
return new ApiResult<T> { Code = 2005, Msg = msg };
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 服务端处理错误
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="msg"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
public static ApiResult<T> IsNoFound(string msg = null)
|
|
|
|
|
|
{
|
|
|
|
|
|
return new ApiResult<T> { Code = 2005, Msg = msg ?? "数据不存在" };
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 客户端错误
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="msg"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
public static ApiResult<T> IsBadReq(string msg)
|
|
|
|
|
|
{
|
|
|
|
|
|
return new ApiResult<T> { Code = 2006, Msg = msg };
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public class ApiHubResult<T> : ApiResult<T>
|
|
|
|
|
|
{
|
|
|
|
|
|
public long? Projectid { get; set; }
|
|
|
|
|
|
public long? Constid { get; set; }
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|