diff --git a/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Application.Contracts/Dtos/Recharge/RechargeGetListInput.cs b/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Application.Contracts/Dtos/Recharge/RechargeGetListInput.cs
new file mode 100644
index 00000000..341cf37c
--- /dev/null
+++ b/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Application.Contracts/Dtos/Recharge/RechargeGetListInput.cs
@@ -0,0 +1,24 @@
+using Yi.Framework.Ddd.Application.Contracts;
+
+namespace Yi.Framework.AiHub.Application.Contracts.Dtos.Recharge;
+
+///
+/// 充值记录查询输入
+///
+public class RechargeGetListInput : PagedAllResultRequestDto
+{
+ ///
+ /// 是否免费(充值金额等于0)
+ ///
+ public bool? IsFree { get; set; }
+
+ ///
+ /// 充值金额最小值
+ ///
+ public decimal? MinRechargeAmount { get; set; }
+
+ ///
+ /// 充值金额最大值
+ ///
+ public decimal? MaxRechargeAmount { get; set; }
+}
diff --git a/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Application.Contracts/IServices/IRechargeService.cs b/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Application.Contracts/IServices/IRechargeService.cs
index 838d392f..a80cb85f 100644
--- a/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Application.Contracts/IServices/IRechargeService.cs
+++ b/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Application.Contracts/IServices/IRechargeService.cs
@@ -1,9 +1,15 @@
-using Yi.Framework.AiHub.Application.Contracts.Dtos.Recharge;
+using Volo.Abp.Application.Dtos;
+using Yi.Framework.AiHub.Application.Contracts.Dtos.Recharge;
namespace Yi.Framework.AiHub.Application.Contracts.IServices;
public interface IRechargeService
{
+ ///
+ /// 查询已登录的账户充值记录(分页)
+ ///
+ Task> GetListByAccountAsync(RechargeGetListInput input);
+
///
/// 移除用户vip及角色
///
diff --git a/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Application/Services/RechargeService.cs b/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Application/Services/RechargeService.cs
index 312dac87..dbfd286f 100644
--- a/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Application/Services/RechargeService.cs
+++ b/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Application/Services/RechargeService.cs
@@ -1,6 +1,8 @@
using Mapster;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
+using SqlSugar;
+using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
using Volo.Abp.Users;
using Yi.Framework.AiHub.Application.Contracts.Dtos.Recharge;
@@ -35,19 +37,29 @@ namespace Yi.Framework.AiHub.Application.Services
}
///
- /// 查询已登录的账户充值记录
+ /// 查询已登录的账户充值记录(分页)
///
///
[Route("recharge/account")]
[Authorize]
- public async Task> GetListByAccountAsync()
+ public async Task> GetListByAccountAsync([FromQuery]RechargeGetListInput input)
{
var userId = CurrentUser.Id;
- var entities = await _repository._DbQueryable.Where(x => x.UserId == userId)
+ RefAsync total = 0;
+
+ var entities = await _repository._DbQueryable
+ .Where(x => x.UserId == userId)
+ .WhereIF(input.StartTime.HasValue, x => x.CreationTime >= input.StartTime!.Value)
+ .WhereIF(input.EndTime.HasValue, x => x.CreationTime <= input.EndTime!.Value)
+ .WhereIF(input.IsFree == true, x => x.RechargeAmount == 0)
+ .WhereIF(input.IsFree == false, x => x.RechargeAmount > 0)
+ .WhereIF(input.MinRechargeAmount.HasValue, x => x.RechargeAmount >= input.MinRechargeAmount!.Value)
+ .WhereIF(input.MaxRechargeAmount.HasValue, x => x.RechargeAmount <= input.MaxRechargeAmount!.Value)
.OrderByDescending(x => x.CreationTime)
- .ToListAsync();
+ .ToPageListAsync(input.SkipCount, input.MaxResultCount, total);
+
var output = entities.Adapt>();
- return output;
+ return new PagedResultDto(total, output);
}
///