feat(message): store messages in Postgres

This commit is contained in:
kk10
2026-10-05 13:26:21 +03:00
parent 04f7c046b6
commit 385a8c0312
6 changed files with 82 additions and 36 deletions
+3 -2
View File
@@ -27,8 +27,9 @@ type MessagePageResponse struct {
}
func (r CreateMessageRequest) Validate() bool {
textLen := utf8.RuneCountInString(r.Text)
if strings.TrimSpace(r.Text) == "" || textLen > 4000 {
if strings.TrimSpace(r.Text) == "" ||
strings.ContainsRune(r.Text, 0) ||
utf8.RuneCountInString(r.Text) > 4000 {
return false
}