Interface document generation method and device, electronic equipment and readable storage medium

文档序号:1815548 发布日期:2021-11-09 浏览:34次 中文

阅读说明:本技术 接口文档生成方法及装置、电子设备及可读存储介质 (Interface document generation method and device, electronic equipment and readable storage medium ) 是由 江日念 牟宗彦 武涛 于 2021-06-30 设计创作,主要内容包括:本发明公开了一种接口文档生成方法及装置、电子设备及可读存储介质。其中,该方法包括:在目标应用程序所处系统环境的环境配置参数与接口文档的环境配置参数匹配的情况下,对目标应用程序中各个对象进行遍历,来确定自定义对象,其中,自定义对象中存在自定义方法,自定义方法为存在自定义注解的方法;对各个自定义方法进行解析,以得到接口文档参数;根据接口文档参数生成目标应用程序对应的接口文档。本发明解决了由于相关技术中Swagger支持的接口单一,需要人工干预才能调用其他接口,而导致接口适配性低、人力资源浪费的技术问题。(The invention discloses an interface document generation method and device, electronic equipment and a readable storage medium. Wherein, the method comprises the following steps: under the condition that the environmental configuration parameters of the system environment where the target application program is located are matched with the environmental configuration parameters of the interface document, traversing each object in the target application program to determine a custom object, wherein a custom method exists in the custom object, and the custom method is a method with custom annotation; analyzing each user-defined method to obtain interface document parameters; and generating an interface document corresponding to the target application program according to the interface document parameters. The invention solves the technical problems of low interface adaptability and waste of human resources caused by the fact that other interfaces can be called only by manual intervention because the interfaces supported by the Swagger in the related technology are single.)

1. An interface document generation method, comprising:

under the condition that the environmental configuration parameters of the system environment where the target application program is located are matched with the environmental configuration parameters of the interface document, traversing each object in the target application program to determine a custom object, wherein a custom method exists in the custom object, and the custom method is a method with custom annotation;

obtaining a user-defined method corresponding to each user-defined object;

analyzing each user-defined method to obtain interface document parameters;

and generating an interface document corresponding to the target application program according to the interface document parameters.

2. The method of claim 1, wherein obtaining the custom method corresponding to each custom object comprises:

and filtering the custom method in the custom object to obtain a custom method set.

3. The method of claim 2, wherein parsing each of the custom methods comprises:

analyzing the self-defined object and the method name of the self-defined method to obtain the title and the calling address of the interface document;

analyzing the annotation or parameter of the user-defined method to obtain the method description and parameter description of the interface document;

and determining the interface document parameters according to the title, the calling address, the method description and the parameter description.

4. The method according to claim 1, further comprising, after generating the interface document corresponding to the target application according to the interface document parameters:

receiving an interface calling request, wherein the interface calling request is used for requesting a target interface document of a target interface;

under the condition that the interface calling request is successfully verified, analyzing the interface calling request to obtain an analysis result;

and carrying out reflection calling on the analysis result to obtain the target interface document.

5. The method of claim 4, wherein receiving an interface call request comprises:

displaying an interface list in a preset graphical user interface;

detecting a selection operation acting on the interface list, and determining the target interface according to the selection operation;

receiving input interface parameters;

and generating the interface calling request according to the interface parameters and the target interface.

6. The method of claim 5, wherein the interface call request comprises a request path, wherein:

after receiving the interface calling request, the method further comprises the following steps:

verifying the request path and the interface parameters;

under the condition that the request path and the interface parameter are successfully verified, determining that the interface calling request is successfully verified;

otherwise, determining that the interface calling request fails to be verified.

7. The method of claim 4, wherein in the case that the interface call request is successfully verified, parsing the interface call request comprises:

and analyzing the object, the method and the parameters corresponding to the target interface to obtain the analysis result.

8. An interface document generation apparatus, comprising:

the determining unit is used for traversing each object in the target application program to determine a custom object under the condition that the environmental configuration parameters of the system environment where the target application program is located are matched with the environmental configuration parameters of the interface document, wherein the custom object has a custom method, and the custom method is a method with custom annotation;

an acquisition unit, configured to acquire a custom method corresponding to each custom object;

