From 72e71a7a31b14f30f38a2a3acecb7311049c608a Mon Sep 17 00:00:00 2001 From: 移动系统liao <liaoxujun@qq.com> Date: 星期二, 24 九月 2024 14:55:25 +0800 Subject: [PATCH] 完成微信转账到零钱所有逻辑 --- cylsg/cylsg.Application/Users/UserAppService.cs | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 55 insertions(+), 1 deletions(-) diff --git a/cylsg/cylsg.Application/Users/UserAppService.cs b/cylsg/cylsg.Application/Users/UserAppService.cs index bac83be..a3f0c08 100644 --- a/cylsg/cylsg.Application/Users/UserAppService.cs +++ b/cylsg/cylsg.Application/Users/UserAppService.cs @@ -285,6 +285,60 @@ } - + + + /// <summary> + /// 淇濆瓨鐢ㄦ埛淇℃伅 + /// </summary> + /// <returns></returns> + public async Task<bool> saveUser(UserDto userDto) + { + + var UserID = App.User?.FindFirstValue("UserID"); + int userid = 0; + string NickName = App.User?.FindFirstValue("NickName"); + if (!string.IsNullOrEmpty(UserID)) + { + userid = int.Parse(UserID); + } + if (!string.IsNullOrEmpty(userDto.Nickname) && userDto.Nickname.Length > 100) + { + throw Oops.Oh("鏄电О闀垮害杩囬暱锛�"); + } + if (!string.IsNullOrEmpty(userDto.Avatar) && userDto.Avatar.Length > 500) + { + throw Oops.Oh("澶村儚闀垮害杩囬暱锛�"); + } + + + var userRes = new BaseRepository<User>(); + bool res; + + var user = await userRes.GetByIdAsync(userid); + + if (!string.IsNullOrEmpty(userDto.Nickname)) + user.Nickname = userDto.Nickname; + if (!string.IsNullOrEmpty(userDto.Avatar)) + user.Avatar = userDto.Avatar; + + + user.UpDataBy = NickName; + user.UpDataTime = DateTime.Now; + res = await userRes.UpdateAsync(user); + + + + + + + + + + + return res; + } + + + } } -- Gitblit v1.9.1