获取交易记录

This commit is contained in:
bibabo 2024-07-20 15:27:45 +08:00
parent 9e624108ac
commit ad336e12a0
5 changed files with 57 additions and 21 deletions

View File

@ -456,21 +456,20 @@ public partial class MiaoYuContext : MultiTenantDbContext//DbContext
.HasComment("创建时间")
.HasColumnType("datetime");
entity.Property(e => e.CurrencyCount)
.HasMaxLength(255)
.IsUnicode(false)
.HasComment("金币数量");
entity.Property(e => e.CurrenyId).HasComment("货币Id 用来区分是免费还是购买");
entity.Property(e => e.PayType)
.HasMaxLength(255)
.IsUnicode(false)
.HasComment("交易类型0购买金币1兑换道具");
.HasComment("金币数量,正负值。充值获得的和实际消耗的")
.HasColumnType("decimal(18, 0)");
entity.Property(e => e.CurrenyId).HasComment("货币Id 用来区分购买的是哪个套餐");
entity.Property(e => e.TenantId).HasComment("租户id");
entity.Property(e => e.TransactionAmount)
.HasComment("交易金额 如果是购买金币,记录实际支付的金额")
.HasComment("交易金额 如果是充值金币,记录实际支付的金额")
.HasColumnType("decimal(18, 0)");
entity.Property(e => e.TransactionTime)
.HasComment("交易时间")
.HasColumnType("datetime");
entity.Property(e => e.TransactionType)
.HasMaxLength(255)
.IsUnicode(false)
.HasComment("交易类型0充值金币1赠送金币2兑换道具");
entity.Property(e => e.UpdateTime)
.HasComment("更新时间")
.HasColumnType("datetime");
@ -495,7 +494,6 @@ public partial class MiaoYuContext : MultiTenantDbContext//DbContext
entity.Property(e => e.Email)
.HasMaxLength(255)
.HasComment("绑定的邮箱");
entity.Property(e => e.GoldCoinCount).HasComment("金币数量");
entity.Property(e => e.Ip)
.HasMaxLength(100)
.HasComment("Ip地址");

View File

@ -18,12 +18,12 @@ public partial class T_TransactionRecord: MultiTenantEntity
public int UserId { get; set; }
/// <summary>
/// 交易类型0购买金币1兑换道具
/// 交易类型0充值金币1赠送金币2兑换道具
/// </summary>
public string? PayType { get; set; }
public string TransactionType { get; set; } = null!;
/// <summary>
/// 货币Id 用来区分是免费还是购买
/// 货币Id 用来区分购买的是哪个套餐
/// </summary>
public int? CurrenyId { get; set; }
@ -33,12 +33,12 @@ public partial class T_TransactionRecord: MultiTenantEntity
public DateTime TransactionTime { get; set; }
/// <summary>
/// 金币数量
/// 金币数量,正负值。充值获得的和实际消耗的
/// </summary>
public string? CurrencyCount { get; set; }
public decimal? CurrencyCount { get; set; }
/// <summary>
/// 交易金额 如果是购买金币,记录实际支付的金额
/// 交易金额 如果是充值金币,记录实际支付的金额
/// </summary>
public decimal? TransactionAmount { get; set; }

View File

@ -67,9 +67,4 @@ public partial class T_User: MultiTenantEntity
/// Ip地址
/// </summary>
public string? Ip { get; set; }
/// <summary>
/// 金币数量
/// </summary>
public int? GoldCoinCount { get; set; }
}

View File

@ -57,4 +57,35 @@ namespace HuanMeng.MiaoYu.Model.Dto.Account
/// </summary>
public string? ImgUrl { get; set; }
}
/// <summary>
/// 交易
/// </summary>
public class Transaction
{
/// <summary>
/// 交易内容
/// </summary>
public string TransactionContent { get; set; }
/// <summary>
/// 交易时间
/// </summary>
public DateTime TransactionTime { get; set; }
/// <summary>
/// 交易数量
/// </summary>
public decimal TransactionAmount { get; set; }
/// <summary>
/// 0充值金币1赠送金币2兑换道具
/// </summary>
public int TransactionType { get; set; }
/// <summary>
/// 0语珠
/// </summary>
public int CurrencyType { get; set; }
}
}

View File

@ -83,5 +83,17 @@ namespace HuanMeng.MiaoYu.WebApi.Controllers
var obj = JsonConvert.DeserializeObject<MyAccountInfoDto>("{\"Currency\":1,\"CurrencyRechargeList\":[{\"Id\":0,\"CurrencyCount\":100,\"Price\":10,\"Discount\":\" 0%\",\"CurrencyType\":0,\"ImgUrl\":\"\"},{\"Id\":1,\"CurrencyCount\":200,\"Price\":20,\"Discount\":\" -10%\",\"CurrencyType\":0,\"ImgUrl\":\"\"}]}");
return new BaseResponse<MyAccountInfoDto>(ResonseCode.Success, "", obj);
}
/// <summary>
/// 获取交易记录
/// </summary>
/// <returns></returns>
[AllowAnonymous]
[HttpGet]
public async Task<BaseResponse<List<Transaction>>> GetTransactionRecords()
{
var obj = JsonConvert.DeserializeObject<List<Transaction>>("[{\"TransactionContent\":\"购买记忆提升道具卡\",\"TransactionTime\":\"2024-07-18 12:58:52.963\",\"TransactionAmount\":\"-10\",\"TransactionType\":0,\"CurrencyType\":0},{\"TransactionContent\":\"充值语珠\",\"TransactionTime\":\"2024-07-17 12:58:52.963\",\"TransactionAmount\":\"+100\",\"TransactionType\":0,\"CurrencyType\":0},{\"TransactionContent\":\"充值语珠\",\"TransactionTime\":\"2024-07-16 12:58:52.963\",\"TransactionAmount\":\"+200\",\"TransactionType\":0,\"CurrencyType\":0}]");
return new BaseResponse<List<Transaction>>(ResonseCode.Success, "", obj);
}
}
}