22 lines
572 B
C#
22 lines
572 B
C#
using System.Text;
|
|
using Kurisu.RemoteCall;
|
|
using Kurisu.RemoteCall.Abstractions;
|
|
using Newtonsoft.Json;
|
|
|
|
namespace Dlhis.Basic.Api.ContentHandlers;
|
|
|
|
public class CodeContentHandler : IContentHandler
|
|
{
|
|
/// <inheritdoc />
|
|
public HttpContent Create(List<ParameterValue> values)
|
|
{
|
|
var code = values.First(x => x.Parameter.Name == "code").GetValue<string>();
|
|
var obj = new
|
|
{
|
|
code,
|
|
};
|
|
var json = JsonConvert.SerializeObject(obj);
|
|
|
|
return new StringContent(json, Encoding.UTF8, "application/json");
|
|
}
|
|
} |