using GDZZ.Core; using Furion.DependencyInjection; using Furion.DynamicApiController; using Mapster; using Microsoft.AspNetCore.Mvc; using SqlSugar; using System.Linq; using System.Threading.Tasks; using GDZZ.Application.Entity; using System.Collections.Generic; namespace GDZZ.Application { /// /// 提现管理服务 /// [ApiDescriptionSettings("Application",Name = "Taking", Order = 1)] public class TakingService : ITakingService, IDynamicApiController, ITransient { private readonly SqlSugarRepository _rep; public TakingService(SqlSugarRepository rep) { _rep = rep; } /// /// 查询提现列表 /// /// /// [HttpGet("/Mini/Taking/list")] public async Task> List() { var list = await this._rep.AsQueryable().Where(x => x.CreatedUserId == UserManager.UserId).Select().ToListAsync(); return list; } /// /// 分页查询提现管理 /// /// /// [HttpGet("/Mini/Taking/page")] public async Task Page([FromQuery] TakingInput input) { var entities = await _rep.AsQueryable() .WhereIF(!input.Status.IsEmpty(), u => u.Status == input.Status) .WhereIF(!string.IsNullOrWhiteSpace(input.OpenID), u => u.OpenID == input.OpenID) .WhereIF(!string.IsNullOrWhiteSpace(input.WXOrderNo), u => u.WXOrderNo == input.WXOrderNo) .ToPagedListAsync(input.PageNo, input.PageSize); return entities.XnPagedResult(); } } }