spark-server/internal/module/user/entity/email.go
zhr ae9a71034d feat: implement Spark IM V3 modular monolith
Add HTTP /v1 MVC, TCP send path, groups with server-side member-avatar collage, object-storage upload, and friends/favorites around the architecture-v3 layout.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 19:52:11 +08:00

25 lines
459 B
Go

package entity
import (
"regexp"
"strings"
"time"
)
var testEmailRe = regexp.MustCompile(`^test(0[1-9]|10)@spark\.com$`)
// EmailBinding maps one normalized email to one user.
type EmailBinding struct {
Email string
UserID int64
CreatedAt time.Time
}
func NormalizeEmail(email string) string {
return strings.ToLower(strings.TrimSpace(email))
}
func IsTestEmail(email string) bool {
return testEmailRe.MatchString(NormalizeEmail(email))
}