Skip to content

refactor(eventbus): replace EventBus struct with EventBus interface#50

Merged
ckeyer merged 3 commits into
insmtx:mainfrom
ckeyer:refactor/eventbus-interface
May 10, 2026
Merged

refactor(eventbus): replace EventBus struct with EventBus interface#50
ckeyer merged 3 commits into
insmtx:mainfrom
ckeyer:refactor/eventbus-interface

Conversation

@ckeyer
Copy link
Copy Markdown
Contributor

@ckeyer ckeyer commented May 9, 2026

  • Remove unused EventBus struct and NewEventBus function (dead code)
  • Replace PublisherSubscriber interface with EventBus interface for better semantics
  • Update SetupRouter to accept EventBus interface instead of concrete Publisher type
  • Enable SessionService to use the same NATS connection for both publish and subscribe

This change improves code architecture by:

  1. Removing dead code (EventBus struct was never used)
  2. Using idiomatic Go interface composition
  3. Ensuring single NATS connection throughout the application
  4. Better semantic naming (EventBus > PublisherSubscriber)

ckeyer added 3 commits May 9, 2026 16:25
- Remove unused EventBus struct and NewEventBus function (dead code)
- Replace PublisherSubscriber interface with EventBus interface for better semantics
- Update SetupRouter to accept EventBus interface instead of concrete Publisher type
- Enable SessionService to use the same NATS connection for both publish and subscribe

This change improves code architecture by:
1. Removing dead code (EventBus struct was never used)
2. Using idiomatic Go interface composition
3. Ensuring single NATS connection throughout the application
4. Better semantic naming (EventBus > PublisherSubscriber)
- 修改Session结构体: user_id → uin
- 修改SkillExecutionLog结构体: user_id → uin
- 更新API契约层字段名
- 更新DAO层查询条件
- 更新Service层业务逻辑
- 更新测试用例
- 重新生成Swagger文档
- organization.go和user_org.go表名添加singer_前缀
- User结构添加Password字段支持本地认证
- 添加InitDevData函数初始化默认组织、用户和用户组织关联
- 使用bcrypt加密默认用户密码Admin123456
- 修复中间件中的认证旁路问题
@ckeyer ckeyer merged commit 364262f into insmtx:main May 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant