afa51c13 by 周伟奇

add errorType

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