42 lines
1.1 KiB
C#
42 lines
1.1 KiB
C#
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;
|
|
}
|
|
}
|
|
}
|