; if default_storage.exists(photo_thumbnail_path): 413
+            default_storage.delete(photo_thumbnail_path)
414
+        default_storage.save(photo_thumbnail_path, photo)
415
+
416
+        group_photo = GroupPhotoInfo.objects.create(
417
+            group_id=group_id,
418
+            user_id=user_id,
419
+            nickname=nickname,
420
+            photo_path=photo_path,
421
+            photo_thumbnail_path=photo_thumbnail_path,
422
+        )
423
+
424
+    group_photos = GroupPhotoInfo.objects.filter(
425
+        group_id=group_id,
426
+        pk__gt=photo_id,
427
+    ).order_by(
428
+        'created_at'
429
+    )
430
+
431
+    return JsonResponse({
432
+        'status': 200,
433
+        'message': u'飞图上传成功',
434
+        'data': [photo.photo_info for photo in group_photos],
435
+    })
436
+
437
+
372 438
 class GroupInfoViewSet(viewsets.ModelViewSet):
373 439
     queryset = GroupInfo.objects.all().order_by('-created_at')
374 440
     serializer_class = GroupInfoSerializer

+ 2 - 2
photo/views.py

@@ -123,7 +123,7 @@ def session_detail_api(request, session):
123 123
         'message': u'获取照片列表成功',
124 124
         'data': {
125 125
             'count': photos.count(),
126
-            'photos': [p.detail for p in photos]
126
+            'photos': [p.detail for p in photos],
127 127
         }
128 128
     })
129 129
 
@@ -144,7 +144,7 @@ def photo_standard_api(request, photo):
144 144
         'status': 200,
145 145
         'message': u'获取照片详情成功',
146 146
         'data': {
147
-            'photo': photo.detail
147
+            'photo': photo.detail,
148 148
         }
149 149
     })
150 150
 

kodo - Gogs: Go Git Service

No Description

Brightcells: f3cf68f957 Add PAI2_HOME_WX_API for request.weixin 7 years ago
..
__init__.py f7d159714f Fix Bug: PAI2_HOME_API error 9 years ago
raw.py f3cf68f957 Add PAI2_HOME_WX_API for request.weixin 7 years ago