新增:分支同步历史记录以及创建同步分支接口

This commit is contained in:
2024-04-19 17:26:20 +08:00
parent 240e086232
commit 0f5066f943
5 changed files with 63 additions and 10 deletions

View File

@@ -1,11 +1,11 @@
json.total_count @group_sync_repository_branch.keys.count
json.sync_repository_branches @group_sync_repository_branch.each do |key|
json.gitlink_branch_name key[0][0]
json.external_branch_name key[0][1]
branches = @sync_repository_branches.where(gitlink_branch_name: key[0][0], external_branch_name: key[0][1]).order(updated_at: :desc)
json.total_count @group_sync_repository_branch.count
json.sync_repository_branches @group_sync_repository_branch.each do |item|
json.gitlink_branch_name item.gitlink_branch_name
json.external_branch_name item.external_branch_name
branches = @sync_repository_branches.where(gitlink_branch_name: item.gitlink_branch_name, external_branch_name: item.external_branch_name).order(updated_at: :desc)
branch = branches.first
json.type branch&.sync_repository&.type
json.sync_time branch.sync_time
json.sync_time branch.sync_time.strftime("%Y-%m-%d %H:%M:%S")
json.sync_status branch.sync_status
json.enable branch.enable
json.reposync_branch_ids branches.pluck(:reposync_branch_id)

View File

@@ -0,0 +1,8 @@
json.total_count @reposync_branch_logs.count
json.logs @reposync_branch_logs.each do |log|
type = log['repo_name'].start_with?('gitee') ? 'gitee' : 'github'
json.change_from log['sync_direct'] == "to_inter" ? type : 'gitlink'
json.commit_id log['commit_id']
json.sync_time log['update_at']
json.log log['log']
end