/pre>
+ class Meta:
+ verbose_name = _('feedbackinfo')
+ verbose_name_plural = _('feedbackinfo')
+
+ def __unicode__(self):
+ return u'{0.pk}'.format(self)
@@ -2,6 +2,12 @@ |
||
| 2 | 2 |
|
| 3 | 3 |
from django.http import JsonResponse |
| 4 | 4 |
|
| 5 |
+from account.models import UserInfo |
|
| 6 |
+from operation.models import FeedbackInfo |
|
| 7 |
+ |
|
| 8 |
+from utils.error.errno_utils import UserStatusCode |
|
| 9 |
+from utils.error.response_utils import response |
|
| 10 |
+ |
|
| 5 | 11 |
from operation.models import LatestAppInfo, SplashInfo |
| 6 | 12 |
|
| 7 | 13 |
|
@@ -41,3 +47,28 @@ def splash_api(request): |
||
| 41 | 47 |
'splashes': splashes, |
| 42 | 48 |
}, |
| 43 | 49 |
}) |
| 50 |
+ |
|
| 51 |
+ |
|
| 52 |
+def feedback_api(request): |
|
| 53 |
+ """ |
|
| 54 |
+ 用户反馈 |
|
| 55 |
+ :param request: |
|
| 56 |
+ :return: |
|
| 57 |
+ """ |
|
| 58 |
+ user_id = request.POST.get('user_id', '')
|
|
| 59 |
+ feedback = request.POST.get('feedback', '')
|
|
| 60 |
+ |
|
| 61 |
+ if not UserInfo.objects.filter(user_id=user_id).exists(): |
|
| 62 |
+ return response(UserStatusCode.USER_NOT_FOUND) |
|
| 63 |
+ |
|
| 64 |
+ FeedbackInfo.objects.create( |
|
| 65 |
+ user_id=user_id, |
|
| 66 |
+ feedback=feedback |
|
| 67 |
+ ) |
|
| 68 |
+ |
|
| 69 |
+ return JsonResponse({
|
|
| 70 |
+ 'status': 200, |
|
| 71 |
+ 'message': u'反馈成功', |
|
| 72 |
+ 'data': {
|
|
| 73 |
+ }, |
|
| 74 |
+ }) |