Skip to content

Feat maintenace time ce#588

Merged
LordofAvernus merged 5 commits intomainfrom
feat-maintenace-time-ce
Mar 27, 2026
Merged

Feat maintenace time ce#588
LordofAvernus merged 5 commits intomainfrom
feat-maintenace-time-ce

Conversation

@BugsGuru
Copy link
Copy Markdown
Collaborator

@BugsGuru BugsGuru commented Mar 27, 2026

User description

关联的 issue

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

描述你的变更

  • 支持限定工作台SQL操作的时间范围

确认项(pr提交后操作)

Tip

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


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


Description

  • 添加运维时间管控逻辑检查

  • 集成 MaintenanceTimeUsecase 至各服务

  • 修改 SQLQueryConfig 支持 MaintenancePeriods 字段

  • 更新 swagger、本地化及转换函数


Diagram Walkthrough

flowchart LR
  A["新增 MaintenanceTimeUsecase 逻辑"] --> B["CloudbeaverUsecase 调用检查"]
  B --> C["更新 DBService/DMSService 配置"]
  C --> D["修改 SQLQueryConfig 结构传递"]
  D --> E["更新 swagger 与本地化配置"]
Loading

File Walkthrough

Relevant files
Enhancement
9 files
cloudbeaver.go
添加 maintenanceTimeUsecase 字段及检查逻辑                                               
+48/-1   
db_service.go
更新 SQLQueryConfig 结构,加入 MaintenancePeriods 字段                       
+8/-7     
maintenance_time.go
新增运维时间管控业务逻辑实现                                                                                     
+121/-0 
cloudbeaver.go
集成 MaintenanceTimeUsecase 至 Cloudbeaver 服务                             
+3/-1     
db_service.go
更新 API 转换逻辑及 SQLQueryConfig 填充                                                     
+38/-51 
db_service_sync_task.go
调整 DBServiceSyncTask 转换以适配新配置                                                       
+5/-19   
service.go
集成 MaintenanceTimeUsecase 于 DMSService 中                                 
+3/-0     
convert.go
转换函数中增加对 MaintenancePeriods 字段的支持                                               
+15/-11 
model.go
模型更新:新增 MaintenancePeriods 字段                                                       
+13/-12 
Documentation
6 files
message_zh.go
本地化配置中添加运维时间提示信息                                                                                 
+5/-0     
db_service.go
更新 swagger API 定义,新增 maintenance_times 字段                               
+1/-0     
swagger.json
swagger JSON 更新,移除 DateTime 定义并新增运维时间字段                                   
+14/-20 
swagger.yaml
swagger YAML 更新,补充运维时间配置说明                                                             
+11/-20 
active.en.toml
英文本地化中添加运维时间提示信息                                                                                 
+1/-0     
active.zh.toml
中文本地化中添加运维时间提示信息                                                                                 
+1/-0     

…d update conversion functions

- Introduced MaintenancePeriods to the SqlQueryConfig struct for enhanced scheduling capabilities.
- Updated conversion functions to include MaintenancePeriods when converting between biz and model representations.
- Added logging for db service model conversion to assist in debugging.
@actiontech-bot actiontech-bot requested a review from iwanghc March 27, 2026 05:47
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 27, 2026

PR Reviewer Guide 🔍

(Review updated until commit e720440)

⏱️ Estimated effort to review: 5 🔵🔵🔵🔵🔵
🧪 PR contains tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

设计耦合

在业务逻辑层中(checkMaintenanceTime函数)直接构造HTTP响应,将业务逻辑与传输层耦合,可能导致单元测试困难。建议仅返回状态和提示信息,由调用层负责构造HTTP响应。

// [运维时间管控检查] 在审核通过后、工单判断前检查运维时间管控
if blocked, err := cu.checkMaintenanceTime(c, resp.Results, dbService); blocked || err != nil {
	return nil, err
}

@github-actions
Copy link
Copy Markdown

PR Code Suggestions ✨

No code suggestions found for the PR.

…integrate with CloudbeaverUsecase

- Added MaintenanceTimeUsecase for managing maintenance time checks during SQL execution.
- Integrated maintenance time checks into CloudbeaverUsecase's GraphQLDistributor method.
- Updated SQLQueryConfig to include MaintenancePeriods for enhanced scheduling capabilities.
- Introduced new methods for checking SQL execution permissions based on maintenance time configurations.
…beaverUsecase

- Added MaintenanceTimeUsecase to manage maintenance time checks.
- Updated CloudbeaverUsecase to include maintenance time in its initialization.
- Refactored SQLQueryConfig handling to utilize new methods for maintenance time management.
- Enhanced DMSService methods to convert and fill SQLQueryConfig with maintenance periods.
- Removed the DateTime definition from swagger.json and swagger.yaml.
- Updated x-go-package references to point to the new common API path.
- Added maintenance_times property to relevant definitions for enhanced maintenance time management.
@BugsGuru BugsGuru force-pushed the feat-maintenace-time-ce branch from f2dab88 to e720440 Compare March 27, 2026 06:03
@github-actions
Copy link
Copy Markdown

Persistent review updated to latest commit e720440

@github-actions
Copy link
Copy Markdown

Failed to generate code suggestions for PR

@LordofAvernus LordofAvernus merged commit 3d57341 into main Mar 27, 2026
1 check passed
@BugsGuru BugsGuru deleted the feat-maintenace-time-ce branch March 27, 2026 06:33
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