From ad336e12a05cf87c0dd6bda57f320c007933e2af Mon Sep 17 00:00:00 2001
From: bibabo <765221495@qq.com>
Date: Sat, 20 Jul 2024 15:27:45 +0800
Subject: [PATCH] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E4=BA=A4=E6=98=93=E8=AE=B0?=
=?UTF-8?q?=E5=BD=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../DbSqlServer/Db_MiaoYu/MiaoYuContext.cs | 18 +++++------
.../Db_MiaoYu/T_TransactionRecord.cs | 12 +++----
.../DbSqlServer/Db_MiaoYu/T_User.cs | 5 ---
.../Dto/Account/MyAccountInfoDto.cs | 31 +++++++++++++++++++
.../Controllers/AccountController.cs | 12 +++++++
5 files changed, 57 insertions(+), 21 deletions(-)
diff --git a/src/0-core/HuanMeng.MiaoYu.Model/DbSqlServer/Db_MiaoYu/MiaoYuContext.cs b/src/0-core/HuanMeng.MiaoYu.Model/DbSqlServer/Db_MiaoYu/MiaoYuContext.cs
index 3460a3a..3682d47 100644
--- a/src/0-core/HuanMeng.MiaoYu.Model/DbSqlServer/Db_MiaoYu/MiaoYuContext.cs
+++ b/src/0-core/HuanMeng.MiaoYu.Model/DbSqlServer/Db_MiaoYu/MiaoYuContext.cs
@@ -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地址");
diff --git a/src/0-core/HuanMeng.MiaoYu.Model/DbSqlServer/Db_MiaoYu/T_TransactionRecord.cs b/src/0-core/HuanMeng.MiaoYu.Model/DbSqlServer/Db_MiaoYu/T_TransactionRecord.cs
index 6a76d44..aadf1bd 100644
--- a/src/0-core/HuanMeng.MiaoYu.Model/DbSqlServer/Db_MiaoYu/T_TransactionRecord.cs
+++ b/src/0-core/HuanMeng.MiaoYu.Model/DbSqlServer/Db_MiaoYu/T_TransactionRecord.cs
@@ -18,12 +18,12 @@ public partial class T_TransactionRecord: MultiTenantEntity
public int UserId { get; set; }
///
- /// 交易类型0购买金币1兑换道具
+ /// 交易类型0充值金币1赠送金币2兑换道具
///
- public string? PayType { get; set; }
+ public string TransactionType { get; set; } = null!;
///
- /// 货币Id 用来区分是免费还是购买
+ /// 货币Id 用来区分购买的是哪个套餐
///
public int? CurrenyId { get; set; }
@@ -33,12 +33,12 @@ public partial class T_TransactionRecord: MultiTenantEntity
public DateTime TransactionTime { get; set; }
///
- /// 金币数量
+ /// 金币数量,正负值。充值获得的和实际消耗的
///
- public string? CurrencyCount { get; set; }
+ public decimal? CurrencyCount { get; set; }
///
- /// 交易金额 如果是购买金币,记录实际支付的金额
+ /// 交易金额 如果是充值金币,记录实际支付的金额
///
public decimal? TransactionAmount { get; set; }
diff --git a/src/0-core/HuanMeng.MiaoYu.Model/DbSqlServer/Db_MiaoYu/T_User.cs b/src/0-core/HuanMeng.MiaoYu.Model/DbSqlServer/Db_MiaoYu/T_User.cs
index a4d50ed..8e97d1e 100644
--- a/src/0-core/HuanMeng.MiaoYu.Model/DbSqlServer/Db_MiaoYu/T_User.cs
+++ b/src/0-core/HuanMeng.MiaoYu.Model/DbSqlServer/Db_MiaoYu/T_User.cs
@@ -67,9 +67,4 @@ public partial class T_User: MultiTenantEntity
/// Ip地址
///
public string? Ip { get; set; }
-
- ///
- /// 金币数量
- ///
- public int? GoldCoinCount { get; set; }
}
diff --git a/src/0-core/HuanMeng.MiaoYu.Model/Dto/Account/MyAccountInfoDto.cs b/src/0-core/HuanMeng.MiaoYu.Model/Dto/Account/MyAccountInfoDto.cs
index a5ce433..a990dec 100644
--- a/src/0-core/HuanMeng.MiaoYu.Model/Dto/Account/MyAccountInfoDto.cs
+++ b/src/0-core/HuanMeng.MiaoYu.Model/Dto/Account/MyAccountInfoDto.cs
@@ -57,4 +57,35 @@ namespace HuanMeng.MiaoYu.Model.Dto.Account
///
public string? ImgUrl { get; set; }
}
+
+ ///
+ /// 交易
+ ///
+ public class Transaction
+ {
+ ///
+ /// 交易内容
+ ///
+ public string TransactionContent { get; set; }
+
+ ///
+ /// 交易时间
+ ///
+ public DateTime TransactionTime { get; set; }
+
+ ///
+ /// 交易数量
+ ///
+ public decimal TransactionAmount { get; set; }
+
+ ///
+ /// 0充值金币1赠送金币2兑换道具
+ ///
+ public int TransactionType { get; set; }
+
+ ///
+ /// 0语珠
+ ///
+ public int CurrencyType { get; set; }
+ }
}
diff --git a/src/2-api/HuanMeng.MiaoYu.WebApi/Controllers/AccountController.cs b/src/2-api/HuanMeng.MiaoYu.WebApi/Controllers/AccountController.cs
index f61766b..6b9766b 100644
--- a/src/2-api/HuanMeng.MiaoYu.WebApi/Controllers/AccountController.cs
+++ b/src/2-api/HuanMeng.MiaoYu.WebApi/Controllers/AccountController.cs
@@ -83,5 +83,17 @@ namespace HuanMeng.MiaoYu.WebApi.Controllers
var obj = JsonConvert.DeserializeObject("{\"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(ResonseCode.Success, "", obj);
}
+
+ ///
+ /// 获取交易记录
+ ///
+ ///
+ [AllowAnonymous]
+ [HttpGet]
+ public async Task>> GetTransactionRecords()
+ {
+ var obj = JsonConvert.DeserializeObject>("[{\"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>(ResonseCode.Success, "", obj);
+ }
}
}