Interface calling method and device, electronic equipment and storage medium
By obtaining and converting Swagger API documents and generating TypeScript code files, it solves the complex code maintenance problem caused by front-end developers' frequent call to back-end API interfaces, implements interface calls and simplifies the maintenance process.
Patent Information
- Application Number
- CN202411193824.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-28
- Publication Date
- 2024-12-06
AI Technical Summary
In the web application project separated by the front and back end, front-end developers need to frequently call the back-end API interface, resulting in complex code maintenance and complex operation, requiring manual code writing, which is a lot of work and difficult to maintain in the later stage.
By obtaining the Swagger API document, converting it into a TypeScript code file, and inserting the request function code into the file, generating the file after the code is inserted, and introducing the file in the project to call the interface at compile time to realize interface calls.
The code maintenance process is simplified, and only needs to modify the verification reference data, reducing the complexity and workload of later maintenance.
Smart Images

Figure CN119088480A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of information technology, and in particular to an interface calling method, device, electronic equipment and storage medium. Background Art
[0002] At present, in Web (World Wide Web) application projects with separated front-end and back-end, the front-end needs to frequently call the back-end API (Application Programming Interface) interface to obtain or submit data. However, in the current front-end and back-end separation development model, the front-end and back-end are developed and maintained by different teams. When front-end developers are developing software, they need to call the interface frequently, which requires manual coding in the code. Not only is the workload large, but the subsequent maintenance requires rewriting the code, which is complicated. Summary of the invention
[0003] The purpose of the embodiments of the present invention is to provide an interface calling method, device, electronic device and storage medium to solve the problem of complex code maintenance. The specific technical solution is as follows:
[0004] In a first aspect of the present invention, an interface calling method is first provided, the method comprising:
[0005] Obtain verification reference data;
[0006] Converting the verification reference data into a code file in a target format;
[0007] Inserting the request function code into the code file of the target format to obtain a file after the code is inserted;
[0008] The file after the code insertion is introduced into the project, so that when the file after the code insertion is compiled, the corresponding interface is called according to the verification reference data.
[0009] In a possible implementation manner, obtaining verification reference data includes:
[0010] Obtain the Swagger API document of the target interface, wherein the Swagger API document includes the request method, path, parameter type, and return value of the corresponding interface;
[0011] The step of converting the verification reference data into a code file in a target format includes:
[0012] Convert the Swagger API document into a TypeScript code file;
[0013] The step of inserting the request function code into the code file of the target format to obtain a file after the code is inserted comprises:
[0014] Insert the request function code into the TypeScript code file to obtain the file after the code is inserted.
[0015] In a possible implementation, converting the Swagger API document into a TypeScript code file includes:
[0016] Use swagger-typescript-api to convert the Swagger API document into a TypeScript code file.
[0017] In a possible implementation manner, the introducing the file after the code is inserted into the project so as to call the corresponding interface according to the verification reference data when the file after the code is inserted is compiled, includes:
[0018] Synchronize the files after the code is inserted into the project;
[0019] The file after the code insertion is referenced in the project to call the corresponding interface according to the request method, path, parameter type and return value of the corresponding interface.
[0020] In a second aspect of the present invention, an interface calling device is also provided, the device comprising:
[0021] A data acquisition module, used to acquire verification reference data;
[0022] A data conversion module, used to convert the verification reference data into a code file in a target format;
[0023] A code insertion module, used for inserting the request function code into the code file of the target format to obtain the file after the code is inserted;
[0024] The interface calling module is used to introduce the file after the code is inserted into the project, so as to call the corresponding interface according to the verification reference data when compiling the file after the code is inserted.
[0025] In a possible implementation, the data acquisition module is specifically used to obtain a Swagger API document of a target interface, wherein the Swagger API document includes a request method, path, parameter type, and return value of the corresponding interface;
[0026] The data conversion module is specifically used to convert the Swagger API document into a TypeScript code file;
[0027] The code insertion module is specifically used to insert the request function code into the TypeScript code file to obtain the file after the code is inserted.
[0028] In a possible implementation, the code insertion module is specifically configured to convert the Swagger API document into a TypeScript code file through swagger-typescript-api.
[0029] In a possible implementation, the interface calling module is specifically used to synchronize the file after the code is inserted into the project; and reference the file after the code is inserted in the project to call the corresponding interface according to the request method, path, parameter type and return value of the corresponding interface.
[0030] In another aspect of the present invention, there is provided an electronic device, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;
[0031] Memory, used to store computer programs;
[0032] The processor is used to implement any of the above-mentioned interface calling methods when executing the program stored in the memory.
[0033] In another aspect of the present invention, a computer-readable storage medium is provided, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, any of the above-mentioned interface calling methods is implemented.
[0034] In another aspect of the present invention, a computer program product including instructions is provided, which, when executed on a computer, enables the computer to execute any of the above-mentioned interface calling methods.
[0035] An interface calling method, device, electronic device and storage medium provided by an embodiment of the present invention obtain verification reference data; convert the verification reference data into a code file in a target format; insert a request function code into the code file in the target format to obtain a file after the code is inserted; introduce the file after the code is inserted into a project so that when the file after the code is inserted is compiled, a corresponding interface call is made according to the verification reference data. Verification reference data can be obtained and converted into a code file in a target format, thereby inserting the code file in the target format, thereby introducing the file after the code is inserted into the project so that when the file after the code is inserted is compiled, a corresponding interface call is made according to the verification reference data, so that when maintenance is required in the later stage, only the verification reference data needs to be modified, and maintenance is simple. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art are briefly introduced below.
[0037] Figure 1 A schematic diagram of a flow chart of an interface calling method in an embodiment of the present invention;
[0038] Figure 2 Another flowchart of the interface calling method in the embodiment of the present invention is shown;
[0039] Figure 3a A schematic diagram of a principle of an interface calling method in an embodiment of the present invention;
[0040] Figure 3b An interactive schematic diagram of an interface calling method in an embodiment of the present invention;
[0041] Figure 4 A schematic diagram of an example of an interface calling method in an embodiment of the present invention;
[0042] Figure 5 A schematic diagram of an interface of an interface calling method in an embodiment of the present invention;
[0043] Figure 6 A schematic diagram of the structure of an interface calling device in an embodiment of the present invention;
[0044] Figure 7 It is a schematic diagram of the structure of an electronic device in an embodiment of the present invention. DETAILED DESCRIPTION
[0045] The technical solutions in the embodiments of the present invention will be described below in conjunction with the accompanying drawings in the embodiments of the present invention.
[0046] In order to solve the problem of complex later maintenance caused by the need to frequently call interfaces and manually write codes during software development by front-end developers, the embodiments of the present application provide an interface calling method, device, electronic device and storage medium.
[0047] In the first aspect of the present invention, an interface calling method is first provided. Figure 1 , Figure 1 A flowchart of an interface calling method provided in an embodiment of the present application, the method comprising:
[0048] Step S11, obtaining verification reference data;
[0049] Step S12, converting the verification reference data into a code file in a target format;
[0050] Step S13, inserting the request function code into the code file of the target format to obtain a file after the code is inserted;
[0051] Step S14, introducing the file after the code is inserted into the project, so that when the file after the code is inserted is compiled, the corresponding interface is called according to the verification reference data.
[0052] Corresponding to the above step S11, obtaining the verification reference data can obtain the data used for verification in the calling structure process. For example, the interface document of the API interface may include information such as the request method, path, parameter type, and return value type of all API interfaces. First of all, it should be noted that the method of the embodiment of the present application can be applied to code documents formed by separate development, and specifically, can be applied to the compilation process.
[0053] Corresponding to the above step S12, the verification reference data is converted into a code file in a target format, which can be converted through a related interface development tool. In one example, when obtaining an interface document, a Swagger (an API (Application Programming Interface) development tool) API document can be obtained, usually in JSON (JavaScript Object Notation, a lightweight data exchange format) format. Specifically, the interface document is converted into a code file in a target format, and a tool such as swagger-typescript-api (a code conversion tool) can be used to convert the Swagger document into a TypeScript (an open source programming language) code file.
[0054] Corresponding to the above step S13, the request function code is inserted into the code file of the target format to obtain the file after the code is inserted. The request function code with the type can be inserted into the code file of the target format converted by converting the verification reference data, that is, the generated TypeScript file to obtain the file after the code is inserted.
[0055] Corresponding to the above step S14, the file after the code is inserted is introduced into the project, so that when the file after the code is inserted is compiled, the corresponding interface is called according to the verification reference data, and then the generated TypeScript file is referenced in the project, so that when the file after the code is inserted is compiled, the corresponding interface is called and verified according to the verification reference data in the TypeScript file. Through the scheme of the embodiment of the present application, during the compilation process of the code, by introducing the file after the code is inserted into the project, by decoding the file after the code is inserted, the verification reference data can be identified, so that during the calling process of the interface, the verification and interface calling can be performed through the verification reference data.
[0056] It can be seen that through the method of the embodiment of the present application, verification reference data can be obtained, and the verification reference data can be converted into a code file in a target format, thereby inserting it into the code file in the target format, and introducing the file after the code is inserted into the project, so that when the file after the code is inserted is compiled, the corresponding interface is called according to the verification reference data, so that when maintenance is required later, only the verification reference data needs to be modified, and maintenance is simple.
[0057] In one possible implementation, see Figure 2 Step S11 obtains verification reference data, including:
[0058] Step S111, obtaining the Swagger API document of the target interface, wherein the Swagger API document includes the request method, path, parameter type and return value of the corresponding interface;
[0059] Step S12 converts the verification reference data into a code file in a target format, including:
[0060] Step S121, converting the Swagger API document into a TypeScript code file;
[0061] Step S13 inserts the request function code into the code file of the target format to obtain a file after the code is inserted, including:
[0062] Step S131, inserting the request function code into the TypeScript code file to obtain the file after the code is inserted.
[0063] In a possible implementation, the converting of the Swagger API document into a TypeScript code file includes: converting the Swagger API document into a TypeScript code file through swagger-typescript-api. Specifically, the Swagger document is converted into a TypeScript code file using tools such as swagger-typescript-api, which can automatically generate a TypeScript file including all API interface request and return value type information. To obtain the Swagger API document of the target interface, the Swagger API document (usually in JSON format) provided by Atlas (an internal interface platform) provided by the backend can be used. The Swagger document describes all API interfaces in detail, including request methods, paths, parameter types, and return value types.
[0064] In a possible implementation, the file after the code is inserted is introduced into the project so that the corresponding interface can be called according to the verification reference data when the file after the code is inserted is compiled, including: synchronizing the file after the code is inserted into the project; referencing the file after the code is inserted in the project to call the corresponding interface according to the request method, path, parameter type and return value of the corresponding interface. Specifically, synchronizing the file after the code is inserted into the project can reference the generated TypeScript function in the front-end project, and replace the traditional ajax request method with the typed request function, and reference the generated TypeScript file in the front-end project, and replace the traditional ajax request method with the typed request function, so as to call the corresponding interface according to the request method, path, parameter type and return value of the corresponding interface.
[0065] In order to illustrate the method of the embodiment of the present application, a specific embodiment is described below. Figure 3a and Figure 3b ,in, Figure 3aA schematic diagram of the principle of the interface calling method in an embodiment of the present invention includes: an API generation process, a code generation process, a file synchronization process and a front-end reference process; wherein the API generation process includes: Atlas publishes the Swagger API document to the swagger-typescript-api tool; the code generation process includes: generating a TypeScript file and then inserting a custom request function; the file synchronization process includes: Moose-local-agent synchronization file (Moose represents the implementation tool corresponding to the solution of the present application); the front-end reference process includes: the front-end references the generated TypeScript file, and the typed request function replaces the traditional ajax request.
[0066] Figure 3b This is an interactive schematic diagram of the interface calling method in an embodiment of the present invention, including: the interaction between the developer, the Atlas platform, the swagger-typescript-api tool, the Moose-local-agent and the front-end project, specifically including:
[0067] Get the Swagger API document; return the Swagger JSON document; specifically, you can use the Swagger API document (usually in JSON format) provided by Atlas (the company's internal interface platform) provided by the backend. The Swagger document describes all API interfaces in detail, including request methods, paths, parameter types, and return value types;
[0068] Use the tool to generate TypeScript code; return the generated TypeScript file; specifically, you can use tools such as swagger-typescript-api to convert the Swagger document into a TypeScript code file. The tool will automatically generate a TypeScript file that includes all API interface request and return value type information;
[0069] Use Moose-local-agent to synchronize files; you can insert the request function code with types into the generated TS file;
[0070] Synchronize the file to the local project; specifically, the generated TypeScript file can be written into the local project through Moose-local-agent (the implementation tool corresponding to the solution of this application), the generated TypeScript function can be referenced in the front-end project, and the traditional ajax (a method from a Web-based application to a data-based application) request method can be replaced with the typed request function;
[0071] Reference the generated file in the front-end project and use the typed request function; specifically, you can introduce the generated TypeScript function, reference the generated TypeScript file in the front-end project, and use the typed request function to replace the traditional ajax request method.
[0072] For another example, see Figure 4 , Figure 4 This is an example schematic diagram of the interface calling method in an embodiment of the present invention, wherein, in the back-end system, a Swagger API document can be generated through the Atlas interface platform and sent to the Swagger API document-JSON; then the API document is obtained and sent to the developer environment. Specifically, a typescript code file can be generated through the swagger-typescript-api tool, and then the API request function code is typed, and the custom request logic and the custom request function are inserted; then the file is synchronized to the file synchronization system, and the local project is written to the local front-end project through Moose-local-agent; finally, the generated TS file is referenced to the front-end system, and a typed request is initiated to the API request and processing through the front-end code, and then the result is returned to the front-end application.
[0073] In the solution development process corresponding to the embodiment of the present application, multiple modules can be used for processing, including: API document acquisition module: obtain the Swagger API document generated by Atlas; code generation module: use the swagger-typescript-api tool to generate TypeScript files; custom request function module: insert typed request logic into the generated TypeScript file; file synchronization module: use Moose-local-agent to write the generated file to the local project; front-end application module: reference and use the generated TypeScript file for typed requests. Specifically, the development environment may include: development tools: swagger-typescript-api, TypeScript, Node.js, npm / yarn; development environment: standard front-end development environment, including code editor (such as Visual Studio Code), npm / yarn package manager, TypeScript compiler.
[0074] For another example, see Figure 5, which can be operated through the user interface corresponding to this application, which may include: local operations, such as type request and ** management; online operations, such as code analysis, code statistics and code quality; among them, the interface corresponding to the typed request generation can select the project, and can display the relevant information of the target project and historical records, such as InterfaceID, name, api prefix and branch (default master). Select the type request module in the implementation tool corresponding to the solution of this application, and select the project for which the request file needs to be generated. For example, here we take exact as an example and fill in the interfaceID provided by atlas (the id for locating the unique interface) below. If an api prefix is required, fill it in. If you need to switch branches, fill it in. After clicking generate, the interface name will be filled in and a ts request file will be generated in the corresponding project directory:
[0075] fvCode
[0076] TS add.ts
[0077] TS batchAddByDefaultChannel.ts
[0078] TS cheeckName.ts
[0079] TS index.ts
[0080] msgTemplate
[0081] TS listQuery.ts
[0082] TS pageQuery.ts
[0083] Just use it directly in the business system:
[0084] const getTemplateList=async(appTd:string)=>{
[0085] const res=await MsgTemplateListQueryService.fetch({
[0086] subscripation:appId,
[0087] channel:1,
[0088] });
[0089] if(!res.—reject){
[0090] msgTemplateList.value=res.dataList;
[0091] }
[0092] };
[0093] If (alipayData.app-id) {
[0094] await getTemplateList(alipayData.app-id);
[0095] }
[0096] At this time, the passed and returned values are all typed, and error prompts can be given in real time without waiting until runtime to know.
[0097] It can be seen that the solution of the embodiment of the present application can obtain the Swagger API document of the target interface, convert the Swagger API document into a TypeScript code file, and then insert the request function code into the TypeScript code file to obtain the file after the code is inserted, thereby introducing the TypeScript code file after the code is inserted into the project, so that when the TypeScript code file is compiled, the corresponding interface is called according to the Swagger API document, so that when maintenance is required in the later stage, only the verification reference data needs to be modified, and maintenance is simple.
[0098] In the second aspect of the present invention, an interface calling device is also provided. Figure 6 , the device comprises:
[0099] The data acquisition module 601 is used to acquire verification reference data;
[0100] A data conversion module 602, used to convert the verification reference data into a code file in a target format;
[0101] A code inserting module 603 is used to insert the request function code into the code file of the target format to obtain a file after the code is inserted;
[0102] The interface calling module 604 is used to introduce the file after the code is inserted into the project, so as to call the corresponding interface according to the verification reference data when compiling the file after the code is inserted.
[0103] In a possible implementation, the data acquisition module is specifically used to obtain a Swagger API document of a target interface, wherein the Swagger API document includes a request method, path, parameter type, and return value of the corresponding interface;
[0104] The data conversion module is specifically used to convert the Swagger API document into a TypeScript code file;
[0105] The code insertion module is specifically used to insert the request function code into the TypeScript code file to obtain the file after the code is inserted.
[0106] In a possible implementation, the code insertion module is specifically configured to convert the Swagger API document into a TypeScript code file through swagger-typescript-api.
[0107] In a possible implementation, the interface calling module is specifically used to synchronize the file after the code is inserted into the project; and reference the file after the code is inserted in the project to call the corresponding interface according to the request method, path, parameter type and return value of the corresponding interface.
[0108] It can be seen that through the device of the embodiment of the present application, verification reference data can be obtained, and the verification reference data can be converted into a code file in a target format, thereby inserting it into the code file in the target format, thereby introducing the file after the code is inserted into the project, so that when the file after the code is inserted is compiled, the corresponding interface is called according to the verification reference data, so that when maintenance is required later, only the verification reference data needs to be modified, and maintenance is simple.
[0109] The embodiment of the present invention further provides an electronic device, such as Figure 7 As shown, it includes a processor 701, a communication interface 702, a memory 703 and a communication bus 704, wherein the processor 701, the communication interface 702, and the memory 703 communicate with each other through the communication bus 704.
[0110] Memory 703, used for storing computer programs;
[0111] The processor 701 is used to execute the program stored in the memory 703 to implement the following steps:
[0112] Obtain verification reference data;
[0113] Converting the verification reference data into a code file in a target format;
[0114] Inserting the request function code into the code file of the target format to obtain a file after the code is inserted;
[0115] The file after the code insertion is introduced into the project, so that when the file after the code insertion is compiled, the corresponding interface is called according to the verification reference data.
[0116] The communication bus mentioned in the above terminal can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0117] The communication interface is used for communication between the above terminal and other devices.
[0118] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0119] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0120] In another embodiment of the present invention, a computer-readable storage medium is provided, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the interface calling method described in any one of the above embodiments is implemented.
[0121] In another embodiment of the present invention, a computer program product including instructions is provided, which, when executed on a computer, enables the computer to execute the interface calling method described in any one of the above embodiments.
[0122] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk Solid State Disk (SSD)), etc.
[0123] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0124] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device, electronic device, storage medium and computer program product embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.
[0125] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.
Claims
1. An interface calling method, characterized in that: The method comprises: Obtain verification reference data; Converting the verification reference data into a code file in a target format; Inserting the request function code into the code file of the target format to obtain a file after the code is inserted; The file after the code insertion is introduced into the project, so that when the file after the code insertion is compiled, the corresponding interface is called according to the verification reference data.
2. The method according to claim 1, characterized in that The obtaining of verification reference data comprises: Obtain the Swagger API document of the target interface, wherein the Swagger API document includes the request method, path, parameter type, and return value of the corresponding interface; The step of converting the verification reference data into a code file in a target format includes: Convert the Swagger API document into a TypeScript code file; The step of inserting the request function code into the code file of the target format to obtain a file after the code is inserted comprises: Insert the request function code into the TypeScript code file to obtain the file after the code is inserted.
3. The method according to claim 2, characterized in that The step of converting the Swagger API document into a TypeScript code file includes: Use swagger-typescript-api to convert the Swagger API document into a TypeScript code file.
4. The method according to claim 2, characterized in that: The step of introducing the file after the code is inserted into the project so as to call the corresponding interface according to the verification reference data when the file after the code is inserted is compiled includes: Synchronize the files after the code is inserted into the project; The file after the code insertion is referenced in the project to call the corresponding interface according to the request method, path, parameter type and return value of the corresponding interface.
5. An interface calling device, characterized in that: The device comprises: A data acquisition module, used to acquire verification reference data; A data conversion module, used to convert the verification reference data into a code file in a target format; A code insertion module, used for inserting the request function code into the code file of the target format to obtain the file after the code is inserted; The interface calling module is used to introduce the file after the code is inserted into the project, so as to call the corresponding interface according to the verification reference data when compiling the file after the code is inserted.
6. The device according to claim 5, characterized in that The data acquisition module is specifically used to obtain the Swagger API document of the target interface, wherein the Swagger API document includes the request method, path, parameter type and return value of the corresponding interface; The data conversion module is specifically used to convert the Swagger API document into a TypeScript code file; The code insertion module is specifically used to insert the request function code into the TypeScript code file to obtain the file after the code is inserted.
7. The device according to claim 6, characterized in that The code insertion module is specifically used to convert the Swagger API document into a TypeScript code file through swagger-typescript-api.
8. The device according to claim 6, characterized in that The interface calling module is specifically used to synchronize the file after the code is inserted into the project; and reference the file after the code is inserted in the project to call the corresponding interface according to the request method, path, parameter type and return value of the corresponding interface.
9. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, for implementing the method steps described in any one of claims 1 to 4 when executing a program stored in a memory.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps described in any one of claims 1 to 4 are implemented.
