35 lines
945 B
C#
35 lines
945 B
C#
|
|
using langguanApi.Model.Dto;
|
|||
|
|
using langguanApi.Service;
|
|||
|
|
using Microsoft.AspNetCore.Http;
|
|||
|
|
using Microsoft.AspNetCore.Mvc;
|
|||
|
|
|
|||
|
|
namespace langguanApi.Controllers
|
|||
|
|
{
|
|||
|
|
/// <summary>
|
|||
|
|
/// 接收数据
|
|||
|
|
/// </summary>
|
|||
|
|
[Route("api/[controller]")]
|
|||
|
|
[ApiController]
|
|||
|
|
public class ReceiveController : ControllerBase
|
|||
|
|
{
|
|||
|
|
private readonly ReceiveDataService _receiveService;
|
|||
|
|
/// <summary>
|
|||
|
|
/// 接收数据
|
|||
|
|
public ReceiveController(ReceiveDataService receiveService)
|
|||
|
|
{
|
|||
|
|
_receiveService = receiveService;
|
|||
|
|
}
|
|||
|
|
/// <summary>
|
|||
|
|
/// 接收数据
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="input"></param>
|
|||
|
|
/// <returns></returns>
|
|||
|
|
[HttpPost("receive")]
|
|||
|
|
public async Task<IActionResult> Post([FromBody] ReceiveDto input)
|
|||
|
|
{
|
|||
|
|
var result = await _receiveService.ReceiveData(input);
|
|||
|
|
return Ok(result);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|