using DocumentServiceAPI.Application.System.Services; using DocumentServiceAPI.Application.System; using DocumentServiceAPI.Utility; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using DocumentServiceAPI.Application.DocManage.Services; using DocumentServiceAPI.Model; using DocumentServiceAPI.Model.cyDocumentModel; namespace DocumentServiceAPI.Application.DocManage { public class DocManageAppService : IDynamicApiController { private readonly DocClassificationService _classificationService; public DocManageAppService(DocClassificationService classificationService) { _classificationService = classificationService; } public IActionResult GetInfo() { var person = _classificationService.GetList(); return new JsonResult(person); } public IActionResult PostListPage(DocClassificationPageSearch page) { PageModel pg = new PageModel(); pg.PageSize = page.PageSize; pg.PageIndex = page.PageIndex; PageResult result = new PageResult(); result.Items = _classificationService.GetPageListAsync(c => c.parent_code==page.Code, pg).Result; result.TotalCount = pg.TotalCount; return new JsonResult(result); } public IActionResult PostAddTest(Doc_Classification info) { var person = _classificationService.InsertAsync(info); return new JsonResult(person.Result); } public IActionResult PostEdtTest(Doc_Classification info) { var person = _classificationService.UpdateAsync(info); return new JsonResult(person.Result); } public IActionResult PostDelTest(int id) { var person = _classificationService.DeleteByIdAsync(id); return new JsonResult(person.Result); } } }