Toggle navigation
Toggle navigation
This project
Loading...
Sign in
2020-1-CloudComputing
/
C_Team_KhuDrive
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-15 19:06:13 +0900
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
c84550862ee458b77ae307c9d83a027c6f871eea
c8455086
2 parents
754f5d6e
e9ce82ed
Merge branch 'develop' into 'master'
Develop See merge request
!15
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
3 deletions
backend/api/views.py
backend/khudrive/settings.py
backend/khudrive/urls.py
backend/api/views.py
View file @
c845508
...
...
@@ -232,6 +232,7 @@ class ItemViewSet(viewsets.ViewSet):
return
Response
({
'message'
:
'delete permanently complete'
},
status
=
status
.
HTTP_200_OK
)
return
Response
({
'message'
:
'item is not existed.'
},
status
=
status
.
HTTP_204_NO_CONTENT
)
# url: items/11/move
# 마지막 slash도 써주어야함
@action
(
methods
=
[
'POST'
],
detail
=
True
,
permission_classes
=
[
AllowAny
],
url_path
=
'move'
,
url_name
=
'move'
)
...
...
@@ -337,6 +338,22 @@ class ItemViewSet(viewsets.ViewSet):
res
[
'inside_file_list'
]
=
[]
return
Response
({
'data'
:
res
},
status
=
status
.
HTTP_200_OK
)
@action
(
methods
=
[
'GET'
],
detail
=
False
,
permission_classes
=
[
AllowAny
],
url_path
=
'trash'
,
url_name
=
'trash'
)
def
trash
(
self
,
request
):
if
request
.
method
==
'GET'
:
children
=
Item
.
objects
.
filter
(
is_deleted
=
True
)
children_data
=
serializers
.
serialize
(
"json"
,
children
)
json_children
=
json
.
loads
(
children_data
)
res
=
{}
children_list
=
[]
for
i
in
json_children
:
t
=
i
[
'fields'
]
t
[
'id'
]
=
i
[
'pk'
]
children_list
.
append
(
t
)
res
[
'list'
]
=
children_list
return
Response
({
'data'
:
res
},
status
=
status
.
HTTP_200_OK
)
# url: /upload/
@action
(
methods
=
[
'POST'
],
detail
=
True
,
permission_classes
=
[
AllowAny
],
url_path
=
'upload'
,
url_name
=
'upload'
)
...
...
backend/khudrive/settings.py
View file @
c845508
...
...
@@ -88,9 +88,9 @@ DATABASES = {
# }
'default'
:
{
'ENGINE'
:
'django.db.backends.postgresql'
,
'NAME'
:
'
khuD
rive'
,
'USER'
:
'
root
'
,
'PASSWORD'
:
'
1234
'
,
'NAME'
:
'
d
rive'
,
'USER'
:
'
jooheekwon
'
,
'PASSWORD'
:
'
victoriawngml77
'
,
'HOST'
:
'localhost'
,
'PORT'
:
''
,
}
...
...
backend/khudrive/urls.py
View file @
c845508
...
...
@@ -36,6 +36,7 @@ urlpatterns = [
url
(
r'^<int:pk>/move/$'
,
views
.
ItemViewSet
.
move
,
name
=
'move'
),
url
(
r'^<int:pk>/copy/$'
,
views
.
ItemViewSet
.
copy
,
name
=
'copy'
),
url
(
r'^<int:pk>/children/$'
,
views
.
ItemViewSet
.
children
,
name
=
'children'
),
url
(
r'^trash/$'
,
views
.
ItemViewSet
.
trash
,
name
=
'trash'
),
url
(
r'^signup/$'
,
views
.
UserViewSet
.
signup
,
name
=
'signup'
),
url
(
r'^login/$'
,
views
.
UserViewSet
.
login
,
name
=
'login'
),
url
(
r'^upload/$'
,
views
.
ItemViewSet
.
upload
,
name
=
'upload'
),
...
...
Please
register
or
login
to post a comment