修改User模块,同步原始代码

This commit is contained in:
chfei committed 2026-10-23 15:42:37 +08:00
1 parent 4a5fada435
commit 78b0c2bb2e
47 files changed
+2939 -193

No files matched your search

@@ -1,4 +1,6 @@
using System.ComponentModel.DataAnnotations;
using Store.Users.Services;
using MAX.Framework.Validation;
using Store.Users.Dtos;
using YourNamespace;
using MAX.Framework.Mediation;
using MAX.Core.Mediation;
@@ -25,14 +27,11 @@ public sealed record ShopRenewCommand(string UserName, string ShopId, int RenewD
void IValidatableRequest.Validate()
{
if (string.IsNullOrWhiteSpace(UserName) || UserName.Trim().Length > 20)
throw new ValidationException("用户名不能为空且长度不能超过20个字符");
if (string.IsNullOrWhiteSpace(ShopId) || ShopId.Trim().Length > 50)
throw new ValidationException("店铺ID不能为空且长度不能超过50个字符");
if (RenewDuration is < 1 or > 120)
throw new ValidationException("续费时长必须为1-120个月");
if (Remark?.Trim().Length > 255)
throw new ValidationException("备注长度不能超过255个字符");
RequestValidator.Validate(new UserNameRequest { UserName = UserName?.Trim()! });
UserInputChecks.Length(UserName.Trim(), 20, "用户名");
var request = new ShopRenewRequest { ShopId = ShopId, RenewDuration = RenewDuration, Remark = Remark };
RequestValidator.Validate(request);
UserInputChecks.Renew(request);
}
ConsumptionQuote IAccountConsumptionRequest.CalculateConsumption(UserEntity user)