softbot补充和调整接口

This commit is contained in:
2023-03-29 14:14:25 +08:00
parent 9f123995ee
commit f0dca4c0c1
6 changed files with 67 additions and 3 deletions

View File

@@ -0,0 +1,4 @@
json.partial! "commons/success"
json.extract! @bot, :id, :bot_name, :bot_des, :webhook, :is_public, :logo, :state, :web_url, :install_num, :owner_id, :create_time, :update_time

View File

@@ -4,5 +4,8 @@ json.data do
json.array! @install_bots do |install_bot|
json.installation_id install_bot.id
json.extract! install_bot.bot, :id, :name
json.bot_id install_bot.bot.id
json.bot_name install_bot.bot.name
end
end

View File

@@ -0,0 +1,15 @@
json.status 0
json.message "success"
json.total_count @install_bots.size
json.repositories do
json.array! @install_bots do |install_bot|
project = Project.find_by(id: install_bot.store_id)
if project.present?
json.id install_bot.store_id
json.url "#{base_url}/#{project.owner.login}/#{project.owner.identifier}.git"
json.name project.owner.identifier
json.owner_name project.owner.login
json.is_public project.is_public
end
end
end

View File

@@ -0,0 +1,5 @@
json.partial! "commons/success"
json.extract! @install_bot, :id, :bot_id, :installer_id, :state, :create_time, :update_time
json.bot_name @install_bot.bot.name