spark-server/internal/module/friend/entity/request.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

38 lines
604 B
Go

package entity
import "time"
const (
RequestPending = 1
RequestAccepted = 2
RequestRejected = 3
)
const (
SourceQRCode = 1
SourceEmail = 2
SourceSparkID = 3
)
const (
ReasonMax = 128
RemarkMax = 64
)
// Request is one from→to application. Repeats update this row; they do not insert another.
type Request struct {
ID int64
FromUser int64
ToUser int64
Source int
Reason string
Remark string
Status int
CreatedAt time.Time
UpdatedAt time.Time
}
func ValidSource(src int) bool {
return src == SourceQRCode || src == SourceEmail || src == SourceSparkID
}