新增:接口附件内容返回

This commit is contained in:
yystopf 2023-02-20 13:54:00 +08:00
parent 121fa2bff4
commit 656d5b69b6
4 changed files with 17 additions and 1 deletions

View File

@ -0,0 +1,7 @@
json.id attachment.id
json.title attachment.title
json.filesize number_to_human_size(attachment.filesize)
json.is_pdf attachment.is_pdf?
json.url attachment.is_pdf? ? download_url(attachment,disposition:"inline") : download_url(attachment)
json.created_on attachment.created_on.strftime("%Y-%m-%d %H:%M")
json.content_type attachment.content_type

View File

@ -39,4 +39,7 @@ json.participants issue.participants.distinct.each do |participant|
json.partial! "api/v1/users/simple_user", locals: {user: participant}
end
json.comment_journals_count issue.comment_journals.size
json.operate_journals_count issue.operate_journals.size
json.operate_journals_count issue.operate_journals.size
json.attachments issue.attachments.each do |attachment|
json.partial! "api/v1/attachments/simple_detail", locals: {attachment: attachment}
end

View File

@ -14,4 +14,7 @@ json.reply_user do
else
json.nil!
end
end
json.attachments journal.attachments.each do |attachment|
json.partial! "api/v1/attachments/simple_detail", locals: {attachment: attachment}
end

View File

@ -17,4 +17,7 @@ else
json.children_journals journal.first_ten_children_journals.each do |journal|
json.partial! "children_detail", journal: journal
end
json.attachments journal.attachments do |attachment|
json.partial! "api/v1/attachments/simple_detail", locals: {attachment: attachment}
end
end