diff --git a/src/0-core/HuanMeng.MiaoYu.Code/Users/UserBLL.cs b/src/0-core/HuanMeng.MiaoYu.Code/Users/UserBLL.cs index 172af68..26e18c0 100644 --- a/src/0-core/HuanMeng.MiaoYu.Code/Users/UserBLL.cs +++ b/src/0-core/HuanMeng.MiaoYu.Code/Users/UserBLL.cs @@ -118,12 +118,8 @@ namespace HuanMeng.MiaoYu.Code.Users Currency = userData.Currency, UserIconUrl = userData.UserIconUrl, RemainingChatCount = 1,//这里先写1,我不会decimal转int - //CharacterInfo = new CreateCharacterInfo - //{ - // CharacterId =1, - // CharacterName = "林婉儿", - // BgImage= "https://cos.shhuanmeng.com/image/icon/%E6%9E%97%E5%A9%89%E5%84%BF.png" - //} + HasTalked=1, + Photographs=1, CharacterInfo = new List { new CreateCharacterInfo @@ -139,6 +135,11 @@ namespace HuanMeng.MiaoYu.Code.Users BgImage = "https://cos.shhuanmeng.com/image/icon/%E6%9E%97%E5%A9%89%E5%84%BF.png" } // 可以继续添加更多的 CreateCharacterInfo 对象 + }, + InviteNewUser = new InviteNewUserDto + { + ImgUrl = "https://cos.shhuanmeng.com/image/icon/20240720205857.png", + Type = 0 } }); } 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 ccbc32a..6457ff2 100644 --- a/src/0-core/HuanMeng.MiaoYu.Model/Dto/Account/MyAccountInfoDto.cs +++ b/src/0-core/HuanMeng.MiaoYu.Model/Dto/Account/MyAccountInfoDto.cs @@ -58,102 +58,5 @@ 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; } - } - - /// - /// 商城在售 - /// - 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/0-core/HuanMeng.MiaoYu.Model/Dto/Account/TransactionDto.cs b/src/0-core/HuanMeng.MiaoYu.Model/Dto/Account/TransactionDto.cs new file mode 100644 index 0000000..fd95ca8 --- /dev/null +++ b/src/0-core/HuanMeng.MiaoYu.Model/Dto/Account/TransactionDto.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace HuanMeng.MiaoYu.Model.Dto.Account +{ + /// + /// 交易 + /// + public class TransactionDto + { + /// + /// 交易内容 + /// + 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/0-core/HuanMeng.MiaoYu.Model/Dto/ResponseUserInfo.cs b/src/0-core/HuanMeng.MiaoYu.Model/Dto/ResponseUserInfo.cs index 7054397..bfb37d9 100644 --- a/src/0-core/HuanMeng.MiaoYu.Model/Dto/ResponseUserInfo.cs +++ b/src/0-core/HuanMeng.MiaoYu.Model/Dto/ResponseUserInfo.cs @@ -34,7 +34,7 @@ namespace HuanMeng.MiaoYu.Model.Dto public string? NickName { get; set; } /// - /// 聊天次数 + /// 剩余聊天次数 /// public int RemainingChatCount { get; set; } @@ -46,6 +46,37 @@ namespace HuanMeng.MiaoYu.Model.Dto /// /// 记忆卡数量 /// - public int MemoryCardCount { get; set; } + public int MemoryCardCount { get; set; } + + /// + /// 邀请新用户 + /// + public InviteNewUserDto InviteNewUser { get; set; } + + /// + /// 聊过 + /// + public int HasTalked { get; set; } + + /// + /// 相册 + /// + public int Photographs { get; set; } + } + + /// + /// 邀请新用户 + /// + public class InviteNewUserDto + { + /// + /// 图片地址 + /// + public string ImgUrl { get; set; } + + /// + /// 图片类型 0分享邀请新人 + /// + public int Type { get; set; } } } diff --git a/src/0-core/HuanMeng.MiaoYu.Model/Dto/Shop/ShopInfoDto.cs b/src/0-core/HuanMeng.MiaoYu.Model/Dto/Shop/ShopInfoDto.cs new file mode 100644 index 0000000..9619795 --- /dev/null +++ b/src/0-core/HuanMeng.MiaoYu.Model/Dto/Shop/ShopInfoDto.cs @@ -0,0 +1,99 @@ +using HuanMeng.MiaoYu.Model.Dto.Account; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace HuanMeng.MiaoYu.Model.Dto.Shop +{ + /// + /// 商城页面实体 + /// + public class ShopInfoDto + { + /// + /// 商城在售 + /// + public List Mall { get; set; } + + /// + /// 已拥有 + /// + public List Purchased { get; set; } + } + + /// + /// 商城在售 + /// + public class MallItemDto : PropInfoDto + { + ///// + ///// 道具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 PropInfoDto + { + /// + /// 道具id + /// + public int PropId { get; set; } + + /// + /// 道具名称 + /// + public string PropName { get; set; } + + /// + /// 图片地址 + /// + public string ImgUrl { 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 ebd29e5..4b71537 100644 --- a/src/2-api/HuanMeng.MiaoYu.WebApi/Controllers/AccountController.cs +++ b/src/2-api/HuanMeng.MiaoYu.WebApi/Controllers/AccountController.cs @@ -90,10 +90,10 @@ namespace HuanMeng.MiaoYu.WebApi.Controllers /// [AllowAnonymous] [HttpGet] - public async Task>> GetTransactionRecords() + 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); + 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); } /// diff --git a/src/2-api/HuanMeng.MiaoYu.WebApi/Controllers/ChatController.cs b/src/2-api/HuanMeng.MiaoYu.WebApi/Controllers/ChatController.cs index 50b8273..46515c6 100644 --- a/src/2-api/HuanMeng.MiaoYu.WebApi/Controllers/ChatController.cs +++ b/src/2-api/HuanMeng.MiaoYu.WebApi/Controllers/ChatController.cs @@ -4,6 +4,7 @@ using HuanMeng.MiaoYu.Code.Character; using HuanMeng.MiaoYu.Code.Chat; using HuanMeng.MiaoYu.Model.Dto.Character; using HuanMeng.MiaoYu.Model.Dto.Chat; +using HuanMeng.MiaoYu.Model.Dto.Shop; using HuanMeng.MiaoYu.WebApi.Base; using Microsoft.AspNetCore.Authorization; @@ -129,10 +130,23 @@ namespace HuanMeng.MiaoYu.WebApi.Controllers /// /// [HttpGet] + [AllowAnonymous] public async Task>> GetChatHistoryList() { var obj = await _chatBLL.GetChatHistoryList(); return obj; } + + /// + /// 获取记忆卡列表 + /// + /// + [HttpGet] + [AllowAnonymous] + public async Task>> GetMemoryCardInfo() + { + var obj = JsonConvert.DeserializeObject>("[{\"PropId\":\"1\",\"PropName\":\"记忆卡1\",\"ImgUrl\":\"\"},{\"PropId\":\"2\",\"PropName\":\"记忆卡2\",\"ImgUrl\":\"\"}]"); + return new BaseResponse>(ResonseCode.Success, "", obj); + } } } diff --git a/src/2-api/HuanMeng.MiaoYu.WebApi/HuanMeng.MiaoYu.WebApi.csproj b/src/2-api/HuanMeng.MiaoYu.WebApi/HuanMeng.MiaoYu.WebApi.csproj index 11ffe9c..7d7a0e1 100644 --- a/src/2-api/HuanMeng.MiaoYu.WebApi/HuanMeng.MiaoYu.WebApi.csproj +++ b/src/2-api/HuanMeng.MiaoYu.WebApi/HuanMeng.MiaoYu.WebApi.csproj @@ -1,4 +1,4 @@ - + net8.0 diff --git a/src/2-api/HuanMeng.MiaoYu.WebApi/Pay-config/wxpay.json b/src/2-api/HuanMeng.MiaoYu.WebApi/Pay-config/wxpay.json new file mode 100644 index 0000000..58efb04 --- /dev/null +++ b/src/2-api/HuanMeng.MiaoYu.WebApi/Pay-config/wxpay.json @@ -0,0 +1,5 @@ +{ + "AppID": "", //网站的唯一标识 + "MchID": "", //商户ID + "Key": "" +}