123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- using Luticate2.Utils.Controllers;
- using Luticate2.Utils.Dbo;
- using Luticate2.Utils.Dbo.OrderBy;
- using Microsoft.AspNetCore.Mvc;
- using Test.Utils.Dbo.PkGuid;
- using WebTest.Business;
-
- namespace WebTest.Controllers
- {
- public class PkGuidController : LuController
- {
- private readonly PkGuidBusiness _busines;
-
- public PkGuidController(PkGuidBusiness busines)
- {
- _busines = busines;
- }
-
- [HttpGet]
- [Route("[controller]/{id}")]
- public PkGuidDbo GetSingleById(string id)
- {
- return Handle(_busines.GetSingleById(id));
- }
-
- [HttpGet]
- [Route("[controller]")]
- public LuPaginatedDbo<PkGuidDbo> GetMultiple(LuOrderByDbo orderBy, int page = 0, int perPage = int.MaxValue)
- {
- return Handle(_busines.GetMultiple(orderBy, page, perPage));
- }
-
- [HttpPost]
- [Route("[controller]")]
- public PkGuidDbo Add([FromBody]PkGuidAddDbo data)
- {
- return Handle(_busines.AddDbo(data));
- }
-
- [HttpPost]
- [Route("[controller]/{id}")]
- public PkGuidDbo Edit(string id, [FromBody]PkGuidAddDbo data)
- {
- return Handle(_busines.EditSingleByIdDbo(id, data));
- }
-
- [HttpDelete]
- [Route("[controller]/{id}")]
- public PkGuidDbo Delete(string id)
- {
- return Handle(_busines.DeleteSingleByIdDbo(id));
- }
- }
- }
|