order_log_subscriber.go
987 字节
package subscriber
import (
"github.com/linmadan/egglib-go/core/domain"
"gitlab.fjmaimaimai.com/mmm-go/partnermg/pkg/domain/event"
"gitlab.fjmaimaimai.com/mmm-go/partnermg/pkg/infrastructure/pg/transaction"
)
//订单数据修改触发的订阅事件
type OrderLogSubscriber struct {
transactionContext *transaction.TransactionContext
}
var _ domain.DomainEventSubscriber = (*OrderLogSubscriber)(nil)
func (subscriber *OrderLogSubscriber) HandleEvent(domainEvent domain.DomainEvent) error {
switch domainEvent.EventType() {
case event.UPDATE_BONUS_BY_GOOD_NUMBER_EVENT:
case event.UPDATE_BONUS_BY_PARTENT_BONUS_PERCENT_EVENT:
case event.UPDATE_ORDER_REMARK:
case event.PAY_ORDER_GOOD_BONUS_EVENT:
}
return nil
}
func (subscriber *OrderLogSubscriber) SubscribedToEventTypes() []string {
return []string{
event.UPDATE_BONUS_BY_GOOD_NUMBER_EVENT,
event.UPDATE_BONUS_BY_PARTENT_BONUS_PERCENT_EVENT,
event.UPDATE_ORDER_REMARK,
event.PAY_ORDER_GOOD_BONUS_EVENT,
}
}