small changes
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2022-12-14 20:32:54 +05:00
parent 2d853eaa02
commit cccd45caa7
6 changed files with 22 additions and 22 deletions

View File

@@ -2,7 +2,6 @@
using NeDvachAPI.BufferControllers;
using NeDvachAPI.DBControllers;
using NeDvachAPI.Models;
using System.Text.Json;
namespace NeDvachAPI.Controllers
{
@@ -15,6 +14,11 @@ namespace NeDvachAPI.Controllers
{
string ipAddress = Request.HttpContext.Connection.RemoteIpAddress.ToString();
ReceivedPost.Ip = ipAddress;
if(ReceivedPost.Text.Length == 0)
{
return new JsonResult("Вы отправили пустое сообщение!");
}
try
{
DBchat.SendPost(ReceivedPost);

View File

@@ -1,19 +0,0 @@
using Microsoft.AspNetCore.Mvc;
using System.Net;
using System.Text.Json;
namespace NeDvachAPI.Controllers
{
[ApiController]
[Route("[controller]")]
public class TestPostingController : ControllerBase
{
[HttpPost]
public int Area([FromForm] int height , int altitude)
{
//DBchat.SendPost(ReceivedPost);
Console.WriteLine("Received! " + height + " " + altitude );
return 200;
}
}
}