This commit is contained in:
@@ -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);
|
||||
|
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user