mirror of
https://github.com/EpinelPS/EpinelPS.git
synced 2025-12-15 08:24:52 +01:00
Initial commit
This commit is contained in:
29
nksrv/IntlServer/IntlReturnJsonHandler.cs
Normal file
29
nksrv/IntlServer/IntlReturnJsonHandler.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using EmbedIO;
|
||||
using Swan;
|
||||
|
||||
namespace nksrv.IntlServer
|
||||
{
|
||||
public class IntlReturnJsonHandler : IntlMsgHandler
|
||||
{
|
||||
private string JsonToReturn;
|
||||
public override bool RequiresAuth => false;
|
||||
|
||||
public IntlReturnJsonHandler(string jsonToReturn)
|
||||
{
|
||||
JsonToReturn = jsonToReturn;
|
||||
}
|
||||
|
||||
protected override async Task HandleAsync()
|
||||
{
|
||||
var str= await ctx.GetRequestBodyAsStringAsync();
|
||||
|
||||
string? seg = ctx.GetRequestQueryData().Get("seq");
|
||||
WriteJsonString(JsonToReturn.Replace("((SEGID))", seg));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user