Merge branch 'feature/auth' of ssh://khuhub.khu.ac.kr:12959/2020-1-CloudComputin…
…g/C_Team_KhuDrive into feature/auth
Showing
6 changed files
with
93 additions
and
53 deletions
1 | +# Generated by Django 3.0.7 on 2020-06-10 17:40 | ||
2 | + | ||
3 | +from django.db import migrations, models | ||
4 | + | ||
5 | + | ||
6 | +class Migration(migrations.Migration): | ||
7 | + | ||
8 | + dependencies = [ | ||
9 | + ('api', '0008_item_file_type'), | ||
10 | + ] | ||
11 | + | ||
12 | + operations = [ | ||
13 | + migrations.RemoveField( | ||
14 | + model_name='user', | ||
15 | + name='id', | ||
16 | + ), | ||
17 | + migrations.AlterField( | ||
18 | + model_name='user', | ||
19 | + name='int_id', | ||
20 | + field=models.AutoField(primary_key=True, serialize=False), | ||
21 | + ), | ||
22 | + ] |
1 | +# Generated by Django 3.0.7 on 2020-06-10 17:42 | ||
2 | + | ||
3 | +from django.db import migrations, models | ||
4 | + | ||
5 | + | ||
6 | +class Migration(migrations.Migration): | ||
7 | + | ||
8 | + dependencies = [ | ||
9 | + ('api', '0009_auto_20200611_0240'), | ||
10 | + ] | ||
11 | + | ||
12 | + operations = [ | ||
13 | + migrations.AlterField( | ||
14 | + model_name='user', | ||
15 | + name='current_size', | ||
16 | + field=models.BigIntegerField(blank=True, default=0), | ||
17 | + ), | ||
18 | + migrations.AlterField( | ||
19 | + model_name='user', | ||
20 | + name='total_size', | ||
21 | + field=models.BigIntegerField(blank=True, default=1099511627776), | ||
22 | + ), | ||
23 | + ] |
1 | -from django.db import models | 1 | +from django.db import models |
2 | - | 2 | + |
3 | -# Create your models here. | 3 | +# Create your models here. |
4 | -class Item(models.Model): | 4 | +class Item(models.Model): |
5 | - item_id = models.AutoField(primary_key = True) | 5 | + item_id = models.AutoField(primary_key = True) |
6 | - is_folder = models.BooleanField(default = False) | 6 | + is_folder = models.BooleanField(default = False) |
7 | - name = models.CharField(max_length = 50) | 7 | + name = models.CharField(max_length = 50) |
8 | - file_type = models.CharField(max_length=100, null=True) # signed_url 생성을 위해 file type 세팅 | 8 | + file_type = models.CharField(max_length=100, null=True) # signed_url 생성을 위해 file type 세팅 |
9 | - path = models.TextField() | 9 | + path = models.TextField() |
10 | - #parent = models.ForeignKey('Item', on_delete=models.CASCADE, null=True) #related_name | 10 | + #parent = models.ForeignKey('Item', on_delete=models.CASCADE, null=True) #related_name |
11 | - parent = models.IntegerField() | 11 | + parent = models.IntegerField() |
12 | - user_id = models.IntegerField() | 12 | + user_id = models.IntegerField() |
13 | - size = models.IntegerField() | 13 | + size = models.IntegerField() |
14 | - is_deleted = models.BooleanField(default = False) | 14 | + is_deleted = models.BooleanField(default = False) |
15 | - created_time = models.DateTimeField(auto_now=True) | 15 | + created_time = models.DateTimeField(auto_now=True) |
16 | - updated_time = models.DateTimeField(null=True) | 16 | + updated_time = models.DateTimeField(null=True) |
17 | - status = models.BooleanField() | 17 | + status = models.BooleanField() |
18 | - | 18 | + |
19 | - #file = models.FileField(upload_to = \path) | 19 | + #file = models.FileField(upload_to = \path) |
20 | - | 20 | + |
21 | - class Meta: | 21 | + class Meta: |
22 | - ordering = ['item_id'] | 22 | + ordering = ['item_id'] |
23 | - | 23 | + |
24 | - | 24 | + |
25 | -class SharedItem(models.Model): | 25 | +class SharedItem(models.Model): |
26 | - item_id = models.IntegerField() | 26 | + item_id = models.IntegerField() |
27 | - #file_id? | 27 | + #file_id? |
28 | - expires = models.DateTimeField() | 28 | + expires = models.DateTimeField() |
29 | - password = models.CharField(max_length = 20) | 29 | + password = models.CharField(max_length = 20) |
30 | - created_time = models.DateTimeField(auto_now=True) | 30 | + created_time = models.DateTimeField(auto_now=True) |
31 | - class Meta: | 31 | + class Meta: |
32 | - ordering = ['item_id'] | 32 | + ordering = ['item_id'] |
33 | - | 33 | + |
34 | - | 34 | + |
35 | -class User(models.Model): | 35 | +class User(models.Model): |
36 | - int_id = models.IntegerField() | 36 | + int_id = models.AutoField(primary_key=True) |
37 | - user_id = models.CharField(max_length = 50) | 37 | + user_id = models.CharField(max_length=50) |
38 | - name = models.CharField(max_length = 50) | 38 | + name = models.CharField(max_length=50) |
39 | - password = models.CharField(max_length = 20) | 39 | + password = models.CharField(max_length=20) |
40 | - total_size = models.IntegerField() | 40 | + total_size = models.BigIntegerField(blank=True, default=1099511627776) |
41 | - current_size = models.IntegerField() | 41 | + current_size = models.BigIntegerField(blank=True, default=0) |
42 | - created_time = models.DateTimeField(auto_now=True) | 42 | + created_time = models.DateTimeField(auto_now=True) |
43 | - class Meta: | 43 | + |
44 | - ordering = ['int_id'] | 44 | + class Meta: |
45 | + ordering = ['int_id'] | ... | ... |
... | @@ -40,4 +40,4 @@ class SignUpSerializer(serializers.ModelSerializer): | ... | @@ -40,4 +40,4 @@ class SignUpSerializer(serializers.ModelSerializer): |
40 | class UserInfoSerializer(serializers.ModelSerializer): | 40 | class UserInfoSerializer(serializers.ModelSerializer): |
41 | class Meta: | 41 | class Meta: |
42 | model = User | 42 | model = User |
43 | - fields = ['user_id', 'name', 'total_size', 'current_size', 'created_time'] | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
43 | + fields = ['user_id', 'name', 'total_size', 'current_size', 'created_time'] | ... | ... |
... | @@ -30,4 +30,4 @@ def login_decorator(func): | ... | @@ -30,4 +30,4 @@ def login_decorator(func): |
30 | 30 | ||
31 | return func(self, request, *args, **kwargs) | 31 | return func(self, request, *args, **kwargs) |
32 | 32 | ||
33 | - return wrapper | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
33 | + return wrapper | ... | ... |
... | @@ -37,7 +37,7 @@ class UserViewSet(viewsets.ModelViewSet): | ... | @@ -37,7 +37,7 @@ class UserViewSet(viewsets.ModelViewSet): |
37 | 'name': user.name, | 37 | 'name': user.name, |
38 | 'total_size': user.total_size, | 38 | 'total_size': user.total_size, |
39 | 'current_size': user.current_size, | 39 | 'current_size': user.current_size, |
40 | - 'created_time': user.created_time | 40 | + 'created_time': user.created_time |
41 | }, | 41 | }, |
42 | status=status.HTTP_200_OK, | 42 | status=status.HTTP_200_OK, |
43 | ) | 43 | ) |
... | @@ -135,9 +135,3 @@ class UserViewSet(viewsets.ModelViewSet): | ... | @@ -135,9 +135,3 @@ class UserViewSet(viewsets.ModelViewSet): |
135 | {'Error': 'The Method is not allowed.'}, | 135 | {'Error': 'The Method is not allowed.'}, |
136 | status=status.HTTP_405_METHOD_NOT_ALLOWED, | 136 | status=status.HTTP_405_METHOD_NOT_ALLOWED, |
137 | content_type="application/json") | 137 | content_type="application/json") |
138 | - | ||
139 | - | ||
140 | - | ||
141 | - | ||
142 | - | ||
143 | - | ... | ... |
-
Please register or login to post a comment