afa51c13 by 周伟奇

add errorType

1 parent 3e4847e0
......@@ -7,4 +7,5 @@ urlpatterns = [
path(r'settlement/v1', views.SECompareView.as_view()),
path(r'offline/v1', views.CompareOfflineView.as_view()),
path(r'result', views.CompareResultView.as_view()),
path(r'resources', views.ResourcesView.as_view()),
]
......
......@@ -58,3 +58,11 @@ class WorkflowName(NamedEnum):
NORMAL = (0, 'Normal BS')
MOBILE = (1, 'Mobile BS')
class ErrorType(NamedEnum):
OCR = (0, 'OCR识别错误')
INPUT = (1, '输入比对信息错误')
NF = (2, '相关文件未找到')
IMAGE = (3, '图片问题')
OTHER = (4, '其他')
......
......@@ -31,6 +31,7 @@ from .models import (
HILCACompareResult,
HILSECompareResult,
)
from .named_enum import ErrorType
from .mixins import DocHandler
from . import consts
from apps.account.authentication import OAuth2AuthenticationWithUser
......@@ -822,3 +823,15 @@ class CompareResultView(GenericView):
# """.format(body_html)
# return HttpResponse(html)
class ResourcesView(GenericView):
permission_classes = []
authentication_classes = []
def get(self, request):
error_type = ErrorType.get_mappings()
resources = {
'error_type': error_type
}
return response.ok(data=resources)
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!