Update 20241112

This commit is contained in:
Stefan Hutter
2024-11-12 14:22:55 +01:00
parent 23a308ad73
commit 09bcee5a2a
1162 changed files with 6775694 additions and 968 deletions

View File

@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace ILMocup.Controllers
{
public class HomeController : Controller
{
public ActionResult Index()
{
ViewBag.Title = "Home Page";
return View();
}
}
}

View File

@@ -0,0 +1,65 @@
using Swashbuckle.Swagger;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web;
using System.Web.Http;
namespace ILMocup.Controllers
{
public class ILController : ApiController
{
[HttpPost]
[Route("API/Fast")]
public IHttpActionResult Fast()
{
string json = "";
if (HttpContext.Current.Request.InputStream.Length > 0)
{
using (var inputStream = new StreamReader(HttpContext.Current.Request.InputStream))
{
json = inputStream.ReadToEnd();
}
}
string filename = @"X:\jsontemp\ILMockup" + @"\fast_" + DateTime.Now.ToString("yyyymmdd_hhMMss") + ".json";
System.IO.File.WriteAllText(filename, json);
return Content(HttpStatusCode.OK, RandomString(6));
}
[HttpPost]
[Route("API/Slow")]
public IHttpActionResult Slow()
{
string json = "";
string rs = RandomString(6);
if (HttpContext.Current.Request.InputStream.Length > 0)
{
using (var inputStream = new StreamReader(HttpContext.Current.Request.InputStream))
{
json = inputStream.ReadToEnd();
}
}
string filename = @"X:\jsontemp\ILMockup" + @"\Slow_" + DateTime.Now.ToString("yyyyMMdd_hhmmss") + "_"+rs+".json";
System.IO.File.WriteAllText(filename, json);
return Content(HttpStatusCode.OK, rs);
}
private static Random random = new Random();
public static string RandomString(int length)
{
const string chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
return new string(Enumerable.Repeat(chars, length)
.Select(s => s[random.Next(s.Length)]).ToArray());
}
}
}

View File

@@ -0,0 +1,39 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
namespace ILMocup.Controllers
{
public class ValuesController : ApiController
{
// GET api/values
public IEnumerable<string> Get()
{
return new string[] { "value1", "value2" };
}
// GET api/values/5
public string Get(int id)
{
return "value";
}
// POST api/values
public void Post([FromBody] string value)
{
}
// PUT api/values/5
public void Put(int id, [FromBody] string value)
{
}
// DELETE api/values/5
public void Delete(int id)
{
}
}
}