🐛 Bug fixes

This commit is contained in:
LittleSheep 2025-05-23 01:46:35 +08:00
parent 19174de873
commit a6ca869f29
3 changed files with 4 additions and 4 deletions

View File

@ -63,7 +63,7 @@ public class AccountController(
[MaxLength(128)] [MaxLength(128)]
public string Password { get; set; } = string.Empty; public string Password { get; set; } = string.Empty;
[MaxLength(128)] [RegularExpression("^[a-z]{2,3}$")] public string Language { get; set; } = "en-us"; [MaxLength(128)] public string Language { get; set; } = "en-us";
[Required] public string CaptchaToken { get; set; } = string.Empty; [Required] public string CaptchaToken { get; set; } = string.Empty;
} }
@ -140,7 +140,7 @@ public class AccountController(
public class BasicInfoRequest public class BasicInfoRequest
{ {
[MaxLength(256)] public string? Nick { get; set; } [MaxLength(256)] public string? Nick { get; set; }
[MaxLength(32)] [RegularExpression("^[a-z]{2,3}$")] public string? Language { get; set; } [MaxLength(32)] public string? Language { get; set; }
} }
[Authorize] [Authorize]

View File

@ -51,7 +51,6 @@ public partial class ChatController(AppDatabase db, ChatService cs) : Controller
); );
return Ok(result); return Ok(result);
} }
public class SendMessageRequest public class SendMessageRequest

View File

@ -21,7 +21,8 @@ public class MessageReadReceiptFlushHandler(IServiceProvider serviceProvider) :
.ToList(); .ToList();
using var scope = serviceProvider.CreateScope(); using var scope = serviceProvider.CreateScope();
var db = scope.ServiceProvider.GetRequiredService<AppDatabase>(); await db.BulkInsertAsync(distinctItems); var db = scope.ServiceProvider.GetRequiredService<AppDatabase>();
await db.BulkInsertAsync(distinctItems, config => config.ConflictOption = ConflictOption.Ignore);
} }
} }