handler.go 698 字节
package event

import (
	"github.com/gookit/event"
	"gitlab.fjmaimaimai.com/allied-creation/character-library-metadata-bastion/pkg/application/event/command"
	"gitlab.fjmaimaimai.com/allied-creation/character-library-metadata-bastion/pkg/application/event/service"
	"gitlab.fjmaimaimai.com/allied-creation/character-library-metadata-bastion/pkg/domain"
)

func tableDataChangeHandler(e event.Event) error {
	et := &domain.EventTable{}
	et.ResolveEvent(e)
	svr := service.NewTableEventService(nil)
	_, err := svr.Handler(nil, &command.TableEventCommand{
		EventTable: et,
	})

	svr.HandlerTableAffectedMarkToConflictStatus(et.Context, &command.TableEventCommand{
		EventTable: et,
	})
	return err
}