mirror of
https://gitee.com/durcframework/SOP.git
synced 2025-08-11 21:57:56 +08:00
添加C#sdk
This commit is contained in:
53
sop-sdk/sdk-csharp/SDKCSharp/Response/BaseResponse.cs
Normal file
53
sop-sdk/sdk-csharp/SDKCSharp/Response/BaseResponse.cs
Normal file
@@ -0,0 +1,53 @@
|
||||
using System;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SDKCSharp.Response
|
||||
{
|
||||
/// <summary>
|
||||
/// 返回的Response,新建Response要继承这个类
|
||||
/// </summary>
|
||||
public abstract class BaseResponse
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 状态码,0表示成功,其它都是失败
|
||||
/// </summary>
|
||||
[JsonProperty("code")]
|
||||
public string Code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 消息,如果有错误则为错误信息
|
||||
/// </summary>
|
||||
[JsonProperty("msg")]
|
||||
public string Msg { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 错误状态码
|
||||
/// </summary>
|
||||
/// <value>The sub code.</value>
|
||||
[JsonProperty("sub_code")]
|
||||
public string SubCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 错误消息
|
||||
/// </summary>
|
||||
/// <value>The sub message.</value>
|
||||
[JsonProperty("sub_msg")]
|
||||
public string SubMsg { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 数据
|
||||
/// </summary>
|
||||
[JsonProperty("body")]
|
||||
public string Body { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否成功
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public bool IsSuccess()
|
||||
{
|
||||
return string.IsNullOrEmpty(SubCode);
|
||||
}
|
||||
}
|
||||
}
|
6
sop-sdk/sdk-csharp/SDKCSharp/Response/CommonResponse.cs
Normal file
6
sop-sdk/sdk-csharp/SDKCSharp/Response/CommonResponse.cs
Normal file
@@ -0,0 +1,6 @@
|
||||
namespace SDKCSharp.Response
|
||||
{
|
||||
public class CommonResponse : BaseResponse
|
||||
{
|
||||
}
|
||||
}
|
18
sop-sdk/sdk-csharp/SDKCSharp/Response/GetStoryResponse.cs
Normal file
18
sop-sdk/sdk-csharp/SDKCSharp/Response/GetStoryResponse.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SDKCSharp.Response
|
||||
{
|
||||
public class GetStoryResponse: BaseResponse
|
||||
{
|
||||
[JsonProperty("id")]
|
||||
public int Id { get; set; }
|
||||
|
||||
[JsonProperty("name")]
|
||||
public string Name { get; set; }
|
||||
|
||||
[JsonProperty("gmt_create")]
|
||||
public string GmtCreate { get; set; }
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user