the analysis unit is used for analyzing each user-defined method to obtain interface document parameters;

and the processing unit is used for generating an interface document corresponding to the target application program according to the interface document parameters.

9. An electronic device comprising a processor, a memory and a program or instructions stored on the memory and executable on the processor, the program or instructions when executed by the processor implementing the steps of the interface document generation method according to claims 1-7.

10. A readable storage medium, on which a program or instructions are stored, which when executed by a processor, implement the steps of the interface document generation method according to claims 1-7.

Technical Field

The invention relates to the technical field of databases, in particular to an interface document generation method and device, electronic equipment and a readable storage medium.

Background

In the daily development, test, operation and maintenance process of the application program, an interface document of the application program service needs to be inquired, an interface is called, an interface in the system is exposed in a local/test/ST environment through a tool, and the tool meets the following characteristics in order to be used conveniently:

1) simple and easy to use and interact: the access is simple to use, and an interactive operation interface is provided;

2) different types of interfaces are supported: the method can support http (hypertext transfer protocol) interface, RPC (Remote Procedure Call) interface and automatic generation of interface documents of other internal services;

3) interface parameter strong type verification: the abnormal operation caused by wrong interface parameter names and inconsistent types is prevented;

4) the method can be configured as follows: identifying different configurations in different environments, such as a production rod environment, does not expose interfaces. The most widely used Interface document generation tool in the Java project is Swagger, and an interactive document, an SDK (Software Development Kit) for automatically generating a code, an Interface test, and the like can be obtained by using an Application Programming Interface (API).

In an actual application scenario, Swagger can expose the http interface through simple configuration, and form an interactive interface document, and at present, each service line of a company has access. Although the application of the Swagger is wider, the Swagger can meet the requirements of simple, easy-to-use and interactive interface parameter strong type verification, and can also realize the configurability by identifying the configuration under different environments. But the disadvantage is that Swagger only supports http interface by default, can not scan to RPC interface or other service interface, and the supported interface is single. If the interfaces need to be called, a controller layer of a programming controller is needed, and the interfaces are called in method logic of the controller, so that the workload is large. If interface testing is needed after the interface document is generated in the ST environment, the process is long, and waste of manpower and material resources is caused.

In view of the above problems, no effective solution has been proposed.

Disclosure of Invention

The embodiment of the invention provides an interface document generation method and device, electronic equipment and a readable storage medium, which are used for at least solving the technical problems of low interface adaptability and waste of human resources caused by the fact that the Swagger-supported interface in the related technology is single and other interfaces can be called only by manual intervention.

According to an aspect of an embodiment of the present invention, there is provided an interface document generation method, including: under the condition that the environmental configuration parameters of the system environment where the target application program is located are matched with the environmental configuration parameters of the interface document, traversing each object in the target application program to determine a custom object, wherein a custom method exists in the custom object, and the custom method is a method with custom annotation; obtaining a user-defined method corresponding to each user-defined object; analyzing each user-defined method to obtain interface document parameters; generating an interface document corresponding to the target application program according to the interface document parameters

According to another aspect of the embodiments of the present invention, there is also provided an interface document generating apparatus, including: the device comprises a determining unit, a processing unit and a processing unit, wherein the determining unit is used for traversing each object in a target application program to determine a custom object under the condition that the environment configuration parameters of the target application program meet preset conditions, and the custom object has the custom method; the system comprises an acquisition unit, a processing unit and a display unit, wherein the acquisition unit is used for acquiring custom methods corresponding to custom objects respectively, and the custom methods are methods with custom annotations; the analysis unit is used for analyzing each user-defined method to obtain interface document parameters; and the processing unit is used for generating an interface document corresponding to the target application program according to the interface document parameters.

According to another aspect of the embodiments of the present invention, there is also provided an electronic device, which is characterized by including a processor, a memory, and a program or an instruction stored on the memory and executable on the processor, wherein the program or the instruction realizes the steps of the interface document generation method as described above when executed by the processor.

According to another aspect of the embodiments of the present invention, there is also provided a readable storage medium, which is characterized in that the readable storage medium stores thereon a program or instructions, and the program or instructions, when executed by a processor, implement the steps of the interface document generation method as described above.

