From b300c7df52e60b0f8310683c925658c04961ed9c Mon Sep 17 00:00:00 2001 From: zpc Date: Fri, 12 Jul 2024 16:43:37 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/0-core/HuanMeng.MiaoYu.Code/Base/MiaoYuBase.cs | 2 ++ .../Controllers/ChatController.cs | 13 +++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/0-core/HuanMeng.MiaoYu.Code/Base/MiaoYuBase.cs b/src/0-core/HuanMeng.MiaoYu.Code/Base/MiaoYuBase.cs index b8fc698..00d8cdf 100644 --- a/src/0-core/HuanMeng.MiaoYu.Code/Base/MiaoYuBase.cs +++ b/src/0-core/HuanMeng.MiaoYu.Code/Base/MiaoYuBase.cs @@ -33,6 +33,7 @@ namespace HuanMeng.MiaoYu.Code.Base { } + #region 数据库 private DAO _dao; /// /// dao 数据库 @@ -48,6 +49,7 @@ namespace HuanMeng.MiaoYu.Code.Base return _dao; } } + #endregion #region 租户信息 /// diff --git a/src/2-api/HuanMeng.MiaoYu.WebApi/Controllers/ChatController.cs b/src/2-api/HuanMeng.MiaoYu.WebApi/Controllers/ChatController.cs index 03007b1..890f777 100644 --- a/src/2-api/HuanMeng.MiaoYu.WebApi/Controllers/ChatController.cs +++ b/src/2-api/HuanMeng.MiaoYu.WebApi/Controllers/ChatController.cs @@ -1,13 +1,19 @@ using HuanMeng.DotNetCore.Base; using HuanMeng.MiaoYu.Model.Dto.Home; using HuanMeng.MiaoYu.WebApi.Base; + using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; + using Newtonsoft.Json; namespace HuanMeng.MiaoYu.WebApi.Controllers { + /// + /// 聊天记录 + /// [Route("api/[controller]/[action]")] + [Authorize] [ApiController] public class ChatController : MiaoYuControllerBase { @@ -21,9 +27,9 @@ namespace HuanMeng.MiaoYu.WebApi.Controllers /// /// [HttpGet] - [AllowAnonymous] - public async Task> GetCharacterInfo(int userId) + public async Task> GetCharacterInfo() { + var obj = JsonConvert.DeserializeObject("{\"Icon\":\"\",\"Intimacy\":10,\"CharacterId\":2,\"CharacterName\":\"许荷姻\",\"Gender\":1,\"LookCount\":2,\"BgUrl\":\"\",\"Biography\":\"你那商业联姻得来的妻子,原本的天才女孩,聪明伶俐,生的漂亮、端庄,不知贵圈多少人梦寐以求的存在。\",\"Prologue\":\"坐在轮椅上,眼神平静的看着你,语气也同样平静)你回来了。饭菜在桌上,我刚刚热了。(说到这,又垂下眸子道)我还做了碗醒酒汤,记得喝\",\"Label\":[{\"Id\":1,\"Name\":\"美女\"},{\"Id\":2,\"Name\":\"二次元\"}],\"RemainingChatCount\":1}"); return new BaseResponse(ResonseCode.Success, "", obj); @@ -35,8 +41,7 @@ namespace HuanMeng.MiaoYu.WebApi.Controllers /// /// [HttpGet] - [AllowAnonymous] - public async Task> GetChatInfo(int userId) + public async Task> GetChatInfo() { var obj = JsonConvert.DeserializeObject("{\"ChatList\":[{\"Id\":\"1\",\"Role\":\"user\",\"Content\":\"Hello, how are you?\",\"Timestamp\":\"2022-03-01 12:00:00 \",\"MessageType\":0,\"UserIcon\":\"\"},{\"Id\":\"2\",\"Role\":\"assistant\",\"Content\":\"I'm fine, thanks!\",\"Timestamp\":\"2022-03-01 12:05:00 \",\"UserIcon\":\"\"}]}"); return new BaseResponse(ResonseCode.Success, "", obj); From cb73982ef0b97a578121b7eed8010c47a0589e28 Mon Sep 17 00:00:00 2001 From: zpc Date: Fri, 12 Jul 2024 16:56:46 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=AA=8C=E8=AF=81?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 5 ++++- src/0-core/HuanMeng.Utility/Class1.cs | 9 --------- .../Other => HuanMeng.Utility}/PhoneNumberValidator.cs | 4 +--- .../Controllers/AccountController.cs | 6 ++++-- 4 files changed, 9 insertions(+), 15 deletions(-) delete mode 100644 src/0-core/HuanMeng.Utility/Class1.cs rename src/0-core/{HuanMeng.MiaoYu.Code/Other => HuanMeng.Utility}/PhoneNumberValidator.cs (88%) diff --git a/README.md b/README.md index 4606568..92729b3 100644 --- a/README.md +++ b/README.md @@ -1 +1,4 @@ -# HuanMengProject \ No newline at end of file +# HuanMengProject 开发文档 + + +### \ No newline at end of file diff --git a/src/0-core/HuanMeng.Utility/Class1.cs b/src/0-core/HuanMeng.Utility/Class1.cs deleted file mode 100644 index 1b9f903..0000000 --- a/src/0-core/HuanMeng.Utility/Class1.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System; - -namespace HuanMeng.Utility -{ - public class Class1 - { - - } -} diff --git a/src/0-core/HuanMeng.MiaoYu.Code/Other/PhoneNumberValidator.cs b/src/0-core/HuanMeng.Utility/PhoneNumberValidator.cs similarity index 88% rename from src/0-core/HuanMeng.MiaoYu.Code/Other/PhoneNumberValidator.cs rename to src/0-core/HuanMeng.Utility/PhoneNumberValidator.cs index 57611c9..efb7fb3 100644 --- a/src/0-core/HuanMeng.MiaoYu.Code/Other/PhoneNumberValidator.cs +++ b/src/0-core/HuanMeng.Utility/PhoneNumberValidator.cs @@ -1,11 +1,9 @@ using System; using System.Collections.Generic; -using System.Linq; using System.Text; using System.Text.RegularExpressions; -using System.Threading.Tasks; -namespace HuanMeng.MiaoYu.Code.Other +namespace HuanMeng.Utility { /// /// 手机号 diff --git a/src/2-api/HuanMeng.MiaoYu.WebApi/Controllers/AccountController.cs b/src/2-api/HuanMeng.MiaoYu.WebApi/Controllers/AccountController.cs index efad636..e1a9305 100644 --- a/src/2-api/HuanMeng.MiaoYu.WebApi/Controllers/AccountController.cs +++ b/src/2-api/HuanMeng.MiaoYu.WebApi/Controllers/AccountController.cs @@ -6,6 +6,7 @@ using HuanMeng.MiaoYu.Code.Users; using HuanMeng.MiaoYu.Model.Dto; using HuanMeng.MiaoYu.Model.Dto.Account; using HuanMeng.MiaoYu.WebApi.Base; +using HuanMeng.Utility; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Http; @@ -29,10 +30,11 @@ namespace HuanMeng.MiaoYu.WebApi.Controllers } /// - /// 发送手机号验证码 + /// 发送手机号验证码 /// - /// 手机号 + /// /// + /// [HttpPost] public async Task> SendPhoneNumber([FromBody] RequestPhoneNumberModel phone) {