新增充值记录查询接口

development
温天培 2 years ago
parent e483bacd81
commit 41d0ca2d1b

@ -0,0 +1,28 @@
using GDZZ.Core.Entity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GDZZ.Application.Service.WXPay.Dto
{
public class RechargeOut: DEntityBase
{
/// <summary>
/// 总价格
/// </summary>
public decimal TotalPrice { get; set; }
/// <summary>
/// 支付金额
/// </summary>
public decimal PaymentMoney { get; set; }
/// <summary>
/// 充值状态
/// </summary>
public int Status { get; set; }
}
}

@ -20,6 +20,8 @@ using System.IO;
using System.Text;
using Senparc.Weixin.Exceptions;
using Microsoft.AspNetCore.Authorization;
using System.Collections.Generic;
using Mapster;
namespace GDZZ.Application.Service.WXPay
{
@ -33,7 +35,7 @@ namespace GDZZ.Application.Service.WXPay
private readonly SqlSugarRepository<SysUser> _sysUserRep; // 用户表仓储
private readonly SqlSugarRepository<SysTenant> _sysTenantRep; //租户仓储
private readonly SqlSugarRepository<SeIF> self; //职业仓储
private readonly SqlSugarRepository<Balance> balance; //职业仓储
private readonly SqlSugarRepository<Balance> balance; //余额仓储
private readonly SqlSugarRepository<MiniRecharge> rechargeRep; //充值仓储
private readonly SqlSugarRepository<MiniPayTake> payTakeRep; //支付仓储
@ -85,7 +87,7 @@ namespace GDZZ.Application.Service.WXPay
[Route("Mini/v1/GetUserBalance")]
public async Task<BalanceOut> GetUserBalance()
{
var balan = await this.balance.SingleAsync(x => x.UserID == UserManager.UserId);
var balan = await this.balance.AsQueryable().Filter("TenantId", true).SingleAsync(x => x.UserID == UserManager.UserId);
if (balan == null)
return null;
@ -96,6 +98,18 @@ namespace GDZZ.Application.Service.WXPay
};
}
/// <summary>
/// 充值记录查询
/// </summary>
/// <returns></returns>
[HttpGet]
[Route("Mini/v1/GetRechargeList")]
public async Task<List<RechargeOut>> GetRechargeList()
{
var rechargeLiist = this.rechargeRep.Where(x => x.CreatedUserId == UserManager.UserId).ToListAsync();
return rechargeLiist.Adapt<List<RechargeOut>>();
}

Loading…
Cancel
Save