Disclosure of Invention
Based on this, the present invention provides a method and an apparatus for designing an open interface of an arbitration case service system, which have the advantages of asynchronously and simultaneously submitting case data, improving transmission efficiency, and avoiding the generation of garbage data at the end of the arbitration case service system.
In order to achieve the above object, a first aspect of the present invention provides a method for designing an open interface of an arbitrated case service system, where the arbitrated case service system is provided with a new case interface, an add case material interface, and a submit arbitration request interface, and the method includes:
responding to a request of a newly-built case, calling the newly-built case interface, and generating a case identifier;
responding to a request for adding case materials, and acquiring case data corresponding to the case identification submitted through the interface for adding case materials; the case data is a form formed by splicing text information and file attachments;
responding to a request for submitting arbitration, calling the interface for submitting arbitration request, and acquiring a bill of materials corresponding to the case identification;
according to the bill of materials, verifying whether the text information and the file attachments corresponding to the case identification are completely submitted;
and if the text information and the file attachments corresponding to the case identification are completely submitted, entering arbitration acceptance.
The method comprises the steps that a client side calls a newly-built case interface to create a draft case in an arbitration case system, the arbitration case system returns a case identifier of the draft case to the client side, the client side calls an interface for adding case materials to attach the case identifier when submitting case materials, the arbitration case service system associates case data according to the case identifier, wherein the case data is integrally submitted as a form formed by splicing text information and file attachments, the text information and the file attachments are not required to be associated in the process of submitting the case data by carrying the text information identifier and the file attachment identifier, asynchronous and simultaneous submission of the case data is realized, the transmission efficiency is improved, the generation of junk data by the arbitration case service system is avoided, the client side calls an interface attached material list for submitting an arbitration request, and the arbitration case service system automatically detects whether the materials of the cases are submitted completely according to the material list And once the fact that the case data is completely submitted is detected, the case accepting process is automatically entered, and the burden of manually verifying the complete submission of the case by the client is relieved.
Further, the step of responding to the request of the new case, calling the new case interface, and generating a case identifier further includes: responding to a request of a newly-built case, calling the newly-built case interface, and generating a draft case; the draft case is used for filling the case data according to the case identification, and the request responding to the newly-built case comprises a newly-built case identification preset by a client; according to the newly-built case identification, inquiring whether a draft case corresponding to the newly-built case identification already exists; and if the draft case already exists, the draft case is not newly built. After the new case identifier is used, if the response of the new case request is successful fails, the client can initiate the new case request again by using the same new case identifier, and if the arbitration case service system already creates a draft case, the client directly feeds back the created draft case instead of repeatedly creating another draft case.
Further, the adding case material interface comprises a submitting party material interface, a submitting agent material interface and a submitting evidence material interface; and the submitting party material interface, the submitting agent material interface and the submitting evidence material interface are associated through the case identification, and submit the party materials, the agent materials and the evidence materials of the case to the draft case of the case. The plurality of case material interfaces are matched to complete asynchronous and simultaneous submission of case data, and the case data submitted by the plurality of case material interfaces are associated through case identification, so that the case service arbitration system is prevented from generating junk data.
Furthermore, the form formed by splicing the text information corresponding to the case identification and the file attachment is integrally submitted as a request parameter for calling the interface for adding the case material. The method and the device can simultaneously transmit the text information and the file attachment in one case material interface calling, and solve the problem of association between the text information and the file attachment.
Furthermore, the text information and the file attachment corresponding to the case identification are spliced into a form in a multipart/form-data mode; wherein the literal information is stored in the request body of the multipart/form-data in a character string form and the file attachment is stored in a binary file form. The method adopts a multipart/form-data submission mode to simultaneously transmit the text information and the file attachment in one case material interface call, and solves the association problem between the text information and the file attachment.
A second aspect of the present invention provides a device for designing an open interface of an arbitration case service system, where the arbitration case service system is provided with a newly-built case interface, a case material adding interface, and an arbitration request submitting interface, and the device includes:
the new case unit is used for responding to the request of the new case, calling the new case interface and generating a case identifier;
a case material adding unit, configured to respond to a request for adding case materials, and acquire case data corresponding to the case identifier submitted through the case material adding interface; the case data is a form formed by splicing text information and file attachments;
a submitting arbitration request unit, configured to respond to a request for submitting arbitration, call the interface for submitting arbitration request, and obtain a bill of materials corresponding to the case identifier;
the verification unit is used for verifying whether the text information and the file attachments corresponding to the case identification are completely submitted according to the bill of materials;
and the arbitration acceptance unit is used for entering arbitration acceptance if the text information and the file attachment corresponding to the case identification are completely submitted.
Compared with the prior art, the invention has the following beneficial effects:
1. the problem that the transmission performance bottleneck and communication overtime faults are caused by large data volume of case materials is solved.
2. And through the new case identification preset by the client, the problem of junk data caused by repeated submission of the new case request is solved.
3. And integrating the submitted data in a multipart/form-data mode in the submission of the http form, so as to solve the association problem between the text information and the file attachment.
Detailed Description
For a better understanding and practice, the invention is described in detail below with reference to the accompanying drawings.
Referring to fig. 1, an embodiment of the present invention provides a method for designing an open interface of an arbitration case service system, including the following steps:
and S10, responding to a request of a new case, calling the new case interface, and generating a case identification and a draft case.
In the embodiment of the application, a user initiates a request for creating a new case at a client and calls a new case interface of an arbitration case service system. The HTTP method for calling the newly-built case interface is POST, the address of the newly-built case interface is called as/< api-path >/newArbcase, the request parameter for calling the newly-built case interface comprises an access certificate (access token), the access certificate is equivalent to a key for obtaining the calling service of the newly-built case interface and is stored in the request head of the request parameter, and the request body of the request parameter can comprise a typed case code and extension data. The arbitration case system responds to a new case request of a client, verifies the access certificate, creates a case with a draft state, namely a draft case, and generates a case identification arbcaseId corresponding to the draft case. After the client successfully calls the interface of the newly-built case, the arbitration case service system returns a json object to the client, wherein the json object comprises the case identification arbaseid and the status code SUCCESS.
In an alternative embodiment, referring to fig. 2, the step S10 includes steps S11-S13, which are as follows:
s11, responding to a request of a new case, calling the new case interface, and generating a draft case; the draft case is used for filling the case data according to the case identification, and the request responding to the newly-built case comprises a newly-built case identification preset by a client;
s12, inquiring whether a draft case corresponding to the newly-built case identification already exists according to the newly-built case identification;
and S13, if the draft case already exists, newly building the draft case.
In this embodiment of the present application, the request responding to the new case includes a new case identifier consumercase id preset by the client, where the new case identifier consumercase id mainly functions as an idempotent, and if the new case identifier consumercase id is not used, the arbitration case service system creates a new draft case each time the request of the new case is initiated, so when a "false failure" occurs, that is, the arbitration case service system has already correctly created a new draft case, but the client does not obtain a response that the request is successful (for example, a network failure happens), that is, the arbitration case service system generates waste case data in a state of the draft. After the new case identifier consumerCaseID is used, if the response of the request is successful fails, the same new case identifier consumerCaseID can be used again to initiate the request, and if the arbitration case service system already creates the draft case, the created draft case is directly fed back, instead of repeatedly creating another draft case, so that the situation that the new case requests to be repeatedly submitted to generate junk data is avoided.
S20, responding to a request for adding case materials, and acquiring case data corresponding to the case identification submitted through the interface for adding the case materials; the case data is a form formed by splicing text information and file attachments.
In the embodiment of the application, a user initiates a request for adding case materials at a client and calls an interface for adding case materials of an arbitration case service system. The request for adding the case material interface comprises case data corresponding to the case identification, wherein the case data is a form formed by splicing text information and file attachments.
In an optional embodiment, the add case material interface comprises a submitting party material interface, a submitting agent material interface and a submitting evidence material interface; and the submitting party material interface, the submitting agent material interface and the submitting evidence material interface are associated through the case identification, and submit the party materials, the agent materials and the evidence materials of the case to the draft case of the case.
In the embodiment of the application, an HTTP method for calling a submitting party material interface is POST, an address for calling the submitting party material interface is/< api-path >/arbcrase/{ arbcrase id }/little, the case identification arbcrase id is stored in the address, request parameters for calling the submitting party material interface comprise an access certificate (access token) and party case data, the access certificate is equivalent to a key for obtaining the submitting party material interface calling service and is stored in a request header of the request parameters, and the party case data is a form formed by splicing the party character information and the party document accessories.
In an optional embodiment, the case identification is a form formed by splicing the principal character information corresponding to arbaseid and the principal file attachment, and the form is integrally submitted as a request parameter for calling the submitting principal material interface.
In an optional embodiment, the case identification arbaseid corresponds to the principal character information and the principal character attachment are spliced to form a form in a multipart/form-data mode; wherein the party text information is stored in the request body of the multipart/form-data in a character string form and the party file attachment is stored in a binary file form. The multipart/form-data is a way of submitting data by post, the type of encoding when the form submits the data is specified as multipart/form-data, and the uploading data of the client is sent to the arbitration case service system in an http request body in a message form instead of a key value pair form.
In an alternative embodiment, if there are multiple principal agents, the submitting principal material interface may be invoked repeatedly, in the same case, the default principal name is unique, and if the same, a special token is added. The special labeling convention is as follows: english middle brackets ("[ ]") are added behind the same name, and the content in the middle brackets can be freely customized according to the requirements of users as long as the same name is not generated. Such as Zhangsan [1] and Zhangsan [ A ]. If the case already has subject information of the same name when the submitting party material interface is invoked, then an error message is returned.
The arbitration case system responds to a request of submitting the client material, verifies the access certificate and submits the client case data to the draft case. After the client successfully calls the interface for submitting the principal materials, the arbitration case service system returns a json object to the client, wherein the json object comprises a principal unique identifier (litigintad) and a state code (SUCCESS), and the principal unique identifier (litigintad) is used for inquiring the principal case data by the arbitration case service system.
In the embodiment of the application, the HTTP method for calling the submitting agent material interface is POST, the address for calling the submitting agent material interface is/< api-path >/arbcrase/{ arbcrase id }/agent, the case identification arbcrase id is stored in the address, the request parameter for calling the submitting agent material interface comprises an access certificate (access token) and agent case data, the access certificate is equivalent to a key for obtaining the submitting agent material interface calling service and is stored in a request header of the request parameter, and the agent case data is a form formed by splicing agent character information and agent document accessories.
In an optional embodiment, the case identification is a form formed by splicing agent character information corresponding to arbaseid and agent character attachments, and the form is integrally submitted as a request parameter for calling the submitting agent material interface.
In an optional embodiment, the agent character information corresponding to the case identifier arbaseid and the agent character attachment are spliced to form a form in a multipart/form-data mode; the character information of the agent is stored in the request body of the multipart/form-data in a character string form, and the file attachment of the agent is stored in a binary file form.
In an alternative embodiment, if there are multiple agent principals, the submit agent material interface may be invoked repeatedly, the appointment agent name is unique in the same case, and if the appointment agent name is the same, a special token is added. The special labeling convention is as follows: english middle brackets ("[ ]") are added behind the same name, and the content in the middle brackets can be freely customized according to the requirements of users as long as the same name is not generated. Such as Liqua [1] and Liqua [ A ]. If the subject information of the same name already exists in the case when the submitting agent material interface is called, error information is returned.
And the arbitration case system responds to a request of submitting agent material of a client, verifies the access certificate and submits the agent case data to the draft case. After the client successfully calls the interface for submitting the agent material, the arbitration case service system returns a json object to the client, wherein the json object comprises an agent unique identifier agentId and a status code SUCCESS, and the agent unique identifier agentId is used for inquiring agent case data by the arbitration case service system.
In the embodiment of the application, an HTTP method for calling an evidence material submitting interface is POST, an address for calling the evidence material submitting interface is/< api-path >/arbcrase/{ arbcaseId }/evidence, case identification arbcaseId is stored in the address, request parameters for calling the evidence material submitting interface include an access credential (access token) and evidence case data, the access credential is equivalent to a key for obtaining an evidence material submitting interface calling service and is stored in a request header of the request parameters, and the evidence case data is a form formed by splicing evidence text information and evidence file attachments.
In an optional embodiment, the case identification is a form formed by splicing evidence text information corresponding to arbaseid and an evidence file attachment, and the form is integrally submitted as a request parameter for calling the evidence material submitting interface.
In an optional embodiment, the case identification is a form formed by splicing evidence text information and evidence file attachments corresponding to arbaseid in a multipart/form-data mode; wherein the evidence literal information is stored in the request body of the multipart/form-data in a character string form, and the evidence file attachment is stored in a binary file form.
And the arbitration case system responds to the evidence material submitting request of the client, verifies the access certificate and submits the evidence case data to the draft case. After the client successfully calls the interface for submitting the evidence materials, the arbitration case service system returns a json object to the client, wherein the json object comprises an evidence unique identifier evidenceId and a state code SUCCESS, and the agent unique identifier evidenceId is used for inquiring evidence case data by the arbitration case service system.
In the embodiment of the application, the arbitration case business system responds to the request for adding case materials, including the request for submitting case materials, the request for submitting agent materials and the request for submitting evidence materials, acquires the case data of the principal submitted by a principal material interface, the case data of the agent submitted by an agent material interface and the evidence case data submitted by an evidence material interface, associates and submits the case data of the principal, the agent and the evidence case data to the draft case corresponding to the case identification arbaseid through the case identification arbaseid, so that the case data of the same case can be asynchronously and simultaneously submitted, the case identification arbaseid is attached during submission, the association relationship between case data uploading and the draft case is realized, and the sequential calling among case material interfaces is not required to be added, the uploading efficiency is improved, and the generation of garbage data is avoided.
And S30, responding to a request for submitting arbitration, calling the interface for submitting the arbitration request, and acquiring a bill of materials corresponding to the case identification.
In the embodiment of the application, an HTTP method calling an interface for submitting and arbitrating an application is POST, an address calling the interface for submitting and arbitrating an application is/< api-path >/arbcrase/{ arbcrase id }/submit, the case identifier arbcrase id is stored in the address, request parameters calling the interface for submitting and arbitrating an application comprise an access certificate (access token) and a material list, the access certificate is equivalent to a key for obtaining a calling service of the interface for submitting and arbitrating an application and is stored in a request header of the request parameters, and the material list is preset by a client according to content of materials submitted by the case and is stored in a request body of multipart/form-data in a character string manner.
In an optional embodiment, the request parameter for calling the interface for submitting arbitration application further comprises an attachment of arbitration application, and the attachment of arbitration application is stored in the request body of multipart/form-data in the form of binary file attachment.
And S40, verifying whether the text information and the file attachments corresponding to the case identification are completely submitted or not according to the bill of materials.
In the embodiment of the application, the arbitration case system responds to an arbitration application request submitted by a client, verifies the access certificate, and verifies whether the text information and the file attachment corresponding to the case identification are completely submitted according to the bill of materials.
And S50, if the text information and the file attachments corresponding to the case identification are completely submitted, entering arbitration acceptance.
In the embodiment of the application, the arbitration case service system verifies that the text information and the file attachments corresponding to the case identification are completely submitted through the bill of materials, and enters arbitration acceptance, namely, the state of the case is set to be checked, the checking of arbitration committee is waited, and all materials of the case are not allowed to be changed continuously during the checking period. After the client successfully calls the interface submitting the arbitration application, the arbitration case service system returns a json object to the client, wherein the json object comprises a status code 'SUCCESS'.
Since the submission of the client arbitration request and the submission of the case material occur asynchronously, it is not certain that all of the case material has been transferred to completion at the time the arbitration request is submitted. The material list in the arbitration request can enable the arbitration case service to automatically detect whether the case materials are completely submitted or not, and automatically enter the case acceptance flow once the case data are completely submitted, so that the burden of manually verifying the complete submission of the case by the client is reduced.
By applying the embodiment of the invention, a newly-built case interface is called in response to a request of newly-built case to generate case identification, case data corresponding to the case identification submitted through the case material adding interface is acquired in response to a request of adding case material, wherein the case data is a form formed by splicing text information and file attachments, the submission arbitration request interface is called in response to a submission arbitration request to acquire a material list corresponding to the case identification, whether the text information and the file attachments corresponding to the case identification are completely submitted is verified according to the material list, if the text information and the file attachments corresponding to the case identification are completely submitted, arbitration acceptance is entered, the association problem between the text information and the file attachments is solved, and the material lists of all materials are transmitted in the submission arbitration request interface, asynchronous and simultaneous case data submission is realized, transmission efficiency is improved, and junk data generated by a case service arbitration system end is avoided.
Referring to fig. 3, the present invention provides a design apparatus 3 for arbitrating open interfaces of a case service system, which includes:
a new case unit 31, configured to respond to a request for creating a new case, call the new case interface, and generate a case identifier;
a case material adding unit 32, configured to respond to a request for adding case material, and acquire case data corresponding to the case identifier submitted through the case material adding interface; the case data is a form formed by splicing text information and file attachments;
a submitting arbitration request unit 33, configured to respond to a request for submitting arbitration, call the interface for submitting arbitration request, and obtain a bill of materials corresponding to the case identifier;
a verification unit 34, configured to verify whether the text information and the file attachments corresponding to the case identifier are completely submitted according to the bill of materials;
and an arbitration accepting unit 35, configured to enter arbitration accepting if the text information and the file attachment corresponding to the case identifier have been completely submitted.
Optionally, referring to fig. 4, the new case unit 31 includes:
the generating unit 311 is configured to respond to a request for a new case, invoke the new case interface, and generate a draft case; the draft case is used for filling the case data according to the case identification, and the request responding to the newly-built case comprises a newly-built case identification preset by a client;
a querying unit 312, configured to query, according to the new case identifier, whether a draft case corresponding to the new case identifier already exists;
and the judging unit 313 is configured to, if the draft case already exists, not newly create the draft case.
Optionally, the adding case material interface includes a submitting party material interface, a submitting agent material interface and a submitting evidence material interface; and the submitting party material interface, the submitting agent material interface and the submitting evidence material interface are associated through the case identification, and submit the party materials, the agent materials and the evidence materials of the case to the draft case of the case.
Optionally, the form formed by splicing the text information corresponding to the case identifier and the file attachment is integrally submitted as a request parameter for calling the interface for adding the case material.
Optionally, the text information and the file attachment corresponding to the case identifier are spliced to form a form in a multipart/form-data manner; wherein the literal information is stored in the request body of the multipart/form-data in a character string form and the file attachment is stored in a binary file form.
By applying the embodiment of the invention, a newly-built case interface is called in response to a request of newly-built case to generate case identification, case data corresponding to the case identification submitted through the case material adding interface is acquired in response to a request of adding case material, wherein the case data is a form formed by splicing text information and file attachments, the submission arbitration request interface is called in response to a submission arbitration request to acquire a material list corresponding to the case identification, whether the text data and the file attachments corresponding to the case identification are completely submitted is verified according to the material list, if the text data and the file attachments corresponding to the case identification are completely submitted, arbitration acceptance is entered, the association problem between the text information and the file attachments is solved, and the material lists of all materials are transmitted in the submission arbitration request interface, asynchronous and simultaneous case data submission is realized, transmission efficiency is improved, and junk data generated by a case service arbitration system end is avoided.
The above-mentioned embodiments only express several embodiments of the present invention, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, to those skilled in the art, changes and modifications may be made without departing from the spirit of the present invention, and it is intended that the present invention encompass such changes and modifications.