feat(kol): AI assist service + worker

This commit is contained in:
2026-04-17 13:52:01 +08:00
parent 9cf9fac109
commit d55f1276f3
8 changed files with 593 additions and 0 deletions
@@ -102,6 +102,10 @@ func (c *Client) PublishTemplateAssistTask(ctx context.Context, body []byte) err
return c.publish(ctx, c.cfg.TemplateAssistExchange, c.cfg.TemplateAssistRoutingKey, body)
}
func (c *Client) PublishKolAssistTask(ctx context.Context, body []byte) error {
return c.publish(ctx, c.cfg.KolAssistExchange, c.cfg.KolAssistRoutingKey, body)
}
func (c *Client) PublishImageAssetTask(ctx context.Context, body []byte) error {
return c.publish(ctx, c.cfg.ImageAssetExchange, c.cfg.ImageAssetRoutingKey, body)
}
@@ -180,6 +184,10 @@ func (c *Client) ConsumeTemplateAssistTask(consumerName string) (<-chan amqp.Del
return c.consume(consumerName, c.cfg.TemplateAssistQueue)
}
func (c *Client) ConsumeKolAssistTask(consumerName string) (<-chan amqp.Delivery, *amqp.Channel, error) {
return c.consume(consumerName, c.cfg.KolAssistQueue)
}
func (c *Client) ConsumeImageAssetTask(consumerName string) (<-chan amqp.Delivery, *amqp.Channel, error) {
return c.consume(consumerName, c.cfg.ImageAssetQueue)
}
@@ -562,6 +570,18 @@ func (c *Client) ensureTopology(conn *amqp.Connection) error {
return err
}
if err := c.ensureWorkQueue(
ch,
c.cfg.KolAssistExchange,
c.cfg.KolAssistRoutingKey,
c.cfg.KolAssistQueue,
c.cfg.KolAssistDLX,
c.cfg.KolAssistDLQ,
c.cfg.KolAssistDLQRouteKey,
); err != nil {
return err
}
if err := c.ensureWorkQueue(
ch,
c.cfg.ImageAssetExchange,