cms part 1
Showing
6 changed files
with
282 additions
and
1 deletions
docs/cms.yaml
0 → 100644
This diff is collapsed.
Click to expand it.
... | @@ -5,6 +5,7 @@ from . import views | ... | @@ -5,6 +5,7 @@ from . import views |
5 | urlpatterns = [ | 5 | urlpatterns = [ |
6 | path(r'v1', views.CompareView.as_view()), | 6 | path(r'v1', views.CompareView.as_view()), |
7 | path(r'settlement/v1', views.SECompareView.as_view()), | 7 | path(r'settlement/v1', views.SECompareView.as_view()), |
8 | path(r'settlement/cms/v1', views.SECMSView.as_view()), | ||
8 | path(r'offline/v1', views.CompareOfflineView.as_view()), | 9 | path(r'offline/v1', views.CompareOfflineView.as_view()), |
9 | path(r'result', views.CompareResultView.as_view()), | 10 | path(r'result', views.CompareResultView.as_view()), |
10 | ] | 11 | ] | ... | ... |
... | @@ -312,6 +312,128 @@ compare_offline_args = { | ... | @@ -312,6 +312,128 @@ compare_offline_args = { |
312 | 'workflow_name': fields.Str(required=True, validate=validate.Length(max=1024)), | 312 | 'workflow_name': fields.Str(required=True, validate=validate.Length(max=1024)), |
313 | } | 313 | } |
314 | 314 | ||
315 | id_info_args = { | ||
316 | 'idType': fields.Str(required=True, validate=validate.Length(max=32)), | ||
317 | 'idNum': fields.Str(required=True, validate=validate.Length(max=64)), | ||
318 | 'idExpiryDate': CustomDate(required=True), | ||
319 | } | ||
320 | |||
321 | info_args = { | ||
322 | 'applicantType': fields.Str(required=True, validate=validate.Length(max=64)), | ||
323 | 'customersubType': fields.Str(required=True, validate=validate.Length(max=32)), | ||
324 | 'selfEmployedSubType': fields.Str(required=False, validate=validate.Length(max=32)), | ||
325 | 'name': fields.Str(required=True, validate=validate.Length(max=64)), | ||
326 | 'legalRepName': fields.Str(required=True, validate=validate.Length(max=64)), | ||
327 | 'dateOfBirth': CustomDate(required=False), | ||
328 | 'nationality': fields.Str(required=False, validate=validate.Length(max=64)), | ||
329 | 'establishmentDate': CustomDate(required=False), | ||
330 | 'IDInformation': fields.List(fields.Nested(id_info_args), required=True, | ||
331 | validate=validate.Length(min=1)), | ||
332 | } | ||
333 | |||
334 | auto_approve_details = { | ||
335 | 'aaType': fields.Str(required=True, validate=validate.Length(max=64)), | ||
336 | } | ||
337 | |||
338 | financial_info = { | ||
339 | 'vehiclePrice': CustomDecimal(required=True), | ||
340 | 'grossPrice': CustomDecimal(required=True), | ||
341 | 'associatedServicePrice': CustomDecimal(required=True), | ||
342 | 'vehiclePrincipal': CustomDecimal(required=True), | ||
343 | 'associatedServicePrincipal': CustomDecimal(required=True), | ||
344 | 'originationPrincipal': CustomDecimal(required=True), | ||
345 | 'totalDownPayment': CustomDecimal(required=True), | ||
346 | 'vehicleDownPaymentRatio': CustomDecimal(required=True), | ||
347 | 'optionAmount': CustomDecimal(required=True), | ||
348 | 'sumOfMSRPAndOption': CustomDecimal(required=True), | ||
349 | } | ||
350 | |||
351 | payment_schedule = { | ||
352 | 'no': fields.Int(required=True), | ||
353 | 'grossRentalAmount': CustomDecimal(required=True), | ||
354 | } | ||
355 | |||
356 | associated_services = { | ||
357 | 'associatedServices': fields.Str(required=True, validate=validate.Length(max=64)), | ||
358 | 'price': CustomDecimal(required=True), | ||
359 | 'financed': CustomDecimal(required=True), | ||
360 | 'total': CustomDecimal(required=True), | ||
361 | } | ||
362 | |||
363 | vehicle_info = { | ||
364 | 'vinNo': fields.Str(required=True, validate=validate.Length(max=64)), | ||
365 | } | ||
366 | |||
367 | bank_details = { | ||
368 | 'bankName': fields.Str(required=True, validate=validate.Length(max=64)), | ||
369 | 'accountHolderName': fields.Str(required=True, validate=validate.Length(max=64)), | ||
370 | 'accountNo': fields.Str(required=True, validate=validate.Length(max=64)), | ||
371 | } | ||
372 | |||
373 | insurance_details = { | ||
374 | 'insuranceType': fields.Str(required=True, validate=validate.Length(max=64)), | ||
375 | 'insuranceAmount': fields.Str(required=True, validate=validate.Length(max=64)), | ||
376 | 'startDate': CustomDate(required=True), | ||
377 | 'endDate': CustomDate(required=True), | ||
378 | } | ||
379 | |||
380 | corporate_info = { | ||
381 | 'hashCode': fields.Str(required=True, validate=validate.Length(max=64)), | ||
382 | 'borrowerName': fields.Str(required=True, validate=validate.Length(max=64)), | ||
383 | 'fiscalYear': fields.Int(required=True), | ||
384 | 'totaAssets': CustomDecimal(required=True), | ||
385 | 'totalLiabilitiesAndOwnersEquity': CustomDecimal(required=True), | ||
386 | 'cashAndCashEquivalentAtEndOfPeriod': CustomDecimal(required=True), | ||
387 | 'netProfit': CustomDecimal(required=True), | ||
388 | } | ||
389 | |||
390 | se_verification = { | ||
391 | 'applicationNo': fields.Str(required=True, validate=validate.Length(max=64)), | ||
392 | } | ||
393 | |||
394 | se_cms_content = { | ||
395 | 'financeCompany': fields.Str(required=True, validate=validate.Length(max=512)), | ||
396 | 'contractNo': fields.Str(required=True, validate=validate.Length(max=64)), | ||
397 | 'status': fields.Str(required=True, validate=validate.Length(max=64)), | ||
398 | 'branch': fields.Str(required=True, validate=validate.Length(max=512)), | ||
399 | 'fpCampaign': fields.Str(required=True, validate=validate.Length(max=512)), | ||
400 | 'applicationVersion': fields.Int(required=True), | ||
401 | 'submissionDate': CustomDate(required=True), | ||
402 | 'mortgageType': fields.Str(required=True, validate=validate.Length(max=64)), | ||
403 | 'dealerRegion': fields.Str(required=True, validate=validate.Length(max=64)), | ||
404 | 'insuranceRealNameCity': fields.Boolean(required=True), | ||
405 | 'totalFinanceAmount': CustomDecimal(required=True), | ||
406 | 'terms': fields.Int(required=True), | ||
407 | 'dealerName': fields.Str(required=True, validate=validate.Length(max=512)), | ||
408 | 'tier': fields.Str(required=True, validate=validate.Length(max=64)), | ||
409 | 'province': fields.Str(required=True, validate=validate.Length(max=64)), | ||
410 | 'fapiaoIssuerDealer': fields.Str(required=True, validate=validate.Length(max=512)), | ||
411 | 'customerName': fields.Str(required=True, validate=validate.Length(max=64)), | ||
412 | 'customerIdNo': fields.Str(required=True, validate=validate.Length(max=64)), | ||
413 | 'vehicleStatus': fields.Str(required=True, validate=validate.Length(max=64)), | ||
414 | 'applicationSource': fields.Str(required=True, validate=validate.Length(max=64)), | ||
415 | 'contractSource': fields.Str(required=True, validate=validate.Length(max=64)), | ||
416 | 'applicationRating': fields.Int(required=True), | ||
417 | |||
418 | 'applicantInformation': fields.List(fields.Nested(info_args), | ||
419 | required=True, validate=validate.Length(min=1, max=4)), | ||
420 | 'autoApprovedDetails': fields.Nested(auto_approve_details, required=True), | ||
421 | 'financialInformation': fields.Nested(financial_info, required=True), | ||
422 | 'paymentSchedule': fields.List(fields.Nested(payment_schedule), required=True, | ||
423 | validate=validate.Length(min=1)), | ||
424 | 'associatedServices': fields.List(fields.Nested(associated_services), required=True, | ||
425 | validate=validate.Length(min=1)), | ||
426 | 'vehicleInformation': fields.Nested(vehicle_info, required=True), | ||
427 | 'bankAccountDetails': fields.Nested(bank_details, required=True), | ||
428 | 'insuranceDetails': fields.Nested(insurance_details, required=True), | ||
429 | 'corporateFinancialInformation': fields.Nested(corporate_info, required=True), | ||
430 | 'settlemnetVerification': fields.Nested(se_verification, required=True), | ||
431 | } | ||
432 | |||
433 | se_cms_args = { | ||
434 | 'content': fields.Nested(se_cms_content, required=True) | ||
435 | } | ||
436 | |||
315 | 437 | ||
316 | class UploadDocView(GenericView, DocHandler): | 438 | class UploadDocView(GenericView, DocHandler): |
317 | # permission_classes = [] | 439 | # permission_classes = [] |
... | @@ -806,3 +928,33 @@ class CompareResultView(GenericView): | ... | @@ -806,3 +928,33 @@ class CompareResultView(GenericView): |
806 | return HttpResponse(html) | 928 | return HttpResponse(html) |
807 | 929 | ||
808 | # return response.ok(data=compare_result) | 930 | # return response.ok(data=compare_result) |
931 | |||
932 | |||
933 | class SECMSView(GenericView): | ||
934 | permission_classes = [IsAuthenticated] | ||
935 | authentication_classes = [OAuth2AuthenticationWithUser] | ||
936 | |||
937 | # pos上传比对信息接口 SE | ||
938 | @use_args(se_cms_args, location='data') | ||
939 | def post(self, request, args): | ||
940 | self.running_log.info('cms in') | ||
941 | return response.ok() | ||
942 | |||
943 | post.openapi_doc = ''' | ||
944 | tags: [info] | ||
945 | summary: CMS上传比对信息 | ||
946 | consumes: [application/json] | ||
947 | produces: [application/json] | ||
948 | parameters: | ||
949 | - in: body | ||
950 | name: body | ||
951 | required: true | ||
952 | schema: | ||
953 | $ref: "#/definitions/CMS" | ||
954 | |||
955 | responses: | ||
956 | 200: | ||
957 | description: ok | ||
958 | schema: | ||
959 | $ref: '#/definitions/ApiResponse' | ||
960 | ''' | ||
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
This diff is collapsed.
Click to expand it.
src/common/api_doc_bak3.py
0 → 100644
1 | base_part = ''' | ||
2 | swagger: "2.0" | ||
3 | info: | ||
4 | title: 接口文档 | ||
5 | description: 宝马ocr/biz_logic接口文档 | ||
6 | version: 1.0.0 | ||
7 | host: "li19dkocruat01vm.bmwgroup.net" | ||
8 | basePath: "/" | ||
9 | tags: | ||
10 | - name: info | ||
11 | description: 比对结果 | ||
12 | schemes: | ||
13 | - "https" | ||
14 | security: | ||
15 | - OAuth2: [] | ||
16 | ''' | ||
17 | |||
18 | # scheme: oauth | ||
19 | security_definitions = ''' | ||
20 | OAuth2: | ||
21 | type: oauth2 | ||
22 | flow: application | ||
23 | description: > | ||
24 | This API uses OAuth 2 with the application(clientCredentials) grant flow. | ||
25 | |||
26 | client_id=sMlciTkppsMzARwHpCVarm5q7DP2Vucj3ny8JFhw | ||
27 | |||
28 | client_secret=WNoOilDx140ZLcenDKfsnikv7S2LIFs60DciYoqnrZaYLqYsKpcmt7mJIL69o9AEf84uQvRnS3K2UioxfjNyImjR4UOyXbDcF6qYgTLC4KDVByKFdVhKfrn2Lc4q4BNW | ||
29 | |||
30 | scopes=write | ||
31 | tokenUrl: https://li19dkocruat01vm.bmwgroup.net/api/oauth/token/ | ||
32 | scopes: | ||
33 | write: Grants write access | ||
34 | ''' | ||
35 | |||
36 | responses = ''' | ||
37 | ErrorResponse: | ||
38 | description: 调用异常, 具体情况请参考`HTTP`状态码和`code`字段 | ||
39 | schema: | ||
40 | $ref: '#/definitions/ApiResponse' | ||
41 | NoContent: | ||
42 | description: 后台接收请求,但是没有响应内容 | ||
43 | schema: | ||
44 | $ref: '#/definitions/ApiResponse' | ||
45 | ''' | ||
46 | |||
47 | parameters = '' | ||
48 | |||
49 | definitions = ''' | ||
50 | ComparisonOffline: | ||
51 | type: object | ||
52 | required: [is_hil, case_number, request_team, request_trigger, input_file, transaction_start, transaction_end, successful_at_this_level, process_name, total_fields, workflow_name] | ||
53 | properties: | ||
54 | is_hil: | ||
55 | description: is_hil | ||
56 | type: boolean | ||
57 | example: false | ||
58 | case_number: | ||
59 | description: case_number | ||
60 | type: string | ||
61 | example: VAT Invoice Number | ||
62 | request_team: | ||
63 | description: request_team | ||
64 | type: string | ||
65 | example: Accounting | ||
66 | request_trigger: | ||
67 | description: request_trigger | ||
68 | type: string | ||
69 | example: Attended RPA (Q-Account + Machine Number) | ||
70 | input_file: | ||
71 | description: input_file | ||
72 | type: string | ||
73 | example: CH-B1000000身份证.jpeg | ||
74 | transaction_start: | ||
75 | description: transaction_start | ||
76 | type: string | ||
77 | format: date-time | ||
78 | example: "2027-04-30 19:22:29" | ||
79 | transaction_end: | ||
80 | description: transaction_end | ||
81 | type: string | ||
82 | format: date-time | ||
83 | example: "2027-04-30 19:22:29" | ||
84 | successful_at_this_level: | ||
85 | description: successful_at_this_level | ||
86 | type: boolean | ||
87 | example: false | ||
88 | failure_reason: | ||
89 | description: failure_reason | ||
90 | type: string | ||
91 | example: Fileds Name which doesn’t pass verification | ||
92 | process_name: | ||
93 | description: process_name | ||
94 | type: string | ||
95 | example: F1_VATInvoiceMapping | ||
96 | total_fields: | ||
97 | description: total_fields | ||
98 | type: integer | ||
99 | example: 0 | ||
100 | workflow_name: | ||
101 | description: workflow_name | ||
102 | type: string | ||
103 | example: Normal invoice or Special invoice | ||
104 | |||
105 | ApiResponse: | ||
106 | description: 响应对象,code字段用于表示响应的状态; data字段用于存放响应内容 | ||
107 | type: object | ||
108 | required: [code, msg] | ||
109 | properties: | ||
110 | code: | ||
111 | type: integer | ||
112 | format: uint8 | ||
113 | description: '0: success | ||
114 | 1: need login | ||
115 | 2: invalid params | ||
116 | 3: internal error | ||
117 | 4: object not exist | ||
118 | 5: async wait | ||
119 | 6: no permission | ||
120 | 7: illegal operation' | ||
121 | example: 0 | ||
122 | enum: [0, 1, 2, 3, 4, 5, 6, 7] | ||
123 | msg: | ||
124 | type: string | ||
125 | example: success | ||
126 | data: | ||
127 | type: object | ||
128 | ''' | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
... | @@ -48,7 +48,7 @@ class Command(BaseCommand): | ... | @@ -48,7 +48,7 @@ class Command(BaseCommand): |
48 | view_class = view.view_class | 48 | view_class = view.view_class |
49 | url_path, path_parameters = pattern[0][0] | 49 | url_path, path_parameters = pattern[0][0] |
50 | url_path = unify_url_path_format(url_path) | 50 | url_path = unify_url_path_format(url_path) |
51 | if url_path not in ['/api/compare/offline/v1']: | 51 | if url_path not in ['/api/compare/settlement/cms/v1']: |
52 | continue | 52 | continue |
53 | url_path_paramters = getattr(view, 'parameters_doc', None) | 53 | url_path_paramters = getattr(view, 'parameters_doc', None) |
54 | if url_path_paramters: | 54 | if url_path_paramters: | ... | ... |
-
Please register or sign in to post a comment