Toggle navigation
Toggle navigation
This project
Loading...
Sign in
2020-1-CloudComputing-E
/
E_Team_KhuBox
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Authored by
서승완
2020-06-17 17:56:42 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
7ca0067639f90af35591e9921bf07ba502610061
7ca00676
1 parent
83939c28
feat: add additional information in api
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
khubox-api/khubox/services/files.py
khubox-api/khubox/services/groups.py
khubox-api/khubox/services/files.py
View file @
7ca0067
...
...
@@ -33,6 +33,7 @@ def list_item(request):
data
.
append
({
'id'
:
file
.
id
,
'type'
:
file
.
type
,
'parent_id'
:
file
.
parent_id
,
'name'
:
file
.
name
,
'size'
:
file
.
size
,
'is_public'
:
file
.
is_public
,
...
...
@@ -141,10 +142,6 @@ def empty_trash(request):
# 폴더/파일 조회
def
find_item
(
request
,
file_id
):
# Check Login
if
request
.
user_id
is
None
:
return
{
'result'
:
False
,
'error'
:
'로그인을 해주세요.'
}
# Query
file
=
File
.
objects
.
filter
(
id
=
file_id
,
deleted_at__isnull
=
True
)
...
...
@@ -174,13 +171,14 @@ def find_item(request, file_id):
# Check Auth
if
is_auth
is
False
:
return
{
'result'
:
False
,
'error'
:
'
잘못된 요청입
니다.'
}
return
{
'result'
:
False
,
'error'
:
'
권한이 없습
니다.'
}
# Return File
if
file
[
0
]
.
type
==
'file'
:
download_url
=
sign_download
(
file
[
0
]
.
id
)
data
=
{
'id'
:
file
[
0
]
.
id
,
'type'
:
file
[
0
]
.
type
,
'parent_id'
:
file
[
0
]
.
parent_id
,
'name'
:
file
[
0
]
.
name
,
'size'
:
file
[
0
]
.
size
,
...
...
@@ -198,6 +196,7 @@ def find_item(request, file_id):
# Structure
data
=
{
'id'
:
file
[
0
]
.
id
,
'type'
:
file
[
0
]
.
type
,
'parent_id'
:
file
[
0
]
.
parent_id
,
'name'
:
file
[
0
]
.
name
,
'size'
:
file
[
0
]
.
size
,
...
...
@@ -211,6 +210,7 @@ def find_item(request, file_id):
file_list
.
append
({
'id'
:
file
.
id
,
'type'
:
file
.
type
,
'parent_id'
:
file
.
parent_id
,
'name'
:
file
.
name
,
'size'
:
file
.
size
,
'is_public'
:
file
.
is_public
,
...
...
khubox-api/khubox/services/groups.py
View file @
7ca0067
...
...
@@ -149,6 +149,7 @@ def find_item(request, group_id):
'id'
:
group
[
0
]
.
id
,
'name'
:
group
[
0
]
.
name
,
'root_folder'
:
group
[
0
]
.
root_folder
,
'is_owner'
:
False
,
}
# If Owner
...
...
Please
register
or
login
to post a comment