first commit
This commit is contained in:
41
Complex.EndPoint/Controllers/PersonController.cs
Normal file
41
Complex.EndPoint/Controllers/PersonController.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
using Complex.Application.AppCommon;
|
||||
using Complex.Application.Complex;
|
||||
using Complex.Application.PersonService;
|
||||
using Complex.Common.Dto;
|
||||
using Complex.Domain.Entities;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Complex.EndPoint.Controllers
|
||||
{
|
||||
[ApiController]
|
||||
[ApiVersion("1")]
|
||||
[Route("api/v{version:apiVersion}/[controller]/[action]")]
|
||||
//[Route("[controller]/[action]")]
|
||||
[Authorize]
|
||||
public class PersonController : Controller
|
||||
{
|
||||
private readonly IPersonService _personService;
|
||||
|
||||
public PersonController(IPersonService personService)
|
||||
{
|
||||
_personService = personService;
|
||||
}
|
||||
[HttpPost]
|
||||
public ResultDto<string> InsertPerson(PersonDto person)
|
||||
{
|
||||
return _personService.InsertPerson(person);
|
||||
}
|
||||
[HttpPost]
|
||||
public ResultDto<bool> EditPerson(PersonDto person)
|
||||
{
|
||||
return _personService.EditPerson(person);
|
||||
}
|
||||
[HttpPost]
|
||||
public ResultDto<List<PersonDto>> GetAllPersons(PersonDto personSearchObj)
|
||||
{
|
||||
var persons = _personService.GetAllPersons(personSearchObj);
|
||||
return persons;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user