CN108255513B - Electronic device, springmvc-based data interface, automatic generation method of description of springmvc-based data interface, and storage medium - Google Patents
Electronic device, springmvc-based data interface, automatic generation method of description of springmvc-based data interface, and storage medium Download PDFInfo
- Publication number
- CN108255513B CN108255513B CN201711458087.7A CN201711458087A CN108255513B CN 108255513 B CN108255513 B CN 108255513B CN 201711458087 A CN201711458087 A CN 201711458087A CN 108255513 B CN108255513 B CN 108255513B
- Authority
- CN
- China
- Prior art keywords
- springmvc
- data interface
- interface
- preset type
- annotation
- 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.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 44
- 230000006870 function Effects 0.000 claims description 59
- 238000013507 mapping Methods 0.000 claims description 16
- 238000005516 engineering process Methods 0.000 abstract description 32
- 238000012545 processing Methods 0.000 description 9
- 230000008569 process Effects 0.000 description 5
- 238000004891 communication Methods 0.000 description 4
- 238000010586 diagram Methods 0.000 description 4
- 239000004973 liquid crystal related substance Substances 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 238000012360 testing method Methods 0.000 description 2
- 230000008094 contradictory effect Effects 0.000 description 1
- 230000003111 delayed effect Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/70—Software maintenance or management
- G06F8/73—Program documentation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/70—Software maintenance or management
- G06F8/71—Version control; Configuration management
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer Security & Cryptography (AREA)
- Library & Information Science (AREA)
- Information Transfer Between Computers (AREA)
- Computer And Data Communications (AREA)
Abstract
The invention discloses an electronic device, a data interface based on springmvc, a method for automatically generating a program by describing the data interface and a storage medium, wherein a springmvc technical framework corresponding to a predetermined service function is established, and the service function is mapped into a preset type data interface based on the springmvc technical framework; synchronously writing the document description of the preset type data interface in the springmvc technology framework; and scanning the springmvc technical framework, acquiring a controller in the springmvc technical framework and annotation type information behind the controller, and sending the annotation type information to a predetermined interface management platform. The document description programming corresponding to the data interface is realized, the working efficiency and the accuracy of uploading the data interface to the interface management platform are improved, and the readability of the data interface is improved.
Description
Technical Field
The invention relates to the field of application program development, in particular to an electronic device, a springmvc-based data interface, an automatic generation method of descriptions of the data interface and a storage medium.
Background
With the popularization of internet applications, companies generally use an open data interface (e.g., uri interface) on an interface management platform to perform data interaction, thereby sharing service functions. At present, because a data interface program and a corresponding interface description document are independent texts, corresponding interface description documents need to be added and configured manually in the process of registering a data interface to an interface management platform (for example, a document description corresponding to an interface needs to be written on the interface management platform, or a pre-programmed interface document description needs to be imported into the management platform and stored), not only is the working efficiency low and is errors prone to occur, but also the readability of the data interface is delayed due to time delay in the process of updating and storing the document.
Disclosure of Invention
In view of this, the invention provides an electronic device, a springmvc-based data interface, an automatic generation method of descriptions thereof, and a storage medium, so that a document description corresponding to the data interface is programmed, the working efficiency and accuracy of uploading the data interface to an interface management platform are improved, and the readability of the data interface is improved.
First, in order to achieve the above object, the present invention provides an electronic device, where the electronic device includes a memory and a processor connected to the memory, the processor is configured to execute a springmvc-based data interface and an instruction auto-generation program thereof stored in the memory, and when executed by the processor, the springmvc-based data interface and the instruction auto-generation program thereof implement the following steps:
a1, establishing a springmvc technical framework corresponding to a predetermined service function, and generating a mapping relation between the service function and a data interface of the preset type network protocol based on the springmvc technical framework, wherein the service function is defined as a controller of the springmvc technical framework;
a2, based on the annotation function of the springmvc technical framework, writing the corresponding description of the data interface of the preset type network protocol by using a predetermined annotation type after the controller annotates;
a3, sending the data interface of the preset type network protocol and the corresponding description to a predetermined interface management platform.
Further, the step a1 includes the following steps:
defining the predetermined service function as a controller in the springmvc technology framework;
based on the annotation function of the springmvc technical framework, marking a preset type java class as a data interface of the preset type network protocol through the predetermined annotation type after the controller;
and defining the mapping relation between the java class and the controller after the annotation of the controller so as to determine that the controller is accessed by a data interface of the preset type network protocol.
Further, in the step a2, the specification corresponding to the data interface of the preset type network protocol includes:
the preset type network protocol function, the calling method, the return type, the contained parameters and the meaning of the parameters.
Further, the data interface of the preset type network protocol is a uri interface of http.
Further, the predetermined annotation type includes an @ controller annotation, an @ requestMapping annotation, an @ apiOperation annotation, and an @ ApiParam annotation.
In addition, in order to achieve the above object, the present invention further provides a springmvc-based data interface and an automatic generation method for descriptions thereof, wherein the method comprises the following steps:
s1, establishing a springmvc technical framework corresponding to a predetermined service function, and generating a mapping relation between the service function and a data interface of a preset type network protocol based on the springmvc technical framework, wherein the service function is defined as a controller of the springmvc technical framework;
s2, based on the annotation function of the springmvc technical framework, writing the corresponding description of the data interface of the preset type network protocol by using a predetermined annotation type after the controller annotates;
and S3, sending the data interface of the preset type network protocol and the corresponding description to a predetermined interface management platform.
Further, the step S1 includes the following steps:
defining the predetermined service function as a controller in the springmvc technology framework;
based on the annotation function of the springmvc technical framework, marking a preset type java class as a data interface of the preset type network protocol through the predetermined annotation type after the controller;
and defining the mapping relation between the java class and the controller after the annotation of the controller so as to determine that the controller is accessed by a data interface of the preset type network protocol.
Further, in step S2, the specification corresponding to the data interface of the preset type network protocol includes:
the preset type network protocol function, the calling method, the return type, the contained parameters and the meaning of the parameters.
Further, the data interface of the preset type network protocol is a uri interface of http.
Further, to achieve the above object, the present invention also provides a computer-readable storage medium, which stores a springmvc-based data interface and a specification auto-generation program thereof, where the springmvc-based data interface and the specification auto-generation program thereof are executable by at least one processor, so that the at least one processor executes the steps of the springmvc-based data interface and the specification auto-generation method thereof.
Compared with the prior art, the electronic device, the springmvc-based data interface, the automatic generation method of the springmvc-based description and the storage medium provided by the invention have the advantages that by establishing a springmvc technical framework corresponding to a predetermined service function, the service function is mapped into a preset type data interface based on the springmvc technical framework; synchronously writing the document description of the preset type data interface in the springmvc technology framework; and scanning the springmvc technical framework, acquiring a controller in the springmvc technical framework and annotation type information behind the controller, and sending the annotation type information to a predetermined interface management platform. The document description programming corresponding to the data interface is realized, the working efficiency and the accuracy of uploading the data interface to the interface management platform are improved, and the readability of the data interface is improved.
Drawings
FIG. 1 is a diagram of an alternative hardware architecture of an electronic device according to the present invention;
FIG. 2 is a schematic diagram of a springmvc-based data interface and program modules illustrating an auto-generation process according to an embodiment of the present invention;
FIG. 3 is a flow chart illustrating the implementation of the preferred embodiment of the springmvc-based data interface and the automatic generation method thereof.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the description relating to "first", "second", etc. in the present invention is for descriptive purposes only and is not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In addition, technical solutions between various embodiments may be combined with each other, but must be realized by a person skilled in the art, and when the technical solutions are contradictory or cannot be realized, such a combination should not be considered to exist, and is not within the protection scope of the present invention.
Fig. 1 is a schematic diagram of an alternative hardware architecture of the electronic device according to the present invention. In this embodiment, the electronic device 10 may include, but is not limited to, a memory 11, a processor 12, and a network interface 13, which may be communicatively connected to each other through a communication bus 14. It is noted that fig. 1 only shows the electronic device 10 with components 11-14, but it is to be understood that not all of the shown components are required to be implemented, and that more or fewer components may be implemented instead.
The memory 11 includes at least one type of computer-readable storage medium, which includes a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a Read Only Memory (ROM), an Electrically Erasable Programmable Read Only Memory (EEPROM), a Programmable Read Only Memory (PROM), a magnetic memory, a magnetic disk, an optical disk, and the like. In some embodiments, the storage 11 may be an internal storage unit of the electronic device 10, such as a hard disk or a memory of the electronic device 10. In other embodiments, the memory 11 may also be an external storage device of the electronic apparatus 10, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), or the like, provided on the electronic apparatus 10. Of course, the memory 11 may also include both internal and external storage devices of the electronic apparatus 10. In the present embodiment, the memory 11 is generally used for storing an operating system and various application software installed in the electronic device 10, such as a springmvc-based data interface and an automatic generation program for descriptions thereof. Further, the memory 11 may also be used to temporarily store various types of data that have been output or are to be output.
The network interface 13 may include a wireless network interface or a wired network interface, and the network interface 13 is generally used to establish a communication connection between the electronic apparatus 10 and other electronic devices.
The communication bus 14 is used to enable communication connections between the components 11-13.
Fig. 1 only shows the electronic device 10 with components 11-14 and an automatic generation program based on a springmvc data interface and description thereof, but it is to be understood that not all shown components are required to be implemented, and that more or less components may be implemented instead.
Optionally, the electronic device 10 may further comprise a user interface (not shown in fig. 1), which may comprise a display, an input unit such as a keyboard, wherein the user interface may further comprise a standard wired interface, a wireless interface, etc.
Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED touch, and the like. Further, the display may also be referred to as a display screen or a display unit for displaying the springmvc-based data interface in the electronic device 10 and the process of the description auto-generation program executed by the processor 12.
Further, in an embodiment of the electronic device 10 of the present invention, when the springmvc-based data interface and the description thereof are executed by the processor 12, the following operations are implemented:
establishing a springmvc technology framework corresponding to a predetermined service function, and generating a mapping relation between the service function and a data interface of a preset type network protocol based on the springmvc technology framework, wherein the service function is defined as a controller of the springmvc technology framework;
in general, the springmvc technology framework includes a Controller (Controller) for processing a request distributed by a front-end Controller (dispatchservlet) in a web.xml file, and encapsulates data requested by a user into a Model (Model) in the MVC framework after being processed by a service processing layer, and then returns the encapsulated Model (Model) in the MVC framework to a corresponding interface (View) for presentation. And a very simple method for defining a Controller (Controller) is provided in SpringMVC, which does not need to inherit a specific class or implement a specific interface, but only needs to mark a class as a Controller (Controller) by using @ Controller, and then uses some annotations, for example, an annotation for processing request address mapping (@ RequestMapping) and an annotation for extracting and resolving request parameter capability (@ RequestParam), etc., to define a mapping between an address request (URL) of a standard resource on the internet and a Controller (Controller) method, so that the defined Controller (Controller) can be accessed from the outside.
In the present embodiment, a predetermined service function, such as a method of acquiring user information, a method of acquiring a financial product, a method of acquiring a market condition, an industry consultation, etc., is defined as a controller (controller) in the springmvc technical framework; marking a java class (e.g. public class api test controller) of a preset type as a data interface of a predetermined network protocol of the preset type (e.g. the predetermined network protocol of the preset type is an http protocol, and the corresponding data interface is an uri interface), and defining a mapping relationship between the preset java class and a controller (controller) by means of an @ requestMapping annotation after @ the controller, so as to determine that a service function of the controller (controller) defined as a springmvc technical framework can be accessed by the outside through the data interface of the http protocol.
Based on the annotation function of the springmvc technical framework, writing the corresponding description of the data interface of the preset type network protocol by using a predetermined annotation type after the controller annotates;
the description corresponding to the data interface of the preset type network protocol comprises the function of the preset type data interface, a calling method of the preset type data interface, the return type of the preset type data interface, parameters contained in the preset type data interface and the significance of the parameters;
in this embodiment, based on the annotation function of the springmvc technical framework, after the @ requestMapping annotation, the function, the calling method and the returning type corresponding to the preset java class (preset type data interface) in the springmvc technical framework are described in the manner of the @ apiOperation annotation; describing parameters contained in the preset java class (preset type data interface) in the springmvc technical framework and meanings of the parameters in a mode of @ ApiParam annotation after the @ apiOperation annotation; the document description of the preset type data interface is inserted into the program of the preset type data interface.
And sending the data interface of the preset type network protocol and the corresponding description to a predetermined interface management platform.
In this embodiment, the controller in the springmvc technology framework and the annotation information behind the controller are obtained by scanning the springmvc technology framework, and are sent to a predetermined interface management platform.
Generally, the interface management platform comprises a registration center and a display interface, wherein the registration center of the interface management platform registers the received preset type data interface and displays the document description of the preset type data interface through the display interface; in this embodiment, since the preset type data interface and the corresponding document description are both included in the springmvc technology framework, according to the principle of the springmvc technology framework, the registration center of the interface management platform only needs to register the controller in the springmvc technology framework, and the comment type information behind the controller in the springmvc technology framework is displayed on the display interface of the interface management platform.
It can be understood that when the document description of the preset type data interface needs to be updated by adding or deleting, the updating is directly completed with the springmvc technical framework corresponding to the preset type data interface. When the server provided with the corresponding service system is restarted, the updating of the preset type data interface is completed through the scanning of the automatic scanning program installed in the server, and the scanned document information of the relevant preset type data interface is synchronously sent to the registration center of the interface management platform. Furthermore, the interface management platform updates the document information of the corresponding preset type data interface according to the related information received by the registration center, and the interface management platform can also enable all users of the preset type data interface to know the updating and upgrading of the current interface in a mail or short message mode and the like.
As can be seen from the above example, the electronic device provided by the present invention maps the service function to a preset type data interface based on a springmvc technology framework established by the springmvc technology framework corresponding to the predetermined service function; synchronously writing the document description of the preset type data interface in the springmvc technology framework; and scanning the springmvc technical framework, acquiring a controller in the springmvc technical framework and annotation type information behind the controller, and sending the annotation type information to a predetermined interface management platform. The document description programming corresponding to the data interface is realized, the working efficiency and the accuracy of uploading the data interface to the interface management platform are improved, and the readability of the data interface is improved.
It should be further noted that, as the embodiment shown in fig. 2 below, the springmvc-based data interface and the automatic document generation program thereof may be described by virtual program modules having the same functions according to the different functions implemented by each part program.
FIG. 2 is a schematic diagram showing a program module of a springmvc-based data interface and an automatic document generation program thereof in an embodiment of an electronic device according to the present invention. In this embodiment, the springmvc-based data interface and the description automatic generation program thereof may be divided into the generation module 201, the writing module 202, and the obtaining module 203 according to the functions implemented by each part thereof. The functions or operation steps implemented by the program modules 201 and 203 are similar to those described above, and are not described in detail here, for example, where:
the generating module 201 is configured to establish a springmvc technology framework corresponding to a predetermined service function, and generate a mapping relationship between the service function and a data interface of a preset type network protocol based on the springmvc technology framework, where the service function is defined as a controller of the springmvc technology framework;
the writing module 202 is configured to write, based on an annotation function of the springmvc technology framework, a description corresponding to a data interface of the preset type network protocol after the controller annotates the controller by using a predetermined annotation type;
the obtaining module 203 is configured to send the data interface of the preset type network protocol and the corresponding description to a predetermined interface management platform.
In addition, the invention also provides a springmvc-based data interface and an automatic generation method of the springmvc-based data interface description. Referring to fig. 3, a flow chart of a preferred embodiment of the springmvc-based data interface and an automatic generation method thereof according to the present invention is shown. The method may be performed by an apparatus, which may be implemented by software and/or hardware.
In this embodiment, the method for automatically generating the data interface based on springmvc and the description thereof includes:
step S301, establishing a springmvc technical framework corresponding to a predetermined service function, and generating a mapping relation between the service function and a data interface of a preset type network protocol based on the springmvc technical framework, wherein the service function is defined as a controller of the springmvc technical framework;
in general, the springmvc technology framework includes a Controller (Controller) for processing a request distributed by a front-end Controller (dispatchservlet) in a web.xml file, and encapsulates data requested by a user into a Model (Model) in the MVC framework after being processed by a service processing layer, and then returns the encapsulated Model (Model) in the MVC framework to a corresponding interface (View) for presentation. And a very simple method for defining a Controller (Controller) is provided in SpringMVC, which does not need to inherit a specific class or implement a specific interface, but only needs to mark a class as a Controller (Controller) by using @ Controller, and then uses some annotations, for example, an annotation for processing request address mapping (@ RequestMapping) and an annotation for extracting and resolving request parameter capability (@ RequestParam), etc., to define a mapping between an address request (URL) of a standard resource on the internet and a Controller (Controller) method, so that the defined Controller (Controller) can be accessed from the outside.
In the present embodiment, a predetermined service function, such as a method of acquiring user information, a method of acquiring a financial product, a method of acquiring a market condition, an industry consultation, etc., is defined as a controller (controller) in the springmvc technical framework; marking a java class (e.g. public class api test controller) of a preset type as a data interface of a predetermined network protocol of the preset type (e.g. the predetermined network protocol of the preset type is an http protocol, and the corresponding data interface is an uri interface), and defining a mapping relationship between the preset java class and a controller (controller) by means of an @ requestMapping annotation after @ the controller, so as to determine that a service function of the controller (controller) defined as a springmvc technical framework can be accessed by the outside through the data interface of the http protocol.
Step S302, based on the annotation function of the springmvc technical framework, writing a description corresponding to the data interface of the preset type network protocol by using a predetermined annotation type after the controller annotates;
the description corresponding to the data interface of the preset type network protocol comprises the function of the preset type data interface, a calling method of the preset type data interface, the return type of the preset type data interface, parameters contained in the preset type data interface and the significance of the parameters;
in this embodiment, based on the annotation function of the springmvc technical framework, after the @ requestMapping annotation, the function, the calling method and the returning type corresponding to the preset java class (preset type data interface) in the springmvc technical framework are described in the manner of the @ apiOperation annotation; describing parameters contained in the preset java class (preset type data interface) in the springmvc technical framework and meanings of the parameters in a mode of @ ApiParam annotation after the @ apiOperation annotation; the document description of the preset type data interface is inserted into the program of the preset type data interface.
Step S303, sending the data interface of the preset type network protocol and the corresponding description to a predetermined interface management platform.
In this embodiment, the controller in the springmvc technology framework and the annotation information behind the controller are obtained by scanning the springmvc technology framework, and are sent to a predetermined interface management platform.
Generally, the interface management platform comprises a registration center and a display interface, wherein the registration center of the interface management platform registers the received preset type data interface and displays the document description of the preset type data interface through the display interface; in this embodiment, since the preset type data interface and the corresponding document description are both included in the springmvc technology framework, according to the principle of the springmvc technology framework, the registration center of the interface management platform only needs to register the controller in the springmvc technology framework, and the comment type information behind the controller in the springmvc technology framework is displayed on the display interface of the interface management platform.
It can be understood that when the document description of the preset type data interface needs to be updated by adding or deleting, the updating is directly completed with the springmvc technical framework corresponding to the preset type data interface. When the server provided with the corresponding service system is restarted, the updating of the preset type data interface is completed through the scanning of the automatic scanning program installed in the server, and the scanned document information of the relevant preset type data interface is synchronously sent to the registration center of the interface management platform. Furthermore, the interface management platform updates the document information of the corresponding preset type data interface according to the related information received by the registration center, and the interface management platform can also enable all users of the preset type data interface to know the updating and upgrading of the current interface in a mail or short message mode and the like.
According to the above example, the springmvc-based data interface and the automatic generation method for the specification thereof provided by the invention map the service function as a preset type data interface based on the springmvc technical framework by establishing the springmvc technical framework corresponding to the predetermined service function; synchronously writing the document description of the preset type data interface in the springmvc technology framework; and scanning the springmvc technical framework, acquiring a controller in the springmvc technical framework and annotation type information behind the controller, and sending the annotation type information to a predetermined interface management platform. The document description programming corresponding to the data interface is realized, the working efficiency and the accuracy of uploading the data interface to the interface management platform are improved, and the readability of the data interface is improved.
In addition, an embodiment of the present invention further provides a computer-readable storage medium, where a springmvc-based data interface and an explanation automatic generation program thereof are stored on the computer-readable storage medium, and when executed by a processor, the springmvc-based data interface and the explanation automatic generation program thereof implement the following operations:
establishing a springmvc technology framework corresponding to a predetermined service function, and generating a mapping relation between the service function and a data interface of a preset type network protocol based on the springmvc technology framework, wherein the service function is defined as a controller of the springmvc technology framework;
based on the annotation function of the springmvc technical framework, writing the corresponding description of the data interface of the preset type network protocol by using a predetermined annotation type after the controller annotates;
and sending the data interface of the preset type network protocol and the corresponding description to a predetermined interface management platform.
The embodiment of the computer-readable storage medium of the present invention is substantially the same as the electronic apparatus and the embodiments of the method for issuing an upgraded version application based on load weight scheduling, and will not be described herein again.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.
Claims (5)
1. An electronic device, comprising a memory and a processor connected to the memory, wherein the processor is configured to execute a springmvc-based data interface and a specification auto-generation program thereof stored in the memory, and when the springmvc-based data interface and the specification auto-generation program thereof are executed by the processor, the following steps are implemented:
a1, establishing a springmvc technical framework corresponding to a predetermined service function, marking a java class of a preset type as a data interface of a predetermined network protocol of the preset type based on the springmvc technical framework in an @ controller annotation mode, and defining a mapping relation between the preset java class and a controller in an @ requestMapping annotation mode after the @ controller annotation to determine that the service function of the controller defined as the springmvc technical framework can be accessed by the outside through a data interface of an http protocol;
a2, based on the annotation function of the springmvc technical framework, after @ requestMapping annotation, describing the function, calling method and return type corresponding to the java class of the preset type in the springmvc technical framework in an @ apiOperation annotation mode; describing parameters contained in the java class of the preset type in the springmvc technical framework and the meanings of the parameters in a mode of @ apipram annotation after the @ apiOperation annotation, so as to realize writing of a description corresponding to a data interface of the network protocol of the preset type in the springmvc technical framework;
a3, sending the data interface of the preset type network protocol and the corresponding description to a predetermined interface management platform;
the interface management platform comprises a registration center and a display interface, the registration center of the interface management platform registers the received preset type data interface, the registration center of the interface management platform registers the controller in the springmvc technical framework, and the document description of the preset type data interface is displayed through the display interface; the interface management platform updates the document information of the corresponding preset type data interface according to the related information received by the registration center, and enables all users of the preset type data interface to know the update and upgrade of the current interface in a mail or short message mode.
2. The electronic device of claim 1, wherein the data interface of the predetermined type of network protocol is a uri interface of http.
3. A method for automatically generating a data interface based on springmvc and an explanation thereof is characterized by comprising the following steps:
s1, establishing a springmvc technical framework corresponding to a predetermined service function, marking a java class of a preset type as a data interface of a predetermined network protocol of the preset type based on the springmvc technical framework in an @ controller annotation mode, and defining a mapping relation between the preset java class and a controller in an @ requestMapping annotation mode after the @ controller annotation to determine that the service function of the controller defined as the springmvc technical framework can be accessed by the outside through a data interface of an http protocol;
s2, describing a function, a calling method and a return type corresponding to the java class of the preset type in the springmvc technical framework in an @ apiOperation annotation mode based on the annotation function of the springmvc technical framework after the @ requestMapping annotation; describing parameters contained in the java class of the preset type in the springmvc technical framework and the meanings of the parameters in a mode of @ apipram annotation after the @ apiOperation annotation, so as to realize writing of a description corresponding to a data interface of the network protocol of the preset type in the springmvc technical framework;
s3, sending the data interface of the preset type network protocol and the corresponding description to a predetermined interface management platform;
the interface management platform comprises a registration center and a display interface, wherein the registration center of the interface management platform registers the received preset type data interface and displays the document description of the preset type data interface through the display interface; the interface management platform updates the document information of the corresponding preset type data interface according to the related information received by the registration center, and enables all users of the preset type data interface to know the update and upgrade of the current interface in a mail or short message mode.
4. The springmvc-based data interface and the automatic generation method of the specification thereof as claimed in claim 3, wherein the data interface of the preset type network protocol is an uri interface of http.
5. A computer-readable storage medium storing a springmvc-based data interface and a specification auto-generation program thereof, which are executable by at least one processor to cause the at least one processor to perform the steps of the springmvc-based data interface and the specification auto-generation method thereof according to any one of claims 3 to 4.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711458087.7A CN108255513B (en) | 2017-12-28 | 2017-12-28 | Electronic device, springmvc-based data interface, automatic generation method of description of springmvc-based data interface, and storage medium |
PCT/CN2018/076109 WO2019127864A1 (en) | 2017-12-28 | 2018-02-10 | Electronic device, springmvc-based data interface and automatic description generation method therefor, and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711458087.7A CN108255513B (en) | 2017-12-28 | 2017-12-28 | Electronic device, springmvc-based data interface, automatic generation method of description of springmvc-based data interface, and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108255513A CN108255513A (en) | 2018-07-06 |
CN108255513B true CN108255513B (en) | 2021-03-16 |
Family
ID=62724299
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201711458087.7A Active CN108255513B (en) | 2017-12-28 | 2017-12-28 | Electronic device, springmvc-based data interface, automatic generation method of description of springmvc-based data interface, and storage medium |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN108255513B (en) |
WO (1) | WO2019127864A1 (en) |
Families Citing this family (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110704200B (en) * | 2018-07-09 | 2024-11-22 | 北京京东尚科信息技术有限公司 | Method and device for converting calling interface |
CN109558460A (en) * | 2018-10-09 | 2019-04-02 | 中国平安人寿保险股份有限公司 | Interface managerial method, device, electronic equipment and storage medium based on big data |
CN109491708A (en) * | 2018-11-21 | 2019-03-19 | 北京锐安科技有限公司 | Document structure tree method, system, equipment and medium |
CN112861059A (en) * | 2021-03-17 | 2021-05-28 | 平安消费金融有限公司 | Visual component generation method and device, computer equipment and readable storage medium |
CN114201229B (en) * | 2021-11-04 | 2024-04-05 | 智新控制系统有限公司 | LIN configuration code automatic generation method, system and computer readable storage medium |
CN114637554B (en) * | 2022-03-18 | 2024-08-30 | 中国建设银行股份有限公司 | Interface calling method, device, equipment and storage medium |
CN115470152B (en) * | 2022-11-02 | 2023-04-28 | 平安银行股份有限公司 | Test code generation method, test code generation device, and storage medium |
CN116342343A (en) * | 2023-05-31 | 2023-06-27 | 创而新(北京)教育科技有限公司 | Data-driven extensible online education platform processing method |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107239271A (en) * | 2016-03-29 | 2017-10-10 | 滴滴(中国)科技有限公司 | Develop document structure tree method and device |
Family Cites Families (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101236491B (en) * | 2007-01-29 | 2010-05-19 | 联芯科技有限公司 | Method and system for constructing dynamic component |
US8819629B2 (en) * | 2010-02-17 | 2014-08-26 | Red Hat, Inc. | Automatically generating documentation on application programming interfaces |
CN103049271B (en) * | 2012-12-27 | 2016-01-27 | 微梦创科网络科技(中国)有限公司 | The method and apparatus of the description document of automatic generation api interface |
CN105843609A (en) * | 2016-03-18 | 2016-08-10 | 浪潮软件集团有限公司 | An MVC framework based on Spring and MyBatis |
EP3455730A4 (en) * | 2016-05-12 | 2020-04-29 | Synopsys, Inc. | Systems and methods for model-based analysis of software |
CN107342992B (en) * | 2017-06-27 | 2020-12-08 | 深圳媒介之家文化传播有限公司 | System authority management method and device and computer readable storage medium |
CN107515771A (en) * | 2017-09-07 | 2017-12-26 | 蓝海天网科技有限公司 | API document structure tree method and system based on SpringMVC |
-
2017
- 2017-12-28 CN CN201711458087.7A patent/CN108255513B/en active Active
-
2018
- 2018-02-10 WO PCT/CN2018/076109 patent/WO2019127864A1/en active Application Filing
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107239271A (en) * | 2016-03-29 | 2017-10-10 | 滴滴(中国)科技有限公司 | Develop document structure tree method and device |
Non-Patent Citations (1)
Title |
---|
档案管理系统接口通讯平台的搭建;王萍;《科技创新》;20150623(第12期);第141-142页 * |
Also Published As
Publication number | Publication date |
---|---|
WO2019127864A1 (en) | 2019-07-04 |
CN108255513A (en) | 2018-07-06 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108255513B (en) | Electronic device, springmvc-based data interface, automatic generation method of description of springmvc-based data interface, and storage medium | |
CN108427705B (en) | Electronic device, distributed system log query method and storage medium | |
CN108494771B (en) | Electronic device, firewall opening verification method and storage medium | |
CN109634841B (en) | Electronic device, interface automatic test method and storage medium | |
EP3007062A1 (en) | Firmware upgrade method and apparatus, and communication device | |
CN102017673B (en) | Interworking system between user terminal and smart card for executing widget, and method thereof | |
CN105718313A (en) | Application operation method and device | |
CN112818270B (en) | Data cross-domain transfer method and device and computer equipment | |
CN110059278A (en) | Web page configuration method, server and computer readable storage medium | |
CN108021377A (en) | A kind of application icon update method and device | |
WO2019071898A1 (en) | Electronic device, database query script generation method and storage medium | |
CN112631911A (en) | Automatic testing method and device, computer equipment and storage medium | |
CN113312135B (en) | List display method and device, computer equipment and storage medium | |
CN111782304A (en) | Logic control method and device for paging loading data, computer equipment and medium | |
CN108053459B (en) | Signature file synthesis method, application server and computer-readable storage medium | |
CN114637672A (en) | Automated data testing method, device, computer equipment and storage medium | |
CN114185804A (en) | Interface testing method and device and terminal equipment | |
CN106095886B (en) | Data processing method and device | |
CN109062870A (en) | The method and storage medium that server, business datum verify | |
CN112104544B (en) | Method and device for sending dynamic mail based on Freemarker | |
CN112685078A (en) | Interface document generation and query method, device and computer readable storage medium | |
CN108566293B (en) | Electronic device, zk node information notification method and storage medium | |
CN117075894A (en) | List display method and device, computing equipment and readable storage medium | |
CN111610908B (en) | Method for generating frame diagram, computer equipment and readable storage medium | |
CN114371886A (en) | Front-end frame assembly conversion method and device, computer equipment and storage medium |
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 |