In the embodiment of the invention, under the condition that the environmental configuration parameters of the system environment where a target application program is located are matched with the environmental configuration parameters of an interface document, traversing each object in the target application program to determine a self-defined object, wherein a self-defined method exists in the self-defined object, the self-defined method is a method with self-defined annotation, the self-defined method corresponding to each object in the target application program is obtained, and each self-defined method is analyzed to obtain the interface document parameters; the interface document corresponding to the target application program is generated according to the interface document parameters, so that the corresponding interface document is generated according to different interfaces without application programs, manual intervention is reduced, the adaptability of the generated interface document is improved, and the technical problems of low interface adaptability and manpower resource waste caused by the fact that other interfaces can be called only by manual intervention due to single interface supported by Swagger in the related technology are solved.

Drawings

The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:

FIG. 1 is a flow diagram illustrating an alternative interface document generation method according to an embodiment of the present invention;

FIG. 2 is a schematic diagram of an alternative interface document graphical user interface according to an embodiment of the present invention;

FIG. 3 is a flow chart diagram illustrating an alternative interface document generation method according to an embodiment of the present invention;

FIG. 4 is a flowchart illustrating an alternative interface document invocation method according to embodiments of the present invention;

FIG. 5 is a block diagram of an alternative interface document creation apparatus according to an embodiment of the present invention;

Detailed Description

In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. 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 terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.

Example 1

Before describing embodiments of the present invention, the following terms are first explained:

interface documentation: in project development, front-end and back-end separate development of a web project and application program APP development need to define an interface and write an interface document together by front-end and back-end engineers. And then development is carried out according to the interface document, and maintenance is carried out until the project is finished.

In the related art, Swagger only supports an http interface by default, and cannot scan an RPC interface or other service interfaces, so that the supported interfaces are single. Other interfaces can be called only by manual intervention, which causes waste of manpower and material resources.

In order to solve the above problems, the present embodiment provides an interface document generation method, which obtains a custom method corresponding to each object in a target application program when an environment configuration parameter of the target application program meets a preset condition, where the custom method is a method with a custom annotation; analyzing each user-defined method to obtain interface document parameters; the interface document corresponding to the target application program is generated according to the interface document parameters, so that the corresponding interface document is generated according to different interfaces without application programs, manual intervention is reduced, and the adaptability of the generated interface document is improved.

Fig. 1 is a schematic flow diagram of an interface document generating method according to an embodiment of the present invention, and as shown in fig. 1, the method may specifically include the following steps:

s102, under the condition that the environmental configuration parameters of the system environment where the target application program is located are matched with the environmental configuration parameters of the interface document, traversing each object in the target application program to determine a custom object, wherein a custom method exists in the custom object, and the custom method is a method with custom annotation;

s104, obtaining a custom method corresponding to each custom object;

in a specific application scenario, the system environment includes a production environment, a test environment, a pre-release environment, a formal environment, and the like, and interface documents of application programs in different system environments are different. When generating an interface document for a target application, a system environment in which the target application is currently located is first determined. And if the interface document is generated aiming at the target application program under the current system environment, the interface document is not generated again based on the target application program. And if the interface document is not generated aiming at the target application program in the current system environment, generating the interface document based on the target application program in the current system environment.

Specifically, under the condition that the environment configuration parameters of the system environment where the target application program is located are matched with the environment configuration parameters of the interface document, the object in the target application program is traversed to obtain the custom method existing in the custom object.

Specifically, in the case that the environment configuration parameters of the system environment in which the target application program is located match the environment configuration parameters of the interface document, that is, if it is determined that the interface document is not generated for the target application program in the current system environment, the interface document is generated based on the target application program in the current system environment. The environment configuration parameters in the target application program are obtained, and the environment configuration parameters are used for identifying the system environment where the target application program is located currently. Judging whether the environment configuration parameters of the system environment where the target application program is located are matched with the environment configuration parameters of the interface document, and if so, determining that the environment configuration parameters of the target application program meet preset conditions; and if not, determining that the environment configuration parameters of the target application program do not accord with the preset conditions.

