mirror of
https://gitee.com/durcframework/SOP.git
synced 2025-08-11 21:57:56 +08:00
新增restful模式
This commit is contained in:
11
sop-sdk/sdk-csharp/SDKCSharp/Model/GetStoryModel.cs
Executable file → Normal file
11
sop-sdk/sdk-csharp/SDKCSharp/Model/GetStoryModel.cs
Executable file → Normal file
@@ -4,11 +4,12 @@ namespace SDKCSharp.Model
|
||||
{
|
||||
public class GetStoryModel
|
||||
{
|
||||
/// <summary>
|
||||
/// 故事名称
|
||||
|
||||
/// <summary>
|
||||
/// id
|
||||
/// </summary>
|
||||
/// <value>The name.</value>
|
||||
[JsonProperty("name")]
|
||||
public string Name { get; set; }
|
||||
/// <value>The id.</value>
|
||||
[JsonProperty("id")]
|
||||
public int Id { get; set; }
|
||||
}
|
||||
}
|
||||
|
8
sop-sdk/sdk-csharp/SDKCSharp/Program.cs
Executable file → Normal file
8
sop-sdk/sdk-csharp/SDKCSharp/Program.cs
Executable file → Normal file
@@ -42,15 +42,15 @@ namespace SDKTest
|
||||
private static void TestGet()
|
||||
{
|
||||
// 创建请求对象
|
||||
GetStoryRequest request = new GetStoryRequest();
|
||||
GetProductRequest request = new GetProductRequest();
|
||||
// 请求参数
|
||||
GetStoryModel model = new GetStoryModel();
|
||||
model.Name = "白雪公主";
|
||||
model.Id = 1;
|
||||
request.BizModel = model;
|
||||
|
||||
// 发送请求
|
||||
Result<GetStoryResponse> result = client.Execute(request);
|
||||
|
||||
Result<GetProductResponse> result = client.Execute(request);
|
||||
|
||||
if (result.IsSuccess())
|
||||
{
|
||||
// 返回结果
|
||||
|
@@ -1,15 +0,0 @@
|
||||
using System;
|
||||
using SDKCSharp.Common;
|
||||
using SDKCSharp.Response;
|
||||
|
||||
namespace SDKCSharp.Request
|
||||
{
|
||||
public class GetStoryRequest : BaseRequest<GetStoryResponse>
|
||||
{
|
||||
public override string GetMethod()
|
||||
{
|
||||
return "alipay.story.find";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@@ -1,18 +0,0 @@
|
||||
using System;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace SDKCSharp.Response
|
||||
{
|
||||
public class GetStoryResponse
|
||||
{
|
||||
[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