Fix/market invite#799
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the NotifySendServiceImpl to handle tenant ID assignments during notification creation and team joining. Specifically, it introduces conditional logic to set the tenant ID for 'teamMarketInvite' messages and ensures the tenant ID is populated when a user joins a team. Review feedback suggests simplifying the conditional assignment logic in createNotify to improve readability and removing a redundant duplicate call to setTenantId in the acceptJoinTeam method.
| notifySend.setTenantId(createNotifyDto.getTenantId()); | ||
| if (StringUtils.equals(createNotifyDto.getMessageType(), "teamMarketInvite")) { | ||
| if (StringUtils.isNotEmpty(marketUser.getTenantId())) { | ||
| notifySend.setTenantId(marketUser.getTenantId()); | ||
| } | ||
| } |
There was a problem hiding this comment.
The logic for setting the tenant ID can be simplified to improve readability and avoid redundant assignments to the notifySend object. This approach clearly determines the correct tenant ID before applying it.
String tenantId = createNotifyDto.getTenantId();
if (StringUtils.equals(createNotifyDto.getMessageType(), "teamMarketInvite") && StringUtils.isNotEmpty(marketUser.getTenantId())) {
tenantId = marketUser.getTenantId();
}
notifySend.setTenantId(tenantId);| appMarketUser.setUpdaterId(userId); | ||
|
|
||
| appMarketUser.setTenantId(notifySend.getTenantId()); |
There was a problem hiding this comment.
The assignment appMarketUser.setTenantId(notifySend.getTenantId()); is redundant here as it was already performed on line 329. Removing the duplicate call improves code clarity.
| appMarketUser.setUpdaterId(userId); | |
| appMarketUser.setTenantId(notifySend.getTenantId()); | |
| appMarketUser.setUpdaterId(userId); |
📝 Pull Request 描述 | Description
🎯 变更类型 | Change Type
🔗 相关 Issue | Related Issues
📋 变更内容 | Changes Made
主要变更 | Main Changes
技术细节 | Technical Details
🧪 测试 | Testing
测试环境 | Test Environment
测试步骤 | Test Steps
测试结果 | Test Results
📸 截图/录屏 | Screenshots/Recordings
变更前 | Before
变更后 | After
破坏性变更详情 | Breaking Changes Details
✅ 检查清单 | Checklist
代码质量 | Code Quality
测试 | Testing
文档 | Documentation
其他 | Others
📌 额外说明 | Additional Notes
🙏 致谢 | Acknowledgements
📖 提示 | Tips:
/cc @maintainers