In an actual application scenario, for an interface not supported by Swagger, a method supported by Swagger and a method not supported by Swagger exist in a corresponding application program, the method supported by Swagger is a general method, and the general method is directly applied to an interface document in Swagger. In this embodiment, the method not supported by Swagger includes a custom annotation, and the method including the custom annotation is defined as a custom method, and the custom method is applied to the interface document after being analyzed.

Therefore, after the target application program is started, under the condition that the environmental configuration parameters of the system environment where the target application program is located are matched with the environmental configuration parameters of the interface document, the object in the target application program is traversed, and the custom method with the custom annotation is obtained, so that a custom method set is obtained.

S106, analyzing each user-defined method to obtain interface document parameters;

specifically, the custom method is parsed, including parsing the object, the method name, the custom annotation, the parameter, and the like, to obtain the interface document parameter required by Swagger documentation.

And S108, generating an interface document corresponding to the target application program according to the interface document parameters.

Specifically, after the interface document parameters are acquired, the interface document is formed according to the Swagger template.

It should be noted that, with this embodiment, under the condition that the environment configuration parameters of the system environment where the target application program is located are matched with the environment configuration parameters of the interface document, the user-defined methods corresponding to the objects in the target application program are obtained, and each user-defined method is analyzed to obtain the interface document parameters; the interface document corresponding to the target application program is generated according to the interface document parameters, so that the corresponding interface document is generated according to different interfaces without application programs, manual intervention is reduced, the adaptability of the generated interface document is improved, and the technical problems of low interface adaptability and manpower resource waste caused by the fact that other interfaces can be called only by manual intervention due to single interface supported by Swagger in the related technology are solved.

As an optional implementation manner, in this embodiment, the obtaining of the custom method corresponding to each custom object includes, but is not limited to: and filtering the custom method in the custom object to obtain a custom method set.

Specifically, the user-defined annotation and the environment configuration parameters of the target application program are obtained, under the condition that the environment configuration parameters of the system environment where the target application program is located are matched with the environment configuration parameters of the interface document, the object in the target application program is traversed, the user-defined method including the user-defined annotation is obtained, filtering is carried out, and a user-defined method set is formed.

As an optional implementation manner, in this embodiment, parsing each customization method includes, but is not limited to: analyzing the self-defined object and the method name of the self-defined method to obtain the title and the calling address of the interface document; analyzing the annotation or parameter of the user-defined method to obtain the method description and parameter description of the interface document; and determining interface document parameters according to the title, the calling address, the method description and the parameter description.

Specifically, the custom method in the custom method set is parsed, including custom object bean parsing, method name parsing, annotation parsing, and parameter parsing. The title and calling address URL (Uniform Resource Locator) of the interface document are obtained through self-defined bean analysis and method name analysis, and the description content of the interface document is enriched by obtaining specific method description and parameter description through annotation analysis, so that the interface document is easier to understand.

In a preferred embodiment, in the case of default of annotation parsing of the custom method, the parameter name and the parameter type of the custom method are parsed to obtain a description file of the parameter name and the parameter type.

As an optional implementation manner, in this embodiment, after generating the interface document corresponding to the target application according to the interface document parameters, the method further includes, but is not limited to: receiving an interface calling request, wherein the interface calling request is used for requesting a target interface document of a target interface; under the condition that the interface calling request is successfully verified, analyzing the interface calling request to obtain an analysis result; and carrying out reflection calling on the analysis result to obtain a target interface document.

Specifically, after receiving an interface calling request for requesting a target interface document of a target interface, verifying the interface calling request, verifying a request path and a request parameter in the interface calling request, and ending the flow under the condition of failed verification; and under the condition of successful verification, analyzing the interface calling request, including object analysis, method analysis and parameter analysis, after the analysis is completed, calling by transmitting, and returning to the target interface document after the calling.

As an optional implementation manner, in this embodiment, the interface call request is received, which includes but is not limited to: displaying an interface list in a preset graphical user interface; detecting a selection operation acting on the interface list, and determining a target interface according to the selection operation; receiving input interface parameters; and generating an interface calling request according to the interface parameters and the target interface.

