From 752bedc4e29ec9620dc12442414241a026cc2864 Mon Sep 17 00:00:00 2001 From: bibabo <765221495@qq.com> Date: Sat, 20 Jul 2024 16:20:56 +0800 Subject: [PATCH] =?UTF-8?q?=E5=95=86=E5=9F=8E=E5=95=86=E5=93=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Dto/Account/MyAccountInfoDto.cs | 68 +++++++++++++++++++ .../Controllers/AccountController.cs | 14 +++- 2 files changed, 81 insertions(+), 1 deletion(-) 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 a990dec..ccbc32a 100644 --- a/src/0-core/HuanMeng.MiaoYu.Model/Dto/Account/MyAccountInfoDto.cs +++ b/src/0-core/HuanMeng.MiaoYu.Model/Dto/Account/MyAccountInfoDto.cs @@ -88,4 +88,72 @@ namespace HuanMeng.MiaoYu.Model.Dto.Account /// public int CurrencyType { get; set; } } + + /// + /// 商城在售 + /// + public class MallItemDto + { + /// + /// 道具id + /// + public int PropId { get; set; } + + /// + /// 道具名称 + /// + public string PropName { get; set; } + + /// + /// 道具剩余数量 + /// + public int PropCount { get; set; } + + /// + /// 道具类型 + /// + public int PropType { get; set; } + + /// + /// 金额 + /// + public decimal Price { get; set; } + + /// + /// 支付类型 0 语珠 1 RMB + /// + public int PriceType { get; set; } + + /// + /// 图片地址 + /// + public string ImgUrl { get; set; } + } + + /// + /// 已拥有 + /// + public class PurchasedItemDto: MallItemDto + { + /// + /// 购买时间 + /// + public DateTime BuyingTime { get; set; } + } + + /// + /// 商城 + /// + public class ShopInfoDto + { + /// + /// 商城在售 + /// + public List Mall { get; set; } + + /// + /// 已拥有 + /// + public List Purchased { 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 6b9766b..ebd29e5 100644 --- a/src/2-api/HuanMeng.MiaoYu.WebApi/Controllers/AccountController.cs +++ b/src/2-api/HuanMeng.MiaoYu.WebApi/Controllers/AccountController.cs @@ -85,7 +85,7 @@ namespace HuanMeng.MiaoYu.WebApi.Controllers } /// - /// 获取交易记录 + /// 我的 - 获取交易记录 /// /// [AllowAnonymous] @@ -95,5 +95,17 @@ namespace HuanMeng.MiaoYu.WebApi.Controllers 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); } + + /// + /// 商城 - 获取商城商品 + /// + /// + [AllowAnonymous] + [HttpGet] + public async Task> GetMallItem() + { + var obj = JsonConvert.DeserializeObject("{\"Mall\":[{\"PropId\":1,\"PropName\":\"记忆卡1\",\"PropCount\":100,\"PropType\":0,\"Price\":10,\"PriceType\":0,\"ImgUrl\":\"https://cos.shhuanmeng.com/image/20240718110512.png\"},{\"PropId\":2,\"PropName\":\"记忆卡2\",\"PropCount\":100,\"PropType\":0,\"Price\":20,\"PriceType\":0,\"ImgUrl\":\"https://cos.shhuanmeng.com/image/20240718110518.png\"}],\"Purchased\":[{\"PropId\":2,\"PropName\":\"记忆卡2\",\"PropCount\":100,\"PropType\":0,\"Price\":20,\"PriceType\":0,\"ImgUrl\":\"https://cos.shhuanmeng.com/image/20240718110518.png\",\"BuyingTime\":\"2024-07-09 03:33:09.563\"}]}"); + return new BaseResponse(ResonseCode.Success, "", obj); + } } }