|
@@ -0,0 +1,70 @@
|
|
|
+using System;
|
|
|
+using System.Collections.Generic;
|
|
|
+using System.Linq;
|
|
|
+using System.Text;
|
|
|
+using System.Threading.Tasks;
|
|
|
+using ZhonTai.Admin.Core.Consts;
|
|
|
+using ZhonTai.Admin.Services.User;
|
|
|
+using ZhonTai.DynamicApi.Attributes;
|
|
|
+using ZhonTai.DynamicApi;
|
|
|
+using Microsoft.AspNetCore.Mvc;
|
|
|
+using ZhonTai.Admin.Core.Dto;
|
|
|
+using ZhonTai.Admin.Domain.Role;
|
|
|
+using ZhonTai.Admin.Domain.User;
|
|
|
+using ZhonTai.Admin.Services.User.Dto;
|
|
|
+using ZhonTai.Admin.Domain.UserRole;
|
|
|
+using ZhonTai.Admin.Domain.Project;
|
|
|
+using ZhonTai.Admin.Services.Project.Dto;
|
|
|
+
|
|
|
+namespace ZhonTai.Admin.Services.Project
|
|
|
+{
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ [Order(10)]
|
|
|
+ [DynamicApi(Area = AdminConsts.AreaName)]
|
|
|
+ public partial class ProjectService : BaseService, IProjectService, IDynamicApi
|
|
|
+ {
|
|
|
+ private IProjectRepository _projectRepository => LazyGetRequiredService<IProjectRepository>();
|
|
|
+ public ProjectService()
|
|
|
+ {
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ [HttpPost]
|
|
|
+ public async Task<PageOutput<ProjectGetPageOutput>> GetPageAsync(PageInput<ProjectGetPageInput> input)
|
|
|
+ {
|
|
|
+ var list = await _projectRepository.Select
|
|
|
+ .Count(out var total)
|
|
|
+ .OrderByDescending(true, a => a.Id)
|
|
|
+ .Page(input.CurrentPage, input.PageSize)
|
|
|
+ .ToListAsync(a => new ProjectGetPageOutput { name = a.name });
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ var data = new PageOutput<ProjectGetPageOutput>()
|
|
|
+ {
|
|
|
+ List = Mapper.Map<List<ProjectGetPageOutput>>(list),
|
|
|
+ Total = total
|
|
|
+ };
|
|
|
+
|
|
|
+ return data;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|