feat: 支付完成后自动为用户充值VIP并支持按商品类型计算有效期

This commit is contained in:
ccnetcore
2025-08-13 22:19:31 +08:00
parent 3a60bcc174
commit 40c0a5ac64
8 changed files with 98 additions and 24 deletions

View File

@@ -1,3 +1,4 @@
using System.ComponentModel.DataAnnotations;
using Yi.Framework.AiHub.Domain.Shared.Enums;
namespace Yi.Framework.AiHub.Application.Contracts.Dtos.Pay;
@@ -10,5 +11,6 @@ public class CreateOrderInput
/// <summary>
/// 商品类型
/// </summary>
[Required]
public GoodsTypeEnum GoodsType { get; set; }
}

View File

@@ -25,9 +25,10 @@ public class RechargeCreateInput
public string Content { get; set; } = string.Empty;
/// <summary>
/// 到期时间为空表示永久VIP
/// VIP月数(为空或0表示永久VIP
/// </summary>
public DateTime? ExpireDateTime { get; set; }
[Range(0, int.MaxValue, ErrorMessage = "月数必须大于等于0")]
public int? Months { get; set; }
/// <summary>
/// 备注

View File

@@ -1,4 +1,6 @@
namespace Yi.Framework.AiHub.Application.Contracts.IServices;
using Yi.Framework.AiHub.Application.Contracts.Dtos.Recharge;
namespace Yi.Framework.AiHub.Application.Contracts.IServices;
public interface IRechargeService
{
@@ -6,4 +8,11 @@ public interface IRechargeService
/// 移除用户vip及角色
/// </summary>
Task RemoveVipRoleByExpireAsync();
/// <summary>
/// 给用户充值VIP
/// </summary>
/// <param name="input">充值输入参数</param>
/// <returns></returns>
Task RechargeVipAsync(RechargeCreateInput input);
}