mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-03 03:40:49 +08:00
新增:数据集部分接口
This commit is contained in:
11
app/views/api/v1/attachments/_detail.json.jbuilder
Normal file
11
app/views/api/v1/attachments/_detail.json.jbuilder
Normal file
@@ -0,0 +1,11 @@
|
||||
json.id attachment.uuid
|
||||
json.title attachment.title
|
||||
json.description attachment.description
|
||||
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:%S")
|
||||
json.content_type attachment.content_type
|
||||
json.creator do
|
||||
json.partial! "api/v1/users/simple_user", locals: {user: attachment.author}
|
||||
end
|
||||
@@ -1,7 +1,8 @@
|
||||
json.id attachment.id
|
||||
json.id attachment.uuid
|
||||
json.title attachment.title
|
||||
json.description attachment.description
|
||||
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.created_on attachment.created_on.strftime("%Y-%m-%d %H:%M:%S")
|
||||
json.content_type attachment.content_type
|
||||
|
||||
4
app/views/api/v1/projects/datasets/show.json.jbuilder
Normal file
4
app/views/api/v1/projects/datasets/show.json.jbuilder
Normal file
@@ -0,0 +1,4 @@
|
||||
json.(@project_dataset, :id, :title, :description)
|
||||
json.attachments @attachments do |at|
|
||||
json.partial! "api/v1/attachments/detail", locals: {attachment: at}
|
||||
end
|
||||
Reference in New Issue
Block a user