CN108268253A - Interface code generation method and terminal device - Google Patents

Interface code generation method and terminal device Download PDF

Info

Publication number
CN108268253A
CN108268253A CN201710312852.8A CN201710312852A CN108268253A CN 108268253 A CN108268253 A CN 108268253A CN 201710312852 A CN201710312852 A CN 201710312852A CN 108268253 A CN108268253 A CN 108268253A
Authority
CN
China
Prior art keywords
interface
code
field
report documents
permission
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201710312852.8A
Other languages
Chinese (zh)
Other versions
CN108268253B (en
Inventor
张振伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN201710312852.8A priority Critical patent/CN108268253B/en
Priority to PCT/CN2018/083549 priority patent/WO2018201895A1/en
Publication of CN108268253A publication Critical patent/CN108268253A/en
Application granted granted Critical
Publication of CN108268253B publication Critical patent/CN108268253B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems

Abstract

The present invention provides a kind of interface code generation method and terminal devices, and suitable for field of computer technology, this method includes:Based on pre-defined interface structure, interface field corresponding with interface structure is established in the database;Interface field by report-building tool is exported, to generate report documents, the interface field modification instruction that user sends out is received in report documents, interface field modification is carried out to report documents;Modified report documents are imported, and according to modified report documents, the interface field in database is updated;Updated interface field is filled to Code Template, so that the interface code that generation matches with interface field.The invention enables developers to be limited by visualization tool, neatly typing at any time and can change interface field in report documents, improve the maintenance efficiency of interface field;In the present invention, the interface document that defines, which can be directly synchronized in code, to be used, and improves the development efficiency of developer.

Description

Interface code generation method and terminal device
Technical field
The invention belongs to field of computer technology more particularly to a kind of interface code generation method and terminal devices.
Background technology
In the WEB development modes of front and back end separation, developer usually requires defining interface document and carrys out specification its interface Form, such as interface IP address, parameter, type, meaning.In order to enable developer's more efficiently management interface document, respectively Kind API management tools are come into being.The visualization tool typing using the specific offer of API management tools institute and maintenance interface it is literary After shelves, by the corresponding interface structure of analysis interface document, other than it can automatically generate the repeatable Mock data utilized, Can be with the correctness of automatic Verification real interface, therefore, the appearance of API management tools improves exploitation to a certain extent The development efficiency of personnel.
Although however, developer can by API management tools specific offer visualization tool typing and safeguard connect Mouth document, but the interface document defined can not directly be synchronized in code and use, thus be difficult to yet further improve out Send out efficiency.
Invention content
In view of this, it is existing to solve an embodiment of the present invention provides a kind of interface code generation method and terminal device Good interface document can not directly be synchronized in code and use defined in technology, thus be difficult to further improve developer's The problem of development efficiency.
The first aspect of the embodiment of the present invention provides a kind of interface code generation method, including:
Based on pre-defined interface structure, interface field corresponding with the interface structure is established in the database;
The interface field by report-building tool is exported, to generate report documents, is connect in the report documents The interface field modification instruction that user sends out is received, interface field modification is carried out to the report documents;
The modified report documents are imported, and according to the modified report documents, in the database Interface field is updated;
The updated interface field is filled to Code Template, so that Code Template generation and updated institute State the interface code that interface field matches.
The second aspect of the embodiment of the present invention provides a kind of interface code generating means, including:
Maintenance module, for based on pre-defined interface structure, establishing in the database corresponding with the interface structure Interface field;
Export module, for the interface field to be exported by report-building tool, to generate report documents, described The interface field modification instruction that user sends out is received in report documents, interface field modification is carried out to the report documents;
Update module, for importing the modified report documents, and according to the modified report documents, to institute The interface field stated in database is updated;
First generation module, for filling the updated interface field to Code Template, so that the code mould Plate generates the interface code to match with the updated interface field.
The third aspect of the embodiment of the present invention provides a kind of terminal device, and the terminal device includes memory, processing The interface code generation program that device and being stored in can be run on the memory and on the processor, the processor perform Following steps are realized during the interface code generation program:
Based on pre-defined interface structure, interface field corresponding with the interface structure is established in the database;
The interface field by report-building tool is exported, to generate report documents, is connect in the report documents The interface field modification instruction that user sends out is received, interface field modification is carried out to the report documents;
The modified report documents are imported, and according to the modified report documents, in the database Interface field is updated;
The updated interface field is filled to Code Template, so that Code Template generation and updated institute State the interface code that interface field matches.
The fourth aspect of the embodiment of the present invention provides a kind of computer readable storage medium, the computer-readable storage Media storage has interface code to generate program, when the interface code generation program is performed by least one processor, realizes such as Lower step:
Based on pre-defined interface structure, interface field corresponding with the interface structure is established in the database;
The interface field by report-building tool is exported, to generate report documents, is connect in the report documents The interface field modification instruction that user sends out is received, interface field modification is carried out to the report documents;
The modified report documents are imported, and according to the modified report documents, in the database Interface field is updated;
The updated interface field is filled to Code Template, so that Code Template generation and updated institute State the interface code that interface field matches.
In the embodiment of the present invention, by exporting interface field to generate report documents, the modified report text to user Shelves are imported, and the interface field changed according to user in report documents, realize the synchronization of interface field in the database Update so that developer need not by API management tools the visualization tool of specific offer limited, can neatly exist Typing at any time and interface field is changed in report documents, improve the maintenance efficiency of interface field in database;By by report Interface field in document is filled into Code Template, can be automatically generated interface code using Code Template, be ensure that definition Good interface document, which can be directly synchronized in code, to be used, and therefore, compared with existing API management tools, is further carried The development efficiency of high developer.
Description of the drawings
It to describe the technical solutions in the embodiments of the present invention more clearly, below will be to embodiment or description of the prior art Needed in attached drawing be briefly described, it should be apparent that, the accompanying drawings in the following description be only the present invention some Embodiment, for those of ordinary skill in the art, without having to pay creative labor, can also be according to these Attached drawing obtains other attached drawings.
Fig. 1 is the realization flow chart of interface code generation method provided in an embodiment of the present invention;
Fig. 2 is the specific implementation flow chart of interface code generation method S103 provided in an embodiment of the present invention;
Fig. 3 is the realization flow chart for the interface code generation method that another embodiment of the present invention provides;
Fig. 4 is the realization flow chart for the interface code generation method that further embodiment of this invention provides;
Fig. 5 is the specific implementation flow chart for the interface code generation method S403 that further embodiment of this invention provides;
Fig. 6 is the structure diagram of interface code generating means provided in an embodiment of the present invention;
Fig. 7 is the structure diagram of terminal device provided in an embodiment of the present invention.
Specific embodiment
In being described below, in order to illustrate rather than in order to limit, it is proposed that such as tool of particular system structure, technology etc Body details, to understand thoroughly the embodiment of the present invention.However, it will be clear to one skilled in the art that there is no these specifically The present invention can also be realized in the other embodiments of details.In other situations, it omits to well-known system, device, electricity Road and the detailed description of method, in case unnecessary details interferes description of the invention.
In order to illustrate technical solutions according to the invention, illustrated below by specific embodiment.
Fig. 1 shows the realization flow of interface code generation method provided in an embodiment of the present invention, and this method flow includes Step S101 to S104.The specific implementation principle of each step is as follows:
S101:Based on pre-defined interface structure, interface word corresponding with the interface structure is established in the database Section.
In the embodiment of the present invention, interface is the Border that database carries out information exchange with external system.Interface is one The statement of series methods is the set of certain methods feature, and only methodical feature does not have methodical realization to an interface, therefore These methods can realize in different places by different classes, and these realizations can have the function of it is different.External system By the interface that database is called to be provided, and based on the corresponding parameter of each method in interface, these methods can be carried out real It is existing, so as to reach the function of being realized needed for external system.Accordingly it is present in number in order to which the parameter for ensureing each method in interface has According to the field in library, the interface structure pre-defined in data base administration interface or configuration file by obtaining user, really Determine tables of data and field that database should be established and be safeguarded.Wherein, pre-defined interface structure includes table name, field, class The essential attributes such as type, major key, external key and index.
Template is generated according to preset SQL statement, reads the corresponding each essential attribute of above-mentioned interface structure, and will be each Essential attribute fills respectively to the SQL statement and generates template, and sentence is performed to export corresponding SQL.Hereafter, system, which performs, is somebody's turn to do SQL performs sentence, and a new tables of data is created in the database, and created and all types of phases in the tables of data with the table name Matched field and establish major key, external key, index etc..Therefore, it is in the database, real based on pre-defined interface structure The maintenance pair interface field corresponding with the interface structure is showed.
S102:The interface field is exported by report-building tool, to generate report documents, in the report documents The report documents are carried out interface field modification by the middle interface field modification instruction for receiving user and sending out.
In the embodiment of the present invention, the export to interface field in database is realized by report-building tool.Report generation Tool including but not limited to report tool JasperReports, BI external member Pentaho that increases income based on Java, with JasperReports is as report generation engine and the Report Solution OpenReports based on Web, java class library Pentaho Reporting, Eclipse-based open source code reporting system BIRT and based on Jakarta POI API Excel report-building tools etc..Preferably, the report-building tool in the embodiment of the present invention is based on Jakarta POI The Excel report-building tools of API, the Excel report-building tools namely JXLS frames.
The tables of data safeguarded based on JXLS frames to database is handled, using each interface field in database as One java entity class, and java entity class is exported, to generate Excel report documents.It specifically, will be each in tables of data Field name and the field type export of interface field, the row name of Excel report documents or row name are exported as by interface field name, Specific field type is exported as into the field contents in report documents corresponding to row or column.
Derived Excel report documents are stored in system as the storage path specified by user.When user want be It, can be by transmitting and checking each tables of data when uniting or the interface field of each tables of data in database is checked in other external environments Excel report documents derived from correspondence are realized.User can without inputting the SQL statement of specified syntax rule in the database Intuitively check the interface field shown by Excel report documents and specific field type.Simultaneously as Database Requirements Higher safety, thus checked by exporting interface field to Excel report documents for external system developer, it can keep away Exempting from external system needs real-time connection database that can just check interface field in table, and it is outer that just permission is only inscribed in guarantee if necessary Portion's system developer connection database, therefore improve the safety of database.
Since Excel report documents have editability, therefore user checks the Excel report documents and is needing logarithm When modifying according to the interface field in library, can first it modify in Excel report documents to each interface field.Wherein, it is right The modification of interface field includes but not limited to increase interface field, deletes interface field and field name, word to interface field The attributes such as segment type are modified.When user performs above-mentioned modification operation in Excel report documents, in the report documents In, then the interface field modification instruction that user sends out is received, and change and instruct according to the interface field, directly to report documents In each interface field modify.
S103:The modified report documents are imported, and according to the modified report documents, to the database In interface field be updated.
Based on JXLS frames, the edited Excel report documents of user are directed into the specified store path of system.It reads Data table name and each first interface field corresponding to report documents, at the same time, according to the data table name, from database The practical corresponding each second interface field of middle reading tables of data institute, and each first interface field is connect respectively with each second Mouth field is compared or is compared each second interface field with each first interface field respectively.If there is no with The identical second interface field of first interface field, then it represents that the first interface field is new field, therefore being somebody's turn to do in database In tables of data, the new field is built automatically.If there is no the first interface fields identical with second interface field, then it represents that should The interface field that second interface field needs to delete for user, thus in the table of database, preset SQL statement is called, it will The field is deleted.Alternatively, first interface field and the second interface word of the table in database in Excel report documents When Duan Bingfei is exactly matched, using preset SQL statement, recycled after such as DROPTABLE sentences, the tables of data is deleted CREATE sentences are rebuild, and each first interface field in Excel report documents is exactly matched to store one in the database New data table.
When the field of the second interface field in the field name and tables of data of the first interface field in Excel report documents Name is identical, and when the field type of first interface field and the field type difference of the second interface field, represents that user is only right The type of interface field is modified, therefore in the table of database, judge the data of the field type of second interface field The data of the field type of first interface field can be converted to, if can, using preset SQL statement, such as CAST sentences or CONVERT sentences modify to the field type.If the data of the field type of second interface field can not be converted to first The data of the field type of interface field, then send out miscue.
For example, if the field type of second interface field is integer, the field type of first interface field is character string class Type, it is determined that the data of integer can be converted to the data of character string type;If the field type of second interface field is floating-point Type, the field type of first interface field is integer, then will appear decimal when the data of floating type being converted into the data of integer The situation that point data is lost, reduces the precision of former data storage, thus determines that the data of floating type cannot be converted to integer Data.
As one embodiment of the present of invention, as shown in Fig. 2, above-mentioned S103 is specifically included:
S201:If synchronization imports more than two modified report documents, collision alert prompting is sent out, and When receiving report documents merging instruction, described two above modified report documents are merged into processing.
If synchronization has imported more than two modified report documents, then it represents that before that moment, multiple users To being made that modification with portion report documents derived from system.For example, if report documents are transferred to difference derived from system Two terminals A and B, document 1 and document 2 respectively on terminal A and terminal B, with respectively supply terminal user a and terminal user B checked and managed to the interface field in report documents, meanwhile, terminal user a and terminal user b are mutually unwitting In the case of have updated interface field in report documents, then both by document 1 and document 2 simultaneously import system when, system without Method determines which report documents used.In this case, system sends out collision alert to terminal user a and terminal user b respectively Prompting, prompts the user whether to need to merge report documents processing.It is closed receiving the report documents that any user sends out And when instructing, system merges document 1 and document 2, that is, interface field and interface all in document 1 and document 2 Type is summarized in a report documents.
S202:According to the report documents obtained after merging, the interface field in the database is updated.
The report documents are imported database by the report documents after being summarized based on interface field and interface type, So as to realization principle identical above-mentioned S103, be updated to the interface field safeguarded in database.
S104:The updated interface field is filled to Code Template, so that Code Template generation and update The interface code that the interface field afterwards matches.
In the embodiment of the present invention, Code Template is Velocity templates.Velocity templates are drawing based on Java Frame is held up, the template instruction provided can be used on object and variable defined in Java.When in the tables of data of database The interface field safeguarded is identical with the interface field of Excel report documents, and when field type exactly matches, and obtains tables of data An xml document of generation is corresponded to, the label of each interface field is included in the xml document.Velocity templates are called, are utilized Ant task Anakia in Velocity templates, are read out the xml document being generated in advance, so as to automatically will after reading Each interface field in xml document is filled into Velocity templates, and generates the interface code to match with interface field.Tool Body, in the Java project files of generation, the Velocity templates filled with each interface field are read, by Velocity templates In interface field come into the Java project files, so as to generate corresponding Java interface codes.It follows that the Java of generation The interface structure of interface code is identical with the interface structure defined in Excel report documents.
By automatically generating Java interface codes, during developer in code without realizing, in engineering code text A DTO (Data Transfer Object) code about interface is re-defined in part.
In the embodiment of the present invention, by exporting interface field to generate report documents, the modified report text to user Shelves are imported, and the interface field changed according to user in report documents, realize the synchronization of interface field in the database Update so that developer need not by API management tools the visualization tool of specific offer limited, can neatly exist Typing at any time and interface field is changed in report documents, improve the maintenance efficiency of interface field in database;By by report Interface field in document is filled into Code Template, can be automatically generated interface code using Code Template, be ensure that definition Good interface document, which can be directly synchronized in code, to be used, and therefore, compared with existing API management tools, is further carried The development efficiency of high developer.
As an alternative embodiment of the invention, Fig. 3 shows interface code generation method provided in an embodiment of the present invention Realization flow.As shown in figure 3, after above-mentioned S104, this method further includes step S105 and step S106, specific as follows:
S105:The interface code is stored, to obtain code file, and generates the version of the code file Number.
Version number is an identification number of code release.The interface code and code file generated each time all there are one Version number.Version number is used to making developer to understand whether interface code that it is called is a version needed for oneself.And And according to the version number, user can inquire the corresponding functional annotation of the version number from record sheet, so as to based on interface code And the version number of code file, it is capable of determining that whether function that the interface code provided is a work(needed for oneself Energy.
In the embodiment of the present invention, code file is Java project files.When each interface code generates, system is from default Version number's sequence in, be successively read a unassigned version number used, so as to using the version number as current time institute One version number of the interface code of generation, and utilize the version of the code file corresponding to the version number as the interface code Number.
S106:The version number of the code file is shown.
On the one hand, system is using the version number of generation as the filename of Java project files, at the same by version number's annotation in In the interface code of the Java project files.On the other hand, in the interface details page shown by system, each Java works are shown Journey file and its corresponding version number.
In the embodiment of the present invention, by generating and showing the version number of code file, version is played to developer and is carried The effect shown so that developer is in upgrade interface, and the version number that can be shown by system is visually known oneself The interface code called whether be latest edition interface, ensure that different developers can be based on the identical interface of version number Code, common to perform exploitation operation, the situation for avoiding interface code version number inconsistent occurs.
As another embodiment of the present invention, as shown in figure 4, after above-mentioned S104, the method further includes:
S401:When receiving user and sending out the call instruction based on the interface code, the account of the user is obtained Permission.
After interface code file is generated, the project information and interface that are retrieved as set by the interface code file are believed Breath.Wherein, project information is represented corresponding to the used function of realizing of the interface code file and the interface code file Specifying information of development project etc..For example, the project information can be the responsible person, project team member and project of project The information such as introduction.Notes content and interface code of the interface message including interface code are in itself.
When detecting that user is called above-mentioned interface code, with the database interface corresponding to by the interface code The information come in management data list or when being managed to the project information and interface message of the interface code, to user into Row permission is identified.At this point, obtaining the currently used management account of user, the pipe is matched from preset account permissions list Account is managed, so that it is determined that going out the corresponding account permission of the management account.Wherein, in each management account generation, the management account Corresponding account permission is defaulted in by data base administrator in account permissions list simultaneously.Manage the corresponding account permission of account Including the first permission and the second permission.
If being not matched to the currently used management account of user in account permissions list, the management account is corresponding Account permission is null value, alternatively, the corresponding account permission of the management account is illegal permission, it is determined that the account permission of the user For above-mentioned first permission.
S402:If the account permission is the first permission, call instruction described in refusal respond.
In the embodiment of the present invention, the first permission represents that limitation user is checked and managed to the related information of interface code Reason, the related information of interface code include interface message and project information.Therefore, any tune that system will not send out the user It is made a response with instruction.
S403:If the account permission is the second permission, the call instruction is responded.
In the embodiment of the present invention, the second permission represents that user is allowed to be associated with to the partial association information of interface code or all Information is checked and is managed.Wherein, the second permission includes checking permission, part administration authority and administration authority.Thus exist Under different types of second permission, system will make a response the different call instructions that the user sends out.
Fig. 5 shows the specific implementation flow for the interface code generation method S403 that further embodiment of this invention provides, in detail It states as follows:
S501:If the account permission checks permission to be described, instruction, which responds, to be checked to the interface message.
In the embodiment of the present invention, the above-mentioned call instruction based on interface code is looked into including the interface message based on interface code See instruction, interface message management instruction and project information management instruction, above-mentioned second permission includes checking that permission, part manage Permission and administration authority.
When confirm from account permissions list it is used by a user management account corresponding to account permission be the power of checking In limited time, the interface message based on interface code only is opened to the user and checks permission, without other management of open interface code Permission.In the case where account permission is to check permission, if the call instruction received by system checks instruction for interface message, After then being responded to the call instruction, the interface message of interface code is shown, so that user is in a read-only state, energy It enough checks the interface message, and can not modify to the interface message.
If the call instruction received by system is instructed for interface message management instruction or project information management, refuse to ring Should call instruction, i.e., the call instruction is not made a response.
S502:If the account permission is part administration authority, instruction is checked to the interface message and described is connect Mouth information management instruction is responded.
When confirm from account permissions list it is used by a user management account corresponding to account permission for part manage When managing permission, the interface message management based on interface code is only opened to the user and checks permission, without open interface generation The project information management permission of code.In the case where account permission is part administration authority, if the calling received by system refers to It enables and checks instruction or interface message management instruction for interface message, then after being responded to the call instruction, by interface code Interface message is shown.If the call instruction received by system is instructed for interface message management, according to interface message pipe The entrained specifying information of reason instruction, update of modifying to the interface message of interface code.
If the call instruction received by system is instructed for project information management, the refusal respond call instruction, i.e., not The call instruction is made a response.
S503:If the account permission is administration authority, instruction, the interface message pipe are checked to the interface message Reason instruction and project information management instruction are responded.
When confirm from account permissions list it is used by a user management account corresponding to account permission be administrative power In limited time, to the user open all administration authorities based on interface code, including to interface message management, the permission checked and To the permission of project information management.In account permission in the case of administration authority, no matter the call instruction received by system Instruction, interface message management instruction or project information management instruction are checked for interface message, and all the call instruction is rung It should.
It is the first permission or the second permission and by confirm user management account in the embodiment of the present invention In the case of two permissions, reaffirm user is which kind of permission in the second permission, can suitably to user send out based on The call instruction of interface code is responded, and reduces the possibility that interface code is illegally divulged a secret and called by disabled user Property.Due to lacking permission maintenance strategy, thus interface code generation side provided in an embodiment of the present invention in existing API management tools Method can make up the shortcoming of existing API management tools, improve the safety of interface code.
It should be understood that the size of the serial number of each step is not meant to the priority of execution sequence, each process in above-described embodiment Execution sequence should determine that the implementation process without coping with the embodiment of the present invention forms any restriction with its function and internal logic
Corresponding to the interface code generation method described in foregoing embodiments, Fig. 6 shows provided in an embodiment of the present invention connect The structure diagram of mouth code generating unit, for convenience of description, illustrates only and the relevant part of the embodiment of the present invention.
With reference to Fig. 6, which includes:
Maintenance module 61, for based on pre-defined interface structure, establishing and the interface structure pair in the database The interface field answered.
Export module 62, for the interface field to be exported by report-building tool, to generate report documents, in institute It states and the interface field modification instruction that user sends out is received in report documents, interface field modification is carried out to the report documents.
Update module 63 is right for importing the modified report documents, and according to the modified report documents Interface field in the database is updated.
First generation module 64, for filling the updated interface field to Code Template, so that the code The interface code that template generation matches with the updated interface field.
Optionally, which further includes:
Second generation module for the interface code to be stored, to obtain code file, and generates the code The version number of file.
Display module is shown for the version number to the code file.
Optionally, the update module 63 includes:
Merge submodule, if importing more than two modified report documents for synchronization, send out conflict Alarm prompt, and when receiving report documents merging instruction, described two above modified report documents are carried out Merging treatment.
Submodule is updated, for according to the report documents obtained after merging, being carried out to the interface field in the database Update.
Optionally, which further includes:
Acquisition module, for when receiving user and sending out the call instruction based on the interface code, obtaining the use The account permission at family.
First authority module, if for the account permission be the first permission, call instruction described in refusal respond.
Second authority module if being the second permission for the account permission, responds the call instruction.
Optionally, second permission includes checking permission, part administration authority and administration authority, the call instruction Instruction, interface message management instruction and project information management instruction, the second authority module packet are checked including interface message It includes:
First response submodule, if checking permission to be described for the account permission, checks the interface message Instruction is responded.
Second response submodule, if being part administration authority for the account permission, checks the interface message Instruction and interface message management instruction are responded.
Third respond submodule, if for the account permission be administration authority, the interface message is checked instruction, The interface message management instruction and project information management instruction are responded.
Fig. 7 is the structure diagram of terminal device provided in an embodiment of the present invention.As shown in fig. 7, the terminal of the embodiment Equipment 7 includes:It processor 70, memory 71 and is stored in the memory 71 and can be run on the processor 70 Computer program 72, such as interface code generation program.The processor 70 is realized above-mentioned when performing the computer program 72 Step in each interface code generation method embodiment, such as step 101 shown in FIG. 1 is to 104.Alternatively, the processor The function of each module in above-mentioned each device embodiment, such as module 61 shown in Fig. 6 are realized during the 70 execution computer program 72 To 64 function.
Illustratively, the computer program 72 can be divided into one or more modules, one or more of Module is stored in the memory 71, and is performed by the processor 70, to complete the present invention.One or more of moulds Block can be the series of computation machine program instruction section that can complete specific function, which is used to describe the computer journey Implementation procedure of the sequence 72 in the terminal device 7.For example, the computer program 72 can be divided into maintenance module, lead Go out module, update module and the first generation module, each module concrete function is as follows:
Maintenance module is used to, based on pre-defined interface structure, establish in the database corresponding with the interface structure Interface field.
Export module is for the interface field to be exported by report-building tool, to generate report documents, described The interface field modification instruction that user sends out is received in report documents, interface field modification is carried out to the report documents.
Update module is for importing the modified report documents, and according to the modified report documents, to institute The interface field stated in database is updated.
First generation module is for filling the updated interface field to Code Template, so that the Code Template The interface code that generation matches with the updated interface field.
The terminal device 7 can be that the calculating such as desktop PC, notebook, palm PC and cloud server are set It is standby.The terminal device 7 may include, but be not limited only to, processor 70, memory 71.It will be understood by those skilled in the art that figure 7 be only the example of terminal device 7, does not form the restriction to terminal device 7, can be included than illustrating more or fewer portions Part either combines certain components or different components, such as the terminal device 7 can also include input-output equipment, net Network access device, bus etc..
Alleged processor 70 can be central processing unit (Central Processing Unit, CPU), can also be Other general processors, digital signal processor (Digital Signal Processor, DSP), application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), ready-made programmable gate array (Field- Programmable Gate Array, FPGA) either other programmable logic device, discrete gate or transistor logic, Discrete hardware components etc..General processor can be microprocessor or the processor can also be any conventional processor Deng.
The memory 71 can be the internal storage unit of the terminal device 7, such as the hard disk of terminal device 7 or interior It deposits.The memory 71 can also be the External memory equipment of the terminal device 7, such as be equipped on the terminal device 7 Plug-in type hard disk, intelligent memory card (Smart Media Card, SMC), secure digital (Secure Digital, SD) card dodge Deposit card (Flash Card) etc..Further, the memory 71 can also both include the storage inside list of the terminal device 7 Member also includes External memory equipment.The memory 71 is used to store needed for the computer program and the terminal device Other programs and data.The memory 71 can be also used for temporarily storing the data that has exported or will export.
It is apparent to those skilled in the art that for convenience of description and succinctly, only with above-mentioned each work( Can unit, module division progress for example, in practical application, can be as needed and by above-mentioned function distribution by different Functional unit, module are completed, i.e., the internal structure of described device are divided into different functional units or module, more than completion The all or part of function of description.Each functional unit, module in embodiment can be integrated in a processing unit, also may be used To be that each unit is individually physically present, can also two or more units integrate in a unit, it is above-mentioned integrated The form that hardware had both may be used in unit is realized, can also be realized in the form of SFU software functional unit.In addition, each function list Member, the specific name of module are not limited to the protection domain of the application also only to facilitate mutually distinguish.Above system The specific work process of middle unit, module can refer to the corresponding process in preceding method embodiment, and details are not described herein.
In the above-described embodiments, it all emphasizes particularly on different fields to the description of each embodiment, is not described in detail or remembers in some embodiment The part of load may refer to the associated description of other embodiments.
Those of ordinary skill in the art may realize that each exemplary lists described with reference to the embodiments described herein Member and algorithm steps can be realized with the combination of electronic hardware or computer software and electronic hardware.These functions are actually It is performed with hardware or software mode, specific application and design constraint depending on technical solution.Professional technician Described function can be realized using distinct methods to each specific application, but this realization is it is not considered that exceed The scope of the present invention.
In embodiment provided by the present invention, it should be understood that disclosed device/terminal device and method, it can be with It realizes by another way.For example, device described above/terminal device embodiment is only schematical, for example, institute The division of module or unit is stated, only a kind of division of logic function can have other dividing mode in actual implementation, such as Multiple units or component may be combined or can be integrated into another system or some features can be ignored or does not perform.Separately A bit, shown or discussed mutual coupling or direct-coupling or communication connection can be by some interfaces, device Or the INDIRECT COUPLING of unit or communication connection, can be electrical, machinery or other forms.
The unit illustrated as separating component may or may not be physically separate, be shown as unit The component shown may or may not be physical unit, you can be located at a place or can also be distributed to multiple In network element.Some or all of unit therein can be selected according to the actual needs to realize the mesh of this embodiment scheme 's.
In addition, each functional unit in each embodiment of the present invention can be integrated in a processing unit, it can also That each unit is individually physically present, can also two or more units integrate in a unit.Above-mentioned integrated list The form that hardware had both may be used in member is realized, can also be realized in the form of SFU software functional unit.
If the integrated module/unit realized in the form of SFU software functional unit and be independent product sale or In use, it can be stored in a computer read/write memory medium.Based on such understanding, the present invention realizes above-mentioned implementation All or part of flow in example method, can also instruct relevant hardware to complete, the meter by computer program Calculation machine program can be stored in a computer readable storage medium, the computer program when being executed by processor, it can be achieved that on The step of stating each embodiment of the method..Wherein, the computer program includes computer program code, the computer program Code can be source code form, object identification code form, executable file or certain intermediate forms etc..Computer-readable Jie Matter can include:Can carry the computer program code any entity or device, recording medium, USB flash disk, mobile hard disk, Magnetic disc, CD, computer storage, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium etc..It is it should be noted that described The content that computer-readable medium includes can carry out appropriate increasing according to legislation in jurisdiction and the requirement of patent practice Subtract, such as in certain jurisdictions, according to legislation and patent practice, computer-readable medium does not include electric carrier signal and electricity Believe signal.
Embodiment described above is merely illustrative of the technical solution of the present invention, rather than its limitations;Although with reference to aforementioned reality Example is applied the present invention is described in detail, it will be understood by those of ordinary skill in the art that:It still can be to aforementioned each Technical solution recorded in embodiment modifies or carries out equivalent replacement to which part technical characteristic;And these are changed Or replace, the spirit and scope for various embodiments of the present invention technical solution that it does not separate the essence of the corresponding technical solution should all It is included within protection scope of the present invention.

Claims (10)

1. a kind of interface code generation method, which is characterized in that including:
Based on pre-defined interface structure, interface field corresponding with the interface structure is established in the database;
The interface field by report-building tool is exported, to generate report documents, receives and uses in the report documents The report documents are carried out interface field modification by the interface field modification instruction that family is sent out;
The modified report documents are imported, and according to the modified report documents, to the interface in the database Field is updated;
The updated interface field is filled to Code Template, so that Code Template generation described connects with updated The interface code that mouth field matches.
2. interface code generation method as described in claim 1, which is characterized in that further include:
The interface code is stored, to obtain code file, and generates the version number of the code file;
The version number of the code file is shown.
3. interface code generation method as claimed in claim 1 or 2, which is characterized in that described to import the modified report Table document, and according to the modified report documents, the interface field in the database is updated, including:
If synchronization imports more than two modified report documents, collision alert prompting is sent out, and receiving When report documents merge instruction, described two above modified report documents are merged into processing;
According to the report documents obtained after merging, the interface field in the database is updated.
4. interface code generation method as described in claim 1, which is characterized in that further include:
When receiving user and sending out the call instruction based on the interface code, the account permission of the user is obtained;
If the account permission is the first permission, call instruction described in refusal respond;
If the account permission is the second permission, the call instruction is responded.
5. interface code generation method as claimed in claim 4, which is characterized in that second permission include check permission, Part administration authority and administration authority if the account permission is the second permission, ring the call instruction Should, including:
If the account permission checks permission to be described, instruction, which responds, to be checked to the interface message;
If the account permission is part administration authority, instruction and the interface message management are checked to the interface message Instruction is responded;
If the account permission be administration authority, the interface message is checked instruction, the interface message management instruct with And the project information management instruction is responded.
6. a kind of terminal device, which is characterized in that the terminal device includes memory, processor and is stored in the memory Interface code generation program that is upper and can running on the processor, the processor perform the interface code generation program Shi Shixian following steps:
Based on pre-defined interface structure, interface field corresponding with the interface structure is established in the database;
The interface field by report-building tool is exported, to generate report documents, receives and uses in the report documents The report documents are carried out interface field modification by the interface field modification instruction that family is sent out;
The modified report documents are imported, and according to the modified report documents, to the interface in the database Field is updated;
The updated interface field is filled to Code Template, so that Code Template generation described connects with updated The interface code that mouth field matches.
7. terminal device as claimed in claim 6, which is characterized in that the processor performs the interface code generation program When, also realize following steps:
The interface code is stored, to obtain code file, and generates the version number of the code file;
The version number of the code file is shown.
8. terminal device as claimed in claim 6, which is characterized in that described to import the modified report documents, and root According to the modified report documents, the step of being updated to the interface field in the database, specifically include:
If synchronization imports more than two modified report documents, collision alert prompting is sent out, and receiving When report documents merge instruction, described two above modified report documents are merged into processing;
According to the report documents obtained after merging, the interface field in the database is updated.
9. terminal device as claimed in claim 6, which is characterized in that the processor performs the interface code generation program When, also realize following steps:
When receiving user and sending out the call instruction based on the interface code, the account permission of the user is obtained;
If the account permission is the first permission, call instruction described in refusal respond;
If the account permission is the second permission, the call instruction is responded.
10. a kind of computer readable storage medium, the computer-readable recording medium storage has interface code to generate program, It is characterized in that, when the interface code generation program is performed by least one processor, realizes such as any one of claim 1-5 The step of described interface code generation method.
CN201710312852.8A 2017-05-05 2017-05-05 Interface code generation method and terminal equipment Active CN108268253B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201710312852.8A CN108268253B (en) 2017-05-05 2017-05-05 Interface code generation method and terminal equipment
PCT/CN2018/083549 WO2018201895A1 (en) 2017-05-05 2018-04-18 Interface code generation method, apparatus, terminal device and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710312852.8A CN108268253B (en) 2017-05-05 2017-05-05 Interface code generation method and terminal equipment

Publications (2)

Publication Number Publication Date
CN108268253A true CN108268253A (en) 2018-07-10
CN108268253B CN108268253B (en) 2020-01-03

Family

ID=62771645

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710312852.8A Active CN108268253B (en) 2017-05-05 2017-05-05 Interface code generation method and terminal equipment

Country Status (2)

Country Link
CN (1) CN108268253B (en)
WO (1) WO2018201895A1 (en)

Cited By (28)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109062801A (en) * 2018-08-01 2018-12-21 四川长虹电器股份有限公司 Software interface automated conversion system
CN109614102A (en) * 2018-10-09 2019-04-12 平安科技(深圳)有限公司 Code automatic generation method, device, electronic equipment and storage medium
CN109726213A (en) * 2018-12-10 2019-05-07 网易无尾熊(杭州)科技有限公司 A kind of program code conversion method, device, medium and calculate equipment
CN109828963A (en) * 2018-12-14 2019-05-31 中国平安人寿保险股份有限公司 Method of data synchronization, device, system, computer and readable storage medium storing program for executing
CN109933573A (en) * 2019-01-30 2019-06-25 北京融链科技有限公司 Data bank service update method, apparatus and system
CN110109656A (en) * 2019-03-25 2019-08-09 平安科技(深圳)有限公司 Interface analogy method, device, computer equipment and storage medium
CN110175022A (en) * 2019-04-25 2019-08-27 平安科技(深圳)有限公司 Automatically generate the method, apparatus and storage medium, computer equipment of POJO class
CN110262783A (en) * 2019-05-22 2019-09-20 深圳华科云动力科技有限公司 A kind of interface creation method, device and terminal device
CN110262782A (en) * 2019-05-10 2019-09-20 平安科技(深圳)有限公司 The interface comparison method and device of software systems
CN110377514A (en) * 2019-07-12 2019-10-25 中汇信息技术(上海)有限公司 Management method, device, electronic equipment and the storage medium of software component
CN110474970A (en) * 2019-07-31 2019-11-19 澳克多普有限公司 A kind of code synchronisation method, apparatus and system
CN110955451A (en) * 2019-12-06 2020-04-03 中国银行股份有限公司 Changing method and device of online interface
CN111126008A (en) * 2019-12-25 2020-05-08 广东南方海岸科技服务有限公司 XSD-based code generation method and device, computer equipment and storage medium
CN111125064A (en) * 2019-12-24 2020-05-08 中国建设银行股份有限公司 Method and device for generating database mode definition statement
CN111459466A (en) * 2020-03-31 2020-07-28 广州酷狗计算机科技有限公司 Code generation method, device, equipment and storage medium
WO2020155784A1 (en) * 2019-01-31 2020-08-06 平安科技(深圳)有限公司 General-purpose data interface-based message storage method and apparatus, and computer device
CN111695328A (en) * 2020-06-16 2020-09-22 深圳前海微众银行股份有限公司 Method, device, equipment and storage medium for generating simulation test message
CN111782650A (en) * 2020-06-28 2020-10-16 京东数字科技控股有限公司 Dynamic data storage method and device, electronic equipment and storage medium
CN112256252A (en) * 2019-07-22 2021-01-22 腾讯科技(深圳)有限公司 Interface generation method and device, storage medium and electronic equipment
CN112380281A (en) * 2020-10-30 2021-02-19 中国人寿保险股份有限公司 Platform layer code generation method and device, electronic equipment and storage medium
CN112463261A (en) * 2020-11-20 2021-03-09 北京达佳互联信息技术有限公司 Interface calling method and device
CN112947963A (en) * 2021-02-26 2021-06-11 平安普惠企业管理有限公司 Interface operation and maintenance method and device, computer equipment and storage medium
CN112947911A (en) * 2021-04-26 2021-06-11 平安普惠企业管理有限公司 Interface script generation method, device, equipment and storage medium
CN113282457A (en) * 2021-05-25 2021-08-20 山东浪潮通软信息科技有限公司 Method, device and medium for maintaining heterogeneous system integration interface information
CN114003293A (en) * 2021-12-30 2022-02-01 云账户技术(天津)有限公司 Interface management method, device, electronic equipment and readable storage medium
CN114153909A (en) * 2021-11-26 2022-03-08 北京人大金仓信息技术股份有限公司 Database table structure translation method and device based on Velocity template engine
CN114168119A (en) * 2021-12-07 2022-03-11 北京百度网讯科技有限公司 Code file editing method and device, electronic equipment and storage medium
WO2022188821A1 (en) * 2021-03-09 2022-09-15 智慧芽信息科技(苏州)有限公司 Processing method and apparatus for performing custom field indexing on file, and server and system

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104375814A (en) * 2013-08-14 2015-02-25 腾讯科技(深圳)有限公司 Generation method and device of an interface document
CN105404527A (en) * 2015-09-24 2016-03-16 国网山东省电力公司 Interface configuration method and system based on SAP (System Applications and Products in Data Processing) platform
US20160080397A1 (en) * 2014-09-12 2016-03-17 Steven V. Bacastow Method and System for Forensic Data Tracking

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103136097A (en) * 2011-11-29 2013-06-05 神州数码信息系统有限公司 Method of software testing simulator frame construction

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104375814A (en) * 2013-08-14 2015-02-25 腾讯科技(深圳)有限公司 Generation method and device of an interface document
US20160080397A1 (en) * 2014-09-12 2016-03-17 Steven V. Bacastow Method and System for Forensic Data Tracking
CN105404527A (en) * 2015-09-24 2016-03-16 国网山东省电力公司 Interface configuration method and system based on SAP (System Applications and Products in Data Processing) platform

Cited By (38)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109062801A (en) * 2018-08-01 2018-12-21 四川长虹电器股份有限公司 Software interface automated conversion system
CN109614102A (en) * 2018-10-09 2019-04-12 平安科技(深圳)有限公司 Code automatic generation method, device, electronic equipment and storage medium
CN109726213A (en) * 2018-12-10 2019-05-07 网易无尾熊(杭州)科技有限公司 A kind of program code conversion method, device, medium and calculate equipment
CN109828963A (en) * 2018-12-14 2019-05-31 中国平安人寿保险股份有限公司 Method of data synchronization, device, system, computer and readable storage medium storing program for executing
CN109933573A (en) * 2019-01-30 2019-06-25 北京融链科技有限公司 Data bank service update method, apparatus and system
WO2020155784A1 (en) * 2019-01-31 2020-08-06 平安科技(深圳)有限公司 General-purpose data interface-based message storage method and apparatus, and computer device
CN110109656A (en) * 2019-03-25 2019-08-09 平安科技(深圳)有限公司 Interface analogy method, device, computer equipment and storage medium
CN110175022A (en) * 2019-04-25 2019-08-27 平安科技(深圳)有限公司 Automatically generate the method, apparatus and storage medium, computer equipment of POJO class
CN110175022B (en) * 2019-04-25 2023-10-13 平安科技(深圳)有限公司 Method and device for automatically generating POJO class, storage medium and computer equipment
CN110262782A (en) * 2019-05-10 2019-09-20 平安科技(深圳)有限公司 The interface comparison method and device of software systems
CN110262783B (en) * 2019-05-22 2023-08-08 深圳华科云动力科技有限公司 Interface generation method and device and terminal equipment
CN110262783A (en) * 2019-05-22 2019-09-20 深圳华科云动力科技有限公司 A kind of interface creation method, device and terminal device
CN110377514A (en) * 2019-07-12 2019-10-25 中汇信息技术(上海)有限公司 Management method, device, electronic equipment and the storage medium of software component
CN112256252A (en) * 2019-07-22 2021-01-22 腾讯科技(深圳)有限公司 Interface generation method and device, storage medium and electronic equipment
CN112256252B (en) * 2019-07-22 2023-09-26 腾讯科技(深圳)有限公司 Interface generation method and device, storage medium and electronic equipment
CN110474970A (en) * 2019-07-31 2019-11-19 澳克多普有限公司 A kind of code synchronisation method, apparatus and system
CN110474970B (en) * 2019-07-31 2022-03-01 澳克多普有限公司 Code synchronization method, device and system
CN110955451B (en) * 2019-12-06 2023-07-25 中国银行股份有限公司 Method and device for changing online interface
CN110955451A (en) * 2019-12-06 2020-04-03 中国银行股份有限公司 Changing method and device of online interface
CN111125064A (en) * 2019-12-24 2020-05-08 中国建设银行股份有限公司 Method and device for generating database mode definition statement
CN111125064B (en) * 2019-12-24 2023-08-29 中国建设银行股份有限公司 Method and device for generating database schema definition statement
CN111126008A (en) * 2019-12-25 2020-05-08 广东南方海岸科技服务有限公司 XSD-based code generation method and device, computer equipment and storage medium
CN111126008B (en) * 2019-12-25 2023-05-26 广东南方海岸科技服务有限公司 Code generation method and device based on XSD, computer equipment and storage medium
CN111459466A (en) * 2020-03-31 2020-07-28 广州酷狗计算机科技有限公司 Code generation method, device, equipment and storage medium
CN111459466B (en) * 2020-03-31 2023-10-20 广州酷狗计算机科技有限公司 Code generation method, device, equipment and storage medium
CN111695328A (en) * 2020-06-16 2020-09-22 深圳前海微众银行股份有限公司 Method, device, equipment and storage medium for generating simulation test message
CN111782650B (en) * 2020-06-28 2024-04-05 京东科技控股股份有限公司 Dynamic data warehousing method and device, electronic equipment and storage medium
CN111782650A (en) * 2020-06-28 2020-10-16 京东数字科技控股有限公司 Dynamic data storage method and device, electronic equipment and storage medium
CN112380281A (en) * 2020-10-30 2021-02-19 中国人寿保险股份有限公司 Platform layer code generation method and device, electronic equipment and storage medium
CN112463261A (en) * 2020-11-20 2021-03-09 北京达佳互联信息技术有限公司 Interface calling method and device
CN112947963A (en) * 2021-02-26 2021-06-11 平安普惠企业管理有限公司 Interface operation and maintenance method and device, computer equipment and storage medium
WO2022188821A1 (en) * 2021-03-09 2022-09-15 智慧芽信息科技(苏州)有限公司 Processing method and apparatus for performing custom field indexing on file, and server and system
CN112947911A (en) * 2021-04-26 2021-06-11 平安普惠企业管理有限公司 Interface script generation method, device, equipment and storage medium
CN113282457A (en) * 2021-05-25 2021-08-20 山东浪潮通软信息科技有限公司 Method, device and medium for maintaining heterogeneous system integration interface information
CN114153909A (en) * 2021-11-26 2022-03-08 北京人大金仓信息技术股份有限公司 Database table structure translation method and device based on Velocity template engine
CN114168119A (en) * 2021-12-07 2022-03-11 北京百度网讯科技有限公司 Code file editing method and device, electronic equipment and storage medium
CN114168119B (en) * 2021-12-07 2024-04-05 北京百度网讯科技有限公司 Code file editing method, device, electronic equipment and storage medium
CN114003293A (en) * 2021-12-30 2022-02-01 云账户技术(天津)有限公司 Interface management method, device, electronic equipment and readable storage medium

Also Published As

Publication number Publication date
CN108268253B (en) 2020-01-03
WO2018201895A1 (en) 2018-11-08

Similar Documents

Publication Publication Date Title
CN108268253A (en) Interface code generation method and terminal device
CN109804396B (en) Digital asset modeling
Lone et al. Forensic-chain: Blockchain based digital forensics chain of custody with PoC in Hyperledger Composer
KR102612799B1 (en) Replicable smart contract with termination conditions
CN106874461B (en) A kind of workflow engine supports multi-data source configuration security access system and method
CN104391934B (en) Data verification method and device
CN113454619A (en) Relational data management and organization using distributed ledger techniques
CN102447559A (en) Method and system for digital signatures of composite resource documents
TW202024953A (en) Data structure reading and updating method and device and electronic equipment
CN103617155A (en) On-line commenting method and system for DWG file under WEB
US20230344813A1 (en) Method and system for securing asset data in a computing environment
CN109409882A (en) A kind of credit accreditation storage method and device based on block chain
CN110851127A (en) Universal evidence storage method based on block chain
CN112835985A (en) Spatial data sharing system and method based on distributed account book
CN116168820A (en) Medical data interoperation method based on virtual integration and blockchain fusion
Wu Enterprise integration in e-government
CN108255967A (en) Call method, device, storage medium and the terminal of storing process
CN107844710B (en) Contract generating system and generating method
CN112215710A (en) Annuity data processing method, block chain system, medium and electronic device
CN109829334A (en) Data box configuration, use and bookkeeping methods and its operation system based on block chain
Martínez et al. Model-based analysis of Java EE web security configurations
CN112150299B (en) Annuity data processing method, annuity data processing device, medium and electronic equipment
Egyhazy et al. Interoperability architecture using RM-ODP
CN111339067B (en) Data structure construction method and system of alliance chain account book platform
CN116756779B (en) Electronic form data objectification storage system and method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant