新增:上传文件新增字段返回

This commit is contained in:
yystopf 2023-11-14 11:03:58 +08:00
parent 7080b74ebe
commit 8532281904
1 changed files with 6 additions and 1 deletions

View File

@ -1,2 +1,7 @@
json.id @attachment.id json.id @attachment.id
json.filesize @attachment.filesize json.title @attachment.title
json.filesize number_to_human_size(@attachment.filesize)
json.is_pdf @attachment.is_pdf?
json.url Rails.application.config_for(:configuration)['platform_url'] + (@attachment.is_pdf? ? download_url(@attachment,disposition:"inline") : download_url(@attachment)).to_s
json.created_on @attachment.created_on.strftime("%Y-%m-%d %H:%M")
json.content_type @attachment.content_type