新增:标签列表和删除接口

This commit is contained in:
2023-02-03 18:03:57 +08:00
parent 8b90164247
commit 2772b97e32
8 changed files with 129 additions and 2 deletions

View File

@@ -0,0 +1,26 @@
if tag.present? && tag.is_a?(Hash)
json.name tag['name']
json.id tag['id']
json.zipball_url render_zip_url(@owner, @repository, tag['name'])
json.tarball_url render_tar_url(@owner, @repository, tag['name'])
json.tagger do
json.partial! 'commit_author', user: render_cache_commit_author(tag['tagger']), name: tag['tagger']['name']
end
json.time_ago time_from_now(tag['tagger']['date'].to_time)
json.created_at_unix tag['tagger']['date'].to_time.to_i
json.message tag['message']
json.commit do
json.sha tag['commit']['sha']
json.message tag['commit']['message']
json.time_ago time_from_now(tag['commit']['commiter']['date'].to_time)
json.created_at_unix tag['commit']['commiter']['date'].to_time.to_i
json.committer do
json.partial! 'commit_author', user: render_cache_commit_author(tag['commit']['commiter']), name: tag['commit']['commiter']['name']
end
json.author do
json.partial! 'commit_author', user: render_cache_commit_author(tag['commit']['author']), name: tag['commit']['author']['name']
end
end
else
json.name tag
end

View File

@@ -0,0 +1,4 @@
json.total_count @result_object[:total_data].to_i
json.tags @result_object[:data].each do |tag|
json.partial! "api/v1/projects/tags/simple_gitea_index_detail", tag: tag
end