feat(wire): add moderation and builtin hooks to post service wiring
All checks were successful
Build Backend / build (push) Successful in 3m57s
Build Backend / build-docker (push) Successful in 4m43s

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:
lafay
2026-03-21 02:53:38 +08:00
parent 1a48bb440c
commit 639ee55696
3 changed files with 13 additions and 1 deletions

View File

@@ -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
}