You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
1.0 KiB
Go
37 lines
1.0 KiB
Go
package producer
|
|
|
|
import (
|
|
"context"
|
|
"joybuywork/internal/service/queue/types"
|
|
|
|
"github.com/Shopify/sarama"
|
|
)
|
|
|
|
type OplatformOther struct {
|
|
ctx context.Context
|
|
topic string
|
|
}
|
|
|
|
func NewOplatformOther(ctx context.Context) OplatformOther {
|
|
return OplatformOther{
|
|
ctx: ctx,
|
|
topic: types.OplatformOtherTopic,
|
|
}
|
|
}
|
|
|
|
func (p OplatformOther) OpoCampaignHelpOk(data types.OpoCampaignHelpOk, headers ...sarama.RecordHeader) {
|
|
_ = AP.Produce(p.ctx, p.topic, types.OpoCampaignHelpOkKey, data, headers...)
|
|
}
|
|
|
|
func (p OplatformOther) OpoCampaignCondOk(data types.OpoCampaignCondOk, headers ...sarama.RecordHeader) {
|
|
_ = AP.Produce(p.ctx, p.topic, types.OpoCampaignCondOkKey, data, headers...)
|
|
}
|
|
|
|
func (p OplatformOther) OpoCampaignDelete(data types.OpoCampaignDelete, headers ...sarama.RecordHeader) {
|
|
_ = AP.Produce(p.ctx, p.topic, types.OpoCampaignDeleteKey, data, headers...)
|
|
}
|
|
|
|
func (p OplatformOther) OpoCampaignPush(data types.OpoCampaignPush, headers ...sarama.RecordHeader) {
|
|
_ = AP.Produce(p.ctx, p.topic, types.OpoCampaignPushKey, data, headers...)
|
|
}
|