后台数据表建立
This commit is contained in:
41
20220330_Vote/Vote.Services/ApiController/ProjectsService.cs
Normal file
41
20220330_Vote/Vote.Services/ApiController/ProjectsService.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
using Furion.DatabaseAccessor;
|
||||
using Furion.DynamicApiController;
|
||||
using Mapster;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Vote.Services.Dto;
|
||||
|
||||
namespace Vote.Services.ApiController
|
||||
{
|
||||
/// <summary>
|
||||
/// 项目
|
||||
/// </summary>
|
||||
[ApiDescriptionSettings("Vote", Order = 0)]
|
||||
public class ProjectsService : IDynamicApiController
|
||||
{
|
||||
private readonly IRepository<Entities.Projects> rep_Projects;
|
||||
public ProjectsService(IRepository<Entities.Projects> _rep_Projects)
|
||||
{
|
||||
rep_Projects = _rep_Projects;
|
||||
}
|
||||
/// <summary>
|
||||
/// 列表
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Microsoft.AspNetCore.Authorization.AllowAnonymous]
|
||||
public async Task<dynamic> List()
|
||||
{
|
||||
var data = await rep_Projects.DetachedEntities.Where(p => !p.IsDeleted)
|
||||
//.ProjectToType<ProjectsOutput>()
|
||||
.OrderBy(a => a.serial_number)
|
||||
.ToPagedListAsync();
|
||||
|
||||
return data;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user