Skip to content

Commit

Permalink
change config
Browse files Browse the repository at this point in the history
  • Loading branch information
xiandong-italki committed Jun 13, 2023
1 parent d1cd853 commit 2e0dad9
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,11 @@ type RepositorySaveListener interface {
}

type RepositoryConfig struct {
DomainName string `json:"domain_name"`
SubDomainName string `json:"sub_domain_name"`
MysqlEventStoreDBConfig DBConfig `json:"mysql_event_store_db_config"`
RocketMqEventBusNameServers []string `json:"rocket_mq_event_bus_name_servers"`
SaveListener RepositorySaveListener
DtmDBConf dtmimp.DBConf
DomainName string `json:"domain_name"`
SubDomainName string `json:"sub_domain_name"`
EventBusNameServers []string `json:"event_bus_name_servers"`
SaveListener RepositorySaveListener
DtmDBConf dtmimp.DBConf
}

func NewRepository(ctx context.Context, config *RepositoryConfig) (r *Repository, err error) {
Expand All @@ -35,7 +34,7 @@ func NewRepository(ctx context.Context, config *RepositoryConfig) (r *Repository
}
mysqlEventStoreConfig := MysqlEventStoreConfig{
SubDomainName: config.SubDomainName,
DBConfig: config.MysqlEventStoreDBConfig,
DBConfig: DBConfig{SqlDataSourceName: dtmimp.GetDsn(config.DtmDBConf)},
}
es, esErr := NewMysqlEventStore(ctx, mysqlEventStoreConfig)
if esErr != nil {
Expand All @@ -44,7 +43,7 @@ func NewRepository(ctx context.Context, config *RepositoryConfig) (r *Repository
dtmConfig := DtmEventProducerConfig{
DomainName: config.DomainName,
SubDomainName: config.SubDomainName,
NameServers: config.RocketMqEventBusNameServers,
NameServers: config.EventBusNameServers,
EventStore: &es,
DtmDBConf: config.DtmDBConf,
}
Expand Down

0 comments on commit 2e0dad9

Please sign in to comment.