Skip to content

Company notice ce#586

Merged
iwanghc merged 2 commits intomainfrom
company-notice-ce
Mar 20, 2026
Merged

Company notice ce#586
iwanghc merged 2 commits intomainfrom
company-notice-ce

Conversation

@LordofAvernus
Copy link
Collaborator

@LordofAvernus LordofAvernus commented Mar 20, 2026

User description

关联的 issue

https://github.com/actiontech/dms-ee/issues/756

描述你的变更

补充缺失的模型定义

确认项(pr提交后操作)

Tip

请在指定复审人之前,确认并完成以下事项,完成后✅


  • 我已完成自测
  • 我已记录完整日志方便进行诊断
  • 我已在关联的issue里补充了实现方案
  • 我已在关联的issue里补充了测试影响面
  • 我已确认了变更的兼容性,如果不兼容则在issue里标记 not_compatible
  • 我已确认了是否要更新文档,如果要更新则在issue里标记 need_update_doc


Description

  • 增加公告开始与结束时间

  • 添加公告创建人UID字段

  • 更新转换函数处理新增字段

  • 调整服务层获取用户名称


Diagram Walkthrough

flowchart LR
  A["新增公告时间和创建人字段"] -- "转换函数更新" --> B["更新数据转换"]
  B -- "服务逻辑调整" --> C["获取并展示用户名"]
Loading

File Walkthrough

Relevant files
Enhancement
company_notice.go
服务层添加创建人名称逻辑                                                                                         

internal/dms/service/company_notice.go

  • 新增判断 CreateUserUID 字段
  • 调用 UserUsecase 获取用户名称
  • 更新返回数据结构中展示用户名
+6/-0     
convert.go
更新转换函数支持新增字段                                                                                         

internal/dms/storage/convert.go

  • 增加 CreateUserUID 字段转换
  • 添加 StartTime 与 EndTime 字段转换
  • 同步更新 biz 与 model 转换逻辑
+6/-0     
model.go
扩展模型定义添加新字段                                                                                           

internal/dms/storage/model/model.go

  • 在 CompanyNotice 模型新增 CreateUserUID 字段
  • 添加公告时间字段 StartTime 与 EndTime
  • 补充字段描述及注释
+3/-0     

- Updated the CompanyNotice struct to include StartTime and EndTime fields for better notice management.
- Modified conversion functions to handle the new fields when converting between biz and model representations.
…date retrieval logic

- Added CreateUserUID field to the CompanyNotice struct for tracking the creator of the notice.
- Updated conversion functions to include CreateUserUID when converting between biz and model representations.
- Enhanced GetCompanyNotice method to retrieve and display the creator's name based on CreateUserUID.
@github-actions
Copy link

PR Reviewer Guide 🔍

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

错误处理

在获取公告创建人名称时,通过调用 d.UserUsecase.GetBizUserWithNameByUids 获取的用户列表没有进行错误处理或异常检测,建议增加错误检查逻辑以及必要的日志记录,以便后续排查问题。

if companyNotice.CreateUserUID != "" {
	users := d.UserUsecase.GetBizUserWithNameByUids(ctx, []string{companyNotice.CreateUserUID})
	if len(users) > 0 {
		data.CreateUserName = users[0].Name
	}
}

@github-actions
Copy link

PR Code Suggestions ✨

No code suggestions found for the PR.

@iwanghc iwanghc merged commit 5055382 into main Mar 20, 2026
1 check passed
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.

2 participants