新增restful模式

This commit is contained in:
六如
2025-02-02 15:51:47 +08:00
parent 1f04edeaff
commit ddc709ede4
97 changed files with 1487 additions and 867 deletions

11
sop-sdk/sdk-csharp/SDKCSharp/Model/GetStoryModel.cs Executable file → Normal file
View 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
View 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())
{
// 返回结果

View File

@@ -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";
}
}
}

View File

@@ -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; }
}
}