feat(kol): AI assist service + worker
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user