Specifically, in this embodiment, as shown in fig. 2, an interface list is displayed in the preset image user interface 20, where the interface list includes an interface 201, an interface 202, and an interface 203, a selection operation applied to the interface list is detected, a target interface is determined to be the interface 202 according to the selection operation, an input interface parameter is received, and then an interface call request is generated according to the interface parameter and the interface 202.

In one example, after the Swagger interface selects the custom interface document, the corresponding interface is selected, the required parameters are input, and the interface call request is initiated.

Through the embodiment, the interface list is displayed in the graphical user interface, and the interface calling request is generated according to the target interface selected by the selection operation and the input interface parameters, so that the interface document of the interface is quickly called.

As an optional implementation manner, in this embodiment, the interface call request includes a request path, where: after receiving the interface call request, the following are included but not limited to: verifying the request path and the interface parameters; under the condition that the request path and the interface parameter are successfully verified, determining that the interface calling request is successfully verified; otherwise, determining that the interface call request fails to verify.

Further optionally, in this embodiment, in the case that the interface call request is successfully verified, parsing the interface call request includes, but is not limited to: and analyzing the object, the method and the parameters corresponding to the target interface to obtain an analysis result.

Specifically, in the above example, after receiving the interface call request for the user-defined interface document initiated by Swagger, in this embodiment, Swagger receives the generic interface request, where the request path is service/$ { beans }/$ { methodName }, and the request parameter is carried in the interface call request, and the extended Swagger verifies the request path and the request parameter. And under the condition that the interface calling request is successfully verified, analyzing the interface calling request. The method comprises bean analysis, method analysis and parameter analysis, and calling through reflection after analysis; and returning a result after calling, and packaging the result in a format required by Swagger.

In the embodiment of the invention, under the condition that the environment configuration parameters of the system environment where the target application program is located are matched with the environment configuration parameters of the interface document, the user-defined methods corresponding to all objects in the target application program are obtained respectively, and the user-defined methods are analyzed to obtain the interface document parameters; the interface document corresponding to the target application program is generated according to the interface document parameters, so that the corresponding interface document is generated according to different interfaces without application programs, manual intervention is reduced, the adaptability of the generated interface document is improved, and the technical problems of low interface adaptability and manpower resource waste caused by the fact that other interfaces can be called only by manual intervention due to single interface supported by Swagger in the related technology are solved.

Example 2

According to another aspect of the present invention, an interface document generation method is provided, as shown in fig. 3, specifically, the method may include the following steps:

step 301: a system configuration custom annotation @ EnablSwageExt to be accessed;

step 302: after a project corresponding to a target application program is started, identifying the annotation @ EnablSwaggerExt and configuration parameters of the environment, determining whether to scan all beans according to the configuration parameters, if the parameters need to be scanned, entering step 303, otherwise, ending the process;

step 303: traversing a bean, and filtering the method of the bean with the user-defined annotation @ ApiMethod to form an interface method set;

step 304: and analyzing the methods in the method set, wherein the analyzing comprises bean analyzing, method name analyzing, annotation analyzing and parameter analyzing. The bean analysis and the method name analysis are mainly used for obtaining the title of the interface document and the universal interface call url. The annotation parsing is to obtain more specific method descriptions and parameter descriptions, making the interface document more friendly and easy to understand. In the case that the annotation parsing part is configured by default, the parameter name and the parameter type are further parsed. After the parameters required by the Swagger documentation are obtained, the step 5 is carried out;

step 305: the interface document is formed according to the Swagger template.

According to another aspect of the present invention, a method for calling an interface document is provided, as shown in fig. 4, the method may specifically include the following steps:

step 401: after selecting a user-defined interface grouping document on a Swagger interface, a user selects a corresponding interface, inputs required parameters and initiates an interface calling request;

step 402: the extended Swagger receives an interface call request, a request path is service/$ { bearer name }/$ { methodName }, and carries a request parameter in the request, the extended Swagger verifies the request path and the request parameter, the verification fails, the interface call fails, the flow is ended, and the verification successfully goes to the step 3;

step 403: further analyzing the request, including bean analysis, method analysis and parameter analysis, and calling through reflection after analysis;

step 404: and returning a result after calling, and packaging the result in a format required by Swagger.

By the interface document generation method and the interface document calling method provided by the embodiment, under the condition that the environment configuration parameters of the system environment where the target application program is located are matched with the environment configuration parameters of the interface document, the user-defined methods corresponding to the objects in the target application program are obtained respectively, and the user-defined methods are analyzed to obtain the interface document parameters; the interface document corresponding to the target application program is generated according to the interface document parameters, so that the corresponding interface document is generated according to different interfaces without application programs, manual intervention is reduced, the adaptability of the generated interface document is improved, and the technical problems of low interface adaptability and manpower resource waste caused by the fact that other interfaces can be called only by manual intervention due to single interface supported by Swagger in the related technology are solved.

It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the order of acts, as some steps may occur in other orders or concurrently in accordance with the invention. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required by the invention.

Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. 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 (e.g., ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.

Example 3

According to an embodiment of the present invention, there is also provided an interface document generating apparatus for implementing the interface document generating method, as shown in fig. 5, the apparatus includes:

1) the determining unit 50 is configured to, under the condition that the environment configuration parameters of the system environment where the target application program is located are matched with the environment configuration parameters of the interface document, traverse each object in the target application program to determine a custom object, where a custom method exists in the custom object, and the custom method is a method in which a custom annotation exists;

2) an obtaining unit 52, configured to obtain custom methods corresponding to the respective custom objects;

3) the analysis unit 54 is configured to analyze each of the user-defined methods to obtain interface document parameters;

4) and the processing unit 56 is configured to generate an interface document corresponding to the target application program according to the interface document parameter.

Optionally, the specific example in this embodiment may refer to the example described in embodiment 1 or 2 above, and this embodiment is not described again here.

Example 4

According to an embodiment of the present invention, there is also provided an electronic device for implementing the interface document generating method, including a processor, a memory, and a program or an instruction stored in the memory and executable on the processor, where the program or the instruction implements the steps of the interface document generating method described above when executed by the processor.

Optionally, in this embodiment, the memory is configured to store program code for performing the following steps:

s1, under the condition that the environmental configuration parameters of the system environment where the target application program is located are matched with the environmental configuration parameters of the interface document, traversing each object in the target application program to determine a custom object, wherein the custom object has a custom method, and the custom method is a method with custom annotation;

s2, obtaining the self-defining method corresponding to each self-defining object;

s3, analyzing each user-defined method to obtain interface document parameters;

and S4, generating an interface document corresponding to the target application program according to the interface document parameters.

Optionally, the specific examples in this embodiment may refer to the examples described in embodiment 1 and embodiment 2, and this embodiment is not described herein again.

Example 5

Embodiments of the present invention also provide a readable storage medium on which a program or instructions are stored, which when executed by a processor implement the steps of the interface document generation method as described above.

Optionally, in this embodiment, the readable storage medium is configured to store program code for performing the following steps:

s1, under the condition that the environmental configuration parameters of the system environment where the target application program is located are matched with the environmental configuration parameters of the interface document, traversing each object in the target application program to determine a custom object, wherein the custom object has a custom method, and the custom method is a method with custom annotation;

s2, obtaining the self-defining method corresponding to each self-defining object;

s3, analyzing each user-defined method to obtain interface document parameters;

and S4, generating an interface document corresponding to the target application program according to the interface document parameters.

Optionally, the storage medium is further configured to store program codes for executing the steps included in the method in embodiment 1, which is not described in detail in this embodiment.

Optionally, in this embodiment, the storage medium may include, but is not limited to: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.

Optionally, the specific examples in this embodiment may refer to the examples described in embodiment 1 and embodiment 2, and this embodiment is not 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.

The integrated unit in the above embodiments, if implemented in the form of a software functional unit and sold or used as a separate product, may be stored in the above computer-readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing one or more computer devices (which may be personal computers, servers, network devices, etc.) to execute all or part of the steps of the method according to the embodiments of the present invention.

In the above embodiments of the present invention, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.

In the several embodiments provided in the present application, it should be understood that the disclosed client may be implemented in other manners. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one type of division of logical functions, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.

The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.

In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.

The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.

14页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:相似代码检测方法、装置、设备和计算机存储介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!