Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
周伟奇
/
bmw-ocr
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
afa51c13
authored
2021-08-09 14:18:39 +0800
by
周伟奇
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
add errorType
1 parent
3e4847e0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
0 deletions
src/apps/doc/compare_urls.py
src/apps/doc/named_enum.py
src/apps/doc/views.py
src/apps/doc/compare_urls.py
View file @
afa51c1
...
...
@@ -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
()),
]
...
...
src/apps/doc/named_enum.py
View file @
afa51c1
...
...
@@ -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
,
'其他'
)
...
...
src/apps/doc/views.py
View file @
afa51c1
...
...
@@ -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
)
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment