qwj
2023-08-08 0f403ac277b9e3b4b39944bddb7442e94836260c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
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<Doc_Classification> result = new PageResult<Doc_Classification>();
            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);
        }
    }
}