24 lines
653 B
Go
24 lines
653 B
Go
package logic
|
|
|
|
import (
|
|
"context"
|
|
|
|
modentity "spark-server/internal/module/moderation/entity"
|
|
)
|
|
|
|
// AccountGate checks account status before send.
|
|
type AccountGate interface {
|
|
AssertCanSend(ctx context.Context, userID int64) error
|
|
}
|
|
|
|
// TextFilter scans outbound text. No hit returns (nil, nil).
|
|
type TextFilter interface {
|
|
Scan(ctx context.Context, text string) (*modentity.ScanResult, error)
|
|
}
|
|
|
|
// Penalty records hits and enforces mute/disable/reject.
|
|
type Penalty interface {
|
|
Apply(ctx context.Context, userID, conversationID int64, in *modentity.ApplyInput) error
|
|
Enforce(ctx context.Context, userID int64, res *modentity.ScanResult) error
|
|
}
|