+
+ class Meta:
+ verbose_name = _(u'tourguideinfo')
+ verbose_name_plural = _(u'tourguideinfo')
+
+ def __unicode__(self):
+ return unicode(self.pk)
+
+ @property
+ def data(self):
+ return {
+ 'name': self.name,
+ 'sex': self.sex,
+ 'phone': self.phone,
+ 'location': self.location,
+ 'status': self.user_status,
+ 'refused_reason': self.refused_reason,
+ }
+
+
class WechatInfo(CreateUpdateMixin):
MALE = 1
FEMALE = 0
@@ -167,12 +225,14 @@ class UserInfo(CreateUpdateMixin):
WX_USER = 1
GUEST_USER = 9
LENSMAN_USER = 10
+ TOURGUIDE_USER = 11
USER_FROM = (
(APP_USER, u'APP 创建用户'),
(WX_USER, u'微信授权用户'),
(GUEST_USER, u'游客用户'),
(LENSMAN_USER, u'摄影师用户'),
+ (TOURGUIDE_USER, u'导游用户'),
)
UNVERIFIED = 0
@@ -218,6 +278,10 @@ class UserInfo(CreateUpdateMixin):
city = models.CharField(_(u'city'), max_length=255, blank=True, null=True, help_text=u'用户城市')
location = models.CharField(_(u'location'), max_length=255, blank=True, null=True, help_text=u'用户地址')
+ # 用户身份
+ islensman = models.BooleanField(_(u'islensman'), default=False, help_text=_(u'摄影师?'), db_index=True)
+ istourguide = models.BooleanField(_(u'istourguide'), default=False, help_text=_(u'导游?'), db_index=True)
+
balance = models.IntegerField(_(u'balance'), default=0, help_text=u'用户余额(分)')
freeze_income_balance = models.IntegerField(_(u'freeze_income_balance'), default=0, help_text=u'用户收入冻结余额(分)')
freeze_expense_balance = models.IntegerField(_(u'freeze_expense_balance'), default=0, help_text=u'用户支出冻结余额(分)')
@@ -250,6 +314,8 @@ class UserInfo(CreateUpdateMixin):
return self.nickname
elif self.user_from == self.LENSMAN_USER:
return self.name
+ elif self.user_from == self.TOURGUIDE_USER:
+ return self.name
return self.nickname
@property
@@ -0,0 +1,48 @@ |
||
| 1 |
+# -*- coding: utf-8 -*- |
|
| 2 |
+ |
|
| 3 |
+from __future__ import division |
|
| 4 |
+ |
|
| 5 |
+from django.conf import settings |
|
| 6 |
+from logit import logit |
|
| 7 |
+ |
|
| 8 |
+from account.models import TourGuideInfo |
|
| 9 |
+from utils.error.errno_utils import TourGuideStatusCode |
|
| 10 |
+from utils.error.response_utils import response |
|
| 11 |
+ |
|
| 12 |
+ |
|
| 13 |
+r = settings.REDIS_CACHE |
|
| 14 |
+ |
|
| 15 |
+ |
|
| 16 |
+@logit |
|
| 17 |
+def tourguide_submit_api(request): |
|
| 18 |
+ """ |
|
| 19 |
+ 导游信息提交 |
|
| 20 |
+ :param request: |
|
| 21 |
+ :return: |
|
| 22 |
+ """ |
|
| 23 |
+ unionid = request.POST.get('unionid', '')
|
|
| 24 |
+ openid = request.POST.get('openid', '')
|
|
| 25 |
+ phone = request.POST.get('phone', '')
|
|
| 26 |
+ |
|
| 27 |
+ if TourGuideInfo.objects.filter(phone=phone).exclude(unionid=unionid).exists(): |
|
| 28 |
+ return response(TourGuideStatusCode.TOURGUIDE_PHONE_ALREADY_EXISTS) |
|
| 29 |
+ |
|
| 30 |
+ fields = {
|
|
| 31 |
+ 'name': request.POST.get('name', ''),
|
|
| 32 |
+ 'sex': int(request.POST.get('sex', 1)),
|
|
| 33 |
+ 'phone': phone, |
|
| 34 |
+ 'location': request.POST.get('location', ''),
|
|
| 35 |
+ 'no': request.POST.get('no', ''),
|
|
| 36 |
+ 'user_status': TourGuideInfo.UNVERIFIED, |
|
| 37 |
+ } |
|
| 38 |
+ |
|
| 39 |
+ tourguide, created = TourGuideInfo.objects.get_or_create(unionid=unionid, defaults=fields) |
|
| 40 |
+ # 状态为 UNVERIFIED 的允许修改, 其他需要登录摄影师 APP 进行信息的修改 |
|
| 41 |
+ if tourguide.user_status not in [TourGuideInfo.UNVERIFIED, TourGuideInfo.REFUSED]: |
|
| 42 |
+ return response(TourGuideStatusCode.TOURGUIDE_ALREADY_NOT_UNVERIFIED) |
|
| 43 |
+ if not created: |
|
| 44 |
+ for key, value in fields.iteritems(): |
|
| 45 |
+ setattr(tourguide, key, value) |
|
| 46 |
+ tourguide.save() |
|
| 47 |
+ |
|
| 48 |
+ return response(200, 'Submit Success', u'提交成功', {})
|
@@ -39,7 +39,7 @@ def lensman_login_api(request): |
||
| 39 | 39 |
|
| 40 | 40 |
@logit |
| 41 | 41 |
def user_is_registered_api(request): |
| 42 |
- return response(200, '', '', {
|
|
| 42 |
+ return response(200, data={
|
|
| 43 | 43 |
'registered': UserInfo.objects.filter(username=request.POST.get('username', '')).exists(),
|
| 44 | 44 |
}) |
| 45 | 45 |
|
@@ -3,6 +3,7 @@ |
||
| 3 | 3 |
from django.conf.urls import url |
| 4 | 4 |
|
| 5 | 5 |
from account import views as account_views |
| 6 |
+from account import tourguide_views |
|
| 6 | 7 |
from group import views as group_views |
| 7 | 8 |
from group import lensman_views |
| 8 | 9 |
from message import views as message_views |
@@ -41,6 +42,11 @@ urlpatterns += [ |
||
| 41 | 42 |
url(r'^l/origin_wanted$', lensman_views.lensman_origin_wanted_api, name='lensman_origin_wanted_api'), # 摄影师原图订单 |
| 42 | 43 |
] |
| 43 | 44 |
|
| 45 |
+# 导游相关 |
|
| 46 |
+urlpatterns += [ |
|
| 47 |
+ url(r'^t/submit$', tourguide_views.tourguide_submit_api, name='tourguide_submit_api'), # 导游信息提交 |
|
| 48 |
+] |
|
| 49 |
+ |
|
| 44 | 50 |
# 群组相关 |
| 45 | 51 |
urlpatterns += [ |
| 46 | 52 |
url(r'^g/create$', group_views.group_create_api, name='group_create_api'), # 群组创建 |
@@ -0,0 +1,213 @@ |
||
| 1 |
+{% load staticfiles %}
|
|
| 2 |
+ |
|
| 3 |
+<!DOCTYPE html> |
|
| 4 |
+<html lang="zh-CN"> |
|
| 5 |
+ <head> |
|
| 6 |
+ <meta charset="utf-8"> |
|
| 7 |
+ <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
|
| 8 |
+ <meta name="format-detection" content="telephone=no,email=no,address=no"> |
|
| 9 |
+ <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no"> |
|
| 10 |
+ <title>导游授权</title> |
|
| 11 |
+ |
|
| 12 |
+ <link href="https://res.wx.qq.com/open/libs/weui/0.4.3/weui.min.css" rel="stylesheet" type="text/css" /> |
|
| 13 |
+ |
|
| 14 |
+ <style> |
|
| 15 |
+ input:required:invalid {
|
|
| 16 |
+ color: #E64340; |
|
| 17 |
+ } |
|
| 18 |
+ input:required:valid {
|
|
| 19 |
+ color: rgb(0, 0, 0); |
|
| 20 |
+ } |
|
| 21 |
+ </style> |
|
| 22 |
+ </head> |
|
| 23 |
+ <body> |
|
| 24 |
+ <div class="container" > |
|
| 25 |
+ <div class="weui_cells_title">基本信息</div> |
|
| 26 |
+ <div class="weui_cells weui_cells_form"> |
|
| 27 |
+ <div class="weui_cell"> |
|
| 28 |
+ <div class="weui_cell_hd"><label for="" class="weui_label">姓名</label></div> |
|
| 29 |
+ <div class="weui_cell_bd weui_cell_primary"> |
|
| 30 |
+ <input id="name" class="weui_input" type="text" value="{{ tourguide_info.name }}" placeholder="请输入姓名" {% if not modified %}disabled{% endif %}>
|
|
| 31 |
+ </div> |
|
| 32 |
+ </div> |
|
| 33 |
+ <div class="weui_cell weui_cell_select weui_select_after"> |
|
| 34 |
+ <div class="weui_cell_hd"><label for="" class="weui_label">性别</label></div> |
|
| 35 |
+ <div class="weui_cell_bd weui_cell_primary"> |
|
| 36 |
+ <select id="sex" class="weui_select" name="select" {% if not modified %}disabled{% endif %}>
|
|
| 37 |
+ <option value="1" {% ifequal tourguide_info.sex 1 %}selected{% endifequal %}>男</option>
|
|
| 38 |
+ <option value="0" {% ifequal tourguide_info.sex 0 %}selected{% endifequal %}>女</option>
|
|
| 39 |
+ </select> |
|
| 40 |
+ </div> |
|
| 41 |
+ </div> |
|
| 42 |
+ <div class="weui_cell"> |
|
| 43 |
+ <div class="weui_cell_hd"><label for="" class="weui_label">手机号</label></div> |
|
| 44 |
+ <div class="weui_cell_bd weui_cell_primary"> |
|
| 45 |
+ <input id="phone" class="weui_input" type="text" required="required" pattern="[0-9]{11}" value="{{ tourguide_info.phone }}" placeholder="请输入手机号" {% if not modified %}disabled{% endif %}>
|
|
| 46 |
+ </div> |
|
| 47 |
+ </div> |
|
| 48 |
+{# <div class="weui_cell">#}
|
|
| 49 |
+{# <div class="weui_cell_hd"><label for="" class="weui_label">地址</label></div>#}
|
|
| 50 |
+{# <div class="weui_cell_bd weui_cell_primary">#}
|
|
| 51 |
+{# <input id="location" class="weui_input" type="text" value="{{ tourguide_info.location }}" placeholder="请输入地址" {% if not modified %}disabled{% endif %}>#}
|
|
| 52 |
+{# </div>#}
|
|
| 53 |
+{# </div>#}
|
|
| 54 |
+ <div class="weui_cell"> |
|
| 55 |
+ <div class="weui_cell_hd"><label for="" class="weui_label">导游证编号</label></div> |
|
| 56 |
+ <div class="weui_cell_bd weui_cell_primary"> |
|
| 57 |
+ <input id="no" class="weui_input" type="text" required="required" value="{{ tourguide_info.no }}" placeholder="请输入导游证编号" {% if not modified %}disabled{% endif %}>
|
|
| 58 |
+ </div> |
|
| 59 |
+ </div> |
|
| 60 |
+ </div> |
|
| 61 |
+ |
|
| 62 |
+ {% if tourguide_info %}
|
|
| 63 |
+ <div class="weui_cells_title">审核状态</div> |
|
| 64 |
+ <div class="weui_cells"> |
|
| 65 |
+ <div class="weui_cell"> |
|
| 66 |
+ <div class="weui_cell_bd weui_cell_primary"> |
|
| 67 |
+ <p>状态</p> |
|
| 68 |
+ </div> |
|
| 69 |
+ <div class="weui_cell_ft"> |
|
| 70 |
+ {% ifequal tourguide_info.status -1 %}已拒绝{% endifequal %}
|
|
| 71 |
+ {% ifequal tourguide_info.status 0 %}审核中{% endifequal %}
|
|
| 72 |
+ {% ifequal tourguide_info.status 1 %}已激活{% endifequal %}
|
|
| 73 |
+ {% ifequal tourguide_info.status 2 %}已禁用{% endifequal %}
|
|
| 74 |
+ {% ifequal tourguide_info.status 3 %}已删除{% endifequal %}
|
|
| 75 |
+ </div> |
|
| 76 |
+ </div> |
|
| 77 |
+ </div> |
|
| 78 |
+ {% endif %}
|
|
| 79 |
+ |
|
| 80 |
+ |
|
| 81 |
+ {% ifequal tourguide_info.status -1 %}
|
|
| 82 |
+ <div class="weui_cells_title">拒绝原因</div> |
|
| 83 |
+ <div class="weui_cells"> |
|
| 84 |
+ <div class="weui_panel_bd"> |
|
| 85 |
+ <div class="weui_media_box weui_media_text"> |
|
| 86 |
+ <p class="weui_media_desc">{{ tourguide_info.refused_reason|safe|linebreaks }}</p>
|
|
| 87 |
+ </div> |
|
| 88 |
+ </div> |
|
| 89 |
+ </div> |
|
| 90 |
+ {% endifequal %}
|
|
| 91 |
+ |
|
| 92 |
+ <br> |
|
| 93 |
+ |
|
| 94 |
+ {% if modified %}<button id="submit" class="weui_btn weui_btn_warn">确认</button>{% endif %}
|
|
| 95 |
+ |
|
| 96 |
+ <div class="weui_dialog_alert" id="dialog" style="display: none"> |
|
| 97 |
+ <div class="weui_mask"></div> |
|
| 98 |
+ <div class="weui_dialog"> |
|
| 99 |
+ <div class="weui_dialog_hd"><strong id="title" class="weui_dialog_title">弹窗标题</strong></div> |
|
| 100 |
+ <div id="content" class="weui_dialog_bd">弹窗内容,告知当前页面信息等</div> |
|
| 101 |
+ <div class="weui_dialog_ft"> |
|
| 102 |
+ <a href="javascript:;" class="weui_btn_dialog primary">确定</a> |
|
| 103 |
+ </div> |
|
| 104 |
+ </div> |
|
| 105 |
+ </div> |
|
| 106 |
+ |
|
| 107 |
+ <div id="toast" style="display: none;"> |
|
| 108 |
+ <div class="weui_mask_transparent"></div> |
|
| 109 |
+ <div class="weui_toast"> |
|
| 110 |
+ <i class="weui_icon_toast"></i> |
|
| 111 |
+ <p class="weui_toast_content">已完成</p> |
|
| 112 |
+ </div> |
|
| 113 |
+ </div> |
|
| 114 |
+ </div> |
|
| 115 |
+ |
|
| 116 |
+ <script src="//cdn.bootcss.com/zepto/1.1.6/zepto.min.js"></script> |
|
| 117 |
+ <script> |
|
| 118 |
+ {% if modified %}
|
|
| 119 |
+ $(function() {
|
|
| 120 |
+ function getURLParameter(name) {
|
|
| 121 |
+ return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.search) || [null, ''])[1].replace(/\+/g, '%20')) || null;
|
|
| 122 |
+ } |
|
| 123 |
+ |
|
| 124 |
+ function show_error_dialog(title, content) {
|
|
| 125 |
+ $('#dialog #title').text(title);
|
|
| 126 |
+ $('#dialog #content').text(content);
|
|
| 127 |
+ $('#dialog').show();
|
|
| 128 |
+ } |
|
| 129 |
+ |
|
| 130 |
+ function data_check() {
|
|
| 131 |
+ var unionid = getURLParameter('unionid');
|
|
| 132 |
+ if (!unionid) {
|
|
| 133 |
+ show_error_dialog('微信授权', '微信授权失败,请重新打开页面');
|
|
| 134 |
+ return false; |
|
| 135 |
+ } |
|
| 136 |
+ |
|
| 137 |
+ var name = $('#name').val();
|
|
| 138 |
+ if (!name) {
|
|
| 139 |
+ show_error_dialog('姓名', '姓名错误,请检查重新输入');
|
|
| 140 |
+ return false; |
|
| 141 |
+ } |
|
| 142 |
+ |
|
| 143 |
+ var phone_valid = $('#phone').is(':valid');
|
|
| 144 |
+ if (!phone_valid) {
|
|
| 145 |
+ show_error_dialog('手机号', '手机号错误,请检查重新输入');
|
|
| 146 |
+ return false; |
|
| 147 |
+ } |
|
| 148 |
+ |
|
| 149 |
+{# var location = $('#location').val();#}
|
|
| 150 |
+{# if (!location) {#}
|
|
| 151 |
+{# show_error_dialog('地址', '地址错误,请检查重新输入');#}
|
|
| 152 |
+{# return false;#}
|
|
| 153 |
+{# }#}
|
|
| 154 |
+ |
|
| 155 |
+ var no = $('#no').val();
|
|
| 156 |
+ if (!no) {
|
|
| 157 |
+ show_error_dialog('编号', '导游证编号错误,请检查重新输入');
|
|
| 158 |
+ return false; |
|
| 159 |
+ } |
|
| 160 |
+ |
|
| 161 |
+ return {
|
|
| 162 |
+ unionid: unionid, |
|
| 163 |
+ openid: getURLParameter('openid'),
|
|
| 164 |
+ name: name, |
|
| 165 |
+ sex: $('#sex option:checked').val(),
|
|
| 166 |
+ phone: $('#phone').val(),
|
|
| 167 |
+{# location: location,#}
|
|
| 168 |
+ no: no, |
|
| 169 |
+ } |
|
| 170 |
+ } |
|
| 171 |
+ |
|
| 172 |
+ $('#submit').click(function () {
|
|
| 173 |
+ var check_result = data_check(); |
|
| 174 |
+ if (check_result){
|
|
| 175 |
+ $.ajax({
|
|
| 176 |
+ type: 'POST', |
|
| 177 |
+ url: 't/submit', |
|
| 178 |
+ data: check_result, |
|
| 179 |
+ success: function(data) {
|
|
| 180 |
+ if (data.status == 200) {
|
|
| 181 |
+ $('#toast').show();
|
|
| 182 |
+ setTimeout(function () {
|
|
| 183 |
+ $('#toast').hide();
|
|
| 184 |
+ }, 1000); |
|
| 185 |
+ window.location.reload(); |
|
| 186 |
+ } else {
|
|
| 187 |
+ show_error_dialog('错误', data.description);
|
|
| 188 |
+ } |
|
| 189 |
+ } |
|
| 190 |
+ }) |
|
| 191 |
+ } |
|
| 192 |
+ }); |
|
| 193 |
+ |
|
| 194 |
+ $('#dialog .weui_btn_dialog').click(function () {
|
|
| 195 |
+ $('#dialog').hide();
|
|
| 196 |
+ }) |
|
| 197 |
+ }); |
|
| 198 |
+ {% endif %}
|
|
| 199 |
+ </script> |
|
| 200 |
+ <script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script> |
|
| 201 |
+ <script type="text/javascript" src="{% static 'pai2/js/jswe.js' %}?v=1"></script>
|
|
| 202 |
+ <script> |
|
| 203 |
+ V.initWxData({
|
|
| 204 |
+ imgUrl: "http://pai.ai/static/pai2/img/paiai_96_96.png", |
|
| 205 |
+ link: 'http://api.pai.ai/wx_oauth2?redirect_url=http://pai.ai/page/tourguide&scope=snsapi_base', |
|
| 206 |
+ desc: "导游授权", |
|
| 207 |
+ title: "导游授权", |
|
| 208 |
+ timeLine: "" |
|
| 209 |
+ }, true); |
|
| 210 |
+ V.hideOptionMenu(); |
|
| 211 |
+ </script> |
|
| 212 |
+ </body> |
|
| 213 |
+</html> |
@@ -2,7 +2,7 @@ |
||
| 2 | 2 |
|
| 3 | 3 |
from django.shortcuts import render |
| 4 | 4 |
|
| 5 |
-from account.models import LensmanInfo |
|
| 5 |
+from account.models import LensmanInfo, TourGuideInfo |
|
| 6 | 6 |
|
| 7 | 7 |
|
| 8 | 8 |
def user_agreement(request): |
@@ -29,3 +29,17 @@ def lensman_oauth(request): |
||
| 29 | 29 |
|
| 30 | 30 |
def lensman_price(request): |
| 31 | 31 |
return render(request, 'page/lensman_price.html', {})
|
| 32 |
+ |
|
| 33 |
+ |
|
| 34 |
+def tourguide_oauth(request): |
|
| 35 |
+ unionid = request.GET.get('unionid', '')
|
|
| 36 |
+ |
|
| 37 |
+ try: |
|
| 38 |
+ tourguide = TourGuideInfo.objects.get(unionid=unionid) |
|
| 39 |
+ except TourGuideInfo.DoesNotExist: |
|
| 40 |
+ tourguide = None |
|
| 41 |
+ |
|
| 42 |
+ return render(request, 'page/tourguide_oauth.html', {
|
|
| 43 |
+ 'tourguide_info': tourguide and tourguide.data, |
|
| 44 |
+ 'modified': bool((not tourguide) or (tourguide and tourguide.user_status in [TourGuideInfo.UNVERIFIED, TourGuideInfo.REFUSED])), # 是否可以更改信息 |
|
| 45 |
+ }) |
@@ -22,6 +22,7 @@ from django.contrib import admin |
||
| 22 | 22 |
from rest_framework import routers |
| 23 | 23 |
|
| 24 | 24 |
from account import views as account_views |
| 25 |
+from account import tourguide_views |
|
| 25 | 26 |
from group import views as group_views |
| 26 | 27 |
from group import lensman_views |
| 27 | 28 |
from page import views as page_views |
@@ -69,6 +70,8 @@ urlpatterns += [ |
||
| 69 | 70 |
|
| 70 | 71 |
url(r'^page/lensman$', page_views.lensman_oauth, name='lensman_oauth'), # 摄影师授权页面 |
| 71 | 72 |
url(r'^page/price$', page_views.lensman_price, name='lensman_price'), # 摄影师照片价格和分成规则 |
| 73 |
+ |
|
| 74 |
+ url(r'^page/tourguide$', page_views.tourguide_oauth, name='tourguide_oauth'), # 导游授权页面 |
|
| 72 | 75 |
] |
| 73 | 76 |
|
| 74 | 77 |
urlpatterns += [ |
@@ -84,6 +87,11 @@ urlpatterns += [ |
||
| 84 | 87 |
url(r'^page/l/submit$', lensman_views.lensman_submit_api, name='lensman_submit_api'), # 摄影师信息提交 |
| 85 | 88 |
] |
| 86 | 89 |
|
| 90 |
+# 导游相关 |
|
| 91 |
+urlpatterns += [ |
|
| 92 |
+ url(r'^page/t/submit$', tourguide_views.tourguide_submit_api, name='tourguide_submit_api'), # 导游信息提交 |
|
| 93 |
+] |
|
| 94 |
+ |
|
| 87 | 95 |
# Wire up our API using automatic URL routing. |
| 88 | 96 |
# Additionally, we include login URLs for the browsable API. |
| 89 | 97 |
urlpatterns += [ |
@@ -15,25 +15,37 @@ class LensmanStatusCode(BaseStatusCode): |
||
| 15 | 15 |
LENSMAN_NOT_ACTIVATED = StatusCodeField(400015, u'Lensman Not Activated', description=u'摄影师帐号未激活') |
| 16 | 16 |
|
| 17 | 17 |
|
| 18 |
+class TourGuideStatusCode(BaseStatusCode): |
|
| 19 |
+ """ 导游相关错误码 4001xx """ |
|
| 20 |
+ TOURGUIDE_NOT_FOUND = StatusCodeField(400101, u'Tour Guide Not Found', description=u'导游不存在') |
|
| 21 |
+ TOURGUIDE_PASSWORD_ERROR = StatusCodeField(400102, u'Tour Guide Password Error', description=u'导游密码错误') |
|
| 22 |
+ |
|
| 23 |
+ TOURGUIDE_PHONE_ALREADY_EXISTS = StatusCodeField(400105, u'Tour Guide Phone Already Exists', description=u'手机号已经存在') |
|
| 24 |
+ |
|
| 25 |
+ TOURGUIDE_ALREADY_NOT_UNVERIFIED = StatusCodeField(400110, u'Tour Guide Already Not Unverified', description=u'导游帐号已激活') |
|
| 26 |
+ |
|
| 27 |
+ TOURGUIDE_NOT_ACTIVATED = StatusCodeField(400115, u'Tour Guide Not Activated', description=u'导游帐号未激活') |
|
| 28 |
+ |
|
| 29 |
+ |
|
| 18 | 30 |
class UserStatusCode(BaseStatusCode): |
| 19 |
- """ 用户相关错误码 4001xx """ |
|
| 20 |
- USER_NOT_FOUND = StatusCodeField(400101, u'User Not Found', description=u'用户不存在') |
|
| 21 |
- USER_PASSWORD_ERROR = StatusCodeField(400102, u'User Password Error', description=u'用户密码错误') |
|
| 22 |
- USERNAME_HAS_REGISTERED = StatusCodeField(400103, u'Username Has Registered', description=u'用户名已注册') |
|
| 31 |
+ """ 用户相关错误码 4005xx """ |
|
| 32 |
+ USER_NOT_FOUND = StatusCodeField(400501, u'User Not Found', description=u'用户不存在') |
|
| 33 |
+ USER_PASSWORD_ERROR = StatusCodeField(400502, u'User Password Error', description=u'用户密码错误') |
|
| 34 |
+ USERNAME_HAS_REGISTERED = StatusCodeField(400503, u'Username Has Registered', description=u'用户名已注册') |
|
| 23 | 35 |
|
| 24 |
- GUEST_NOT_ALLOWED = StatusCodeField(400111, u'Guest Not ALLOWED', description=u'游客登录未开启') |
|
| 36 |
+ GUEST_NOT_ALLOWED = StatusCodeField(400511, u'Guest Not ALLOWED', description=u'游客登录未开启') |
|
| 25 | 37 |
|
| 26 | 38 |
|
| 27 | 39 |
class PhoneStatusCode(BaseStatusCode): |
| 28 |
- """ 手机相关错误码 4002xx """ |
|
| 29 |
- PHONE_NOT_FOUND = StatusCodeField(400201, u'Phone Not Found', description=u'手机不存在') |
|
| 40 |
+ """ 手机相关错误码 4006xx """ |
|
| 41 |
+ PHONE_NOT_FOUND = StatusCodeField(400601, u'Phone Not Found', description=u'手机不存在') |
|
| 30 | 42 |
|
| 31 | 43 |
|
| 32 | 44 |
class WechatStatusCode(BaseStatusCode): |
| 33 |
- """ 微信相关错误码 4003xx """ |
|
| 34 |
- WECHAT_NOT_FOUND = StatusCodeField(400301, u'Wechat Not Found', description=u'微信不存在') |
|
| 35 |
- UNIONID_NOT_FOUND = StatusCodeField(400302, u'Unionid Not Found', description=u'微信 UNIONID 不存在') |
|
| 36 |
- OPENID_NOT_FOUND = StatusCodeField(400303, u'OPENID Not Found', description=u'微信 OPENID 不存在') |
|
| 45 |
+ """ 微信相关错误码 4007xx """ |
|
| 46 |
+ WECHAT_NOT_FOUND = StatusCodeField(400701, u'Wechat Not Found', description=u'微信不存在') |
|
| 47 |
+ UNIONID_NOT_FOUND = StatusCodeField(400702, u'Unionid Not Found', description=u'微信 UNIONID 不存在') |
|
| 48 |
+ OPENID_NOT_FOUND = StatusCodeField(400703, u'OPENID Not Found', description=u'微信 OPENID 不存在') |
|
| 37 | 49 |
|
| 38 | 50 |
|
| 39 | 51 |
class PhotoStatusCode(BaseStatusCode): |