feat(wire): add moderation and builtin hooks to post service wiring
Add wire providers for ModerationHooks and BuiltinHooks, injecting them into PostService via dependency injection. Hooks are passed as blank identifiers to trigger their initialization and registration side effects.
This commit is contained in:
@@ -80,6 +80,10 @@ func (h *PostModerationHook) Execute(ctx *HookContext) error {
|
||||
result.Approved = false
|
||||
result.Error = err
|
||||
result.ReviewedBy = "ai"
|
||||
zap.L().Error("AI post moderation failed in strict mode, reject post",
|
||||
zap.String("post_id", data.PostID),
|
||||
zap.Error(err),
|
||||
)
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -164,6 +168,10 @@ func (h *CommentModerationHook) Execute(ctx *HookContext) error {
|
||||
result.Approved = false
|
||||
result.Error = err
|
||||
result.ReviewedBy = "ai"
|
||||
zap.L().Error("AI comment moderation failed in strict mode, reject comment",
|
||||
zap.String("comment_id", data.CommentID),
|
||||
zap.Error(err),
|
||||
)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user