Add project files.

This commit is contained in:
Dmitriy yawaflua Andreev
2024-07-08 02:05:16 +03:00
parent 1ebfdc052c
commit 5c940b4838
12 changed files with 262 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
using Microsoft.AspNetCore.Mvc;
using System.Xml.Linq;
namespace OembedTests.Controllers
{
[Route("/oembed")]
[ApiController]
public class OembedController : ControllerBase
{
[HttpGet]
public async Task<IActionResult> GetOembed([FromQuery]string url, [FromQuery] string? format = "json")
{
var userName = url.Replace("https://oembed-test.yawaflua.ru/pay/", "");
var response = $@"{{
""version"": ""1.0"",
""type"": ""link"",
""provider_name"": ""SP-Donate"",
""provider_url"": ""https://sp-donate.ru/"",
""title"": ""Donate to {userName} right now!"",
""thumbnail_url"": ""https://avatar.spworlds.ru/front/240/{userName}""
}}";
return Ok(response);
}
}
}

View File

@@ -0,0 +1,16 @@
using Microsoft.AspNetCore.Mvc;
namespace OembedTests.Controllers
{
[ApiController]
[Route("pay")]
public class WeatherForecastController : ControllerBase
{
[HttpGet("/{userName}")]
public async Task<IActionResult> Get(string userName)
{
return Ok(userName);
}
}
}