CN115729539A - Template file generation method, device, equipment and medium for code development - Google Patents

Template file generation method, device, equipment and medium for code development Download PDF

Info

Publication number
CN115729539A
CN115729539A CN202211435712.7A CN202211435712A CN115729539A CN 115729539 A CN115729539 A CN 115729539A CN 202211435712 A CN202211435712 A CN 202211435712A CN 115729539 A CN115729539 A CN 115729539A
Authority
CN
China
Prior art keywords
file
creation
interface
configuration information
target
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.)
Pending
Application number
CN202211435712.7A
Other languages
Chinese (zh)
Inventor
白丹丹
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Kangjian Information Technology Shenzhen Co Ltd
Original Assignee
Kangjian Information Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Kangjian Information Technology Shenzhen Co Ltd filed Critical Kangjian Information Technology Shenzhen Co Ltd
Priority to CN202211435712.7A priority Critical patent/CN115729539A/en
Publication of CN115729539A publication Critical patent/CN115729539A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Stored Programmes (AREA)

Abstract

The invention discloses a template file generation method, a template file generation device, a template file generation equipment and a storage medium, wherein the method comprises the following steps: determining a creation target indicated by the received creation request; extracting configuration information from the creation request according to the creation target; if the creation target is the indication creation file, creating the file based on the configuration information; and if the creation target indicates that the interface definition is created, adding the interface definition in the created file based on the configuration information. The configuration information is extracted by determining the indicated creation target, when the creation target is a creation file, the file is created based on the configuration information, and when the creation target is an indication creation interface definition, the interface definition is added in the created file based on the configuration information to obtain the template file, so that developers only need to write code logic in the template file in the development process, and do not need to manually create various files, the tedious and repeated work of the developers can be reduced, the developers can be made to concentrate on writing the code logic, and the development efficiency is improved.

Description

Template file generation method, device, equipment and medium for code development
Technical Field
The invention relates to the technical field of research and development management, in particular to a template file generation method, a device, equipment and a medium for code development.
Background
At present, each company generally adopts a set of unified framework for research and development, and developers develop business codes based on the framework. In the development process, a developer needs to create various types of files, such as interface definition files, interface in-call verification and out-call packaging files, and the like, the files are in the same format and can be used by the developer in all requirements. And each time an interface is added, a developer needs to add a new interface definition in all relevant files.
However, these operations are very cumbersome and highly repetitive, resulting in low development efficiency and high development cost.
Disclosure of Invention
The present invention provides a template file generation method, apparatus, device and medium for code development, which is directed to the deficiencies of the prior art mentioned above, and the object is achieved by the following technical solutions.
The first aspect of the present invention provides a template file generation method for code development, where the method includes:
determining a creation target indicated by the received creation request;
extracting configuration information from the creation request according to the creation target;
if the creation target is an instruction creation file, creating a file based on the configuration information;
and if the creation target indicates to create the interface definition, adding the interface definition in the created file based on the configuration information to obtain a template file.
In some embodiments of the present application, the determining a creation target indicated by the received creation request includes:
extracting creation type information carried by the creation request; determining the creation target as an indication creation file according to the creation type information as first information; and determining the creation target as an indication creation interface definition according to the creation type information as second information.
In some embodiments of the application, the extracting configuration information from the creation request according to the creation target includes:
if the creation target is to indicate to create a file, extracting configuration information related to file creation from the creation request according to a first analysis rule corresponding to the created file; and if the creation target indicates that the interface definition is created, extracting configuration information related to the interface definition from the creation request according to a second analysis rule corresponding to the created interface definition.
In some embodiments of the present application, when the creation target indicates to create a file, the configuration information includes file type information, keywords, and storage paths of various files; the creating a file based on the configuration information comprises:
generating a file name containing the file type information and the keyword for each file; and creating a file corresponding to the corresponding file name under the storage path of each file.
In some embodiments of the present application, the various files include an interface definition file, an interface entry check and exit encapsulation file, an interface function implementation file, an entry definition file, and an exit definition file.
In some embodiments of the present application, when the creation target indicates to create an interface definition, the configuration information includes an interface name, an interface type, a parameter information, and a file full path; adding an interface definition in the created file based on the configuration information, including:
determining a target file indicated by the full file path; determining an interface template corresponding to the interface type; and adding an interface definition in the target file by using the interface template, the interface name, the parameter-outputting information and the parameter-inputting information to obtain a template file.
In some embodiments of the present application, the interface type includes any one of a Dubbo interface, an App interface, and a Restful interface.
A second aspect of the present invention provides a template file generation apparatus for code development, the apparatus including:
a target determination module for determining a creation target indicated by the received creation request;
the information extraction module is used for extracting configuration information from the creation request according to the creation target;
the file creating module is used for creating a file based on the configuration information if the creating target indicates to create the file;
and the interface creating module is used for adding the interface definition in the created file based on the configuration information to obtain the template file if the creation target indicates that the interface definition is created.
A third aspect of the present invention proposes an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the method according to the first aspect when executing the program.
A fourth aspect of the present invention proposes a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, carries out the steps of the method according to the first aspect as described above.
Based on the template file generation method and device for code development described in the first aspect and the second aspect, the present invention has at least the following beneficial effects or advantages:
when a creation request is received, a creation target indicated by the creation request is determined, the creation request is analyzed according to the creation target indicated by the creation request to extract configuration information, then when the creation target is an indication creation file, the file is created based on the configuration information, and when the creation target is an indication creation interface definition, the interface definition is added in the created file based on the configuration information to obtain a template file, so that developers only need to write code logic in the template file in the development process, developers do not need to manually create various files, tedious and repetitive work of the developers can be reduced, the developers only need to write the code logic, and the development efficiency is improved.
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 specification, illustrate embodiments of the invention and together with the description serve to explain the invention and do not limit the invention. In the drawings:
FIG. 1 is a flowchart illustrating an embodiment of a template file generation method for code development according to an exemplary embodiment of the present invention;
FIG. 2 is a schematic diagram illustrating an input of configuration information for a creation target indicating a creation file according to the embodiment shown in FIG. 1;
FIG. 3 is a schematic diagram illustrating an input of configuration information for a creation target to indicate a creation interface definition according to the embodiment of FIG. 1;
FIG. 4 is a schematic diagram illustrating a process of creating a file according to the embodiment shown in FIG. 1;
FIG. 5 is a flow chart illustrating a process of creating an interface definition according to the embodiment shown in FIG. 1;
FIG. 6 is a schematic structural diagram illustrating a template file generating apparatus for code development according to an exemplary embodiment of the present invention;
FIG. 7 is a diagram illustrating a hardware configuration of an electronic device according to an exemplary embodiment of the present invention;
fig. 8 is a schematic structural diagram illustrating a storage medium according to an exemplary embodiment of the present invention.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. The following description refers to the accompanying drawings in which the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the invention, as detailed in the appended claims.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in this disclosure and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It is to be understood that although the terms first, second, third, etc. may be used herein to describe various information, these information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present invention. The word "if" as used herein may be interpreted as "at" \8230; "or" when 8230; \8230; "or" in response to a determination ", depending on the context.
At present, in a process of developing software, a developer usually adopts an MVC (Model-View-Controller) development mode, the developer needs to create different files at each layer, and each time an interface is newly added, the developer needs to create a new interface definition in all related files. Therefore, a lot of tedious work with extremely high repeatability is brought to developers, and the improvement of software development efficiency is greatly limited.
In order to solve the technical problems, the invention provides an automatic template file generation method for code development, so as to save a manual creation process of a developer, namely when a creation request is received, a creation target indicated by the creation request is determined, the creation request is analyzed according to the creation target indicated by the creation request to extract configuration information, then when the creation target is an indication creation file, the file is created based on the configuration information, and when the creation target is an indication creation interface definition, the interface definition is added in the created file based on the configuration information to obtain a template file, so that the developer only needs to write code logic in the template file in a development process, does not need to manually create various files, can reduce some complicated repeated work of the developer, and is enabled to be only dedicated to writing the code logic, and the development efficiency is improved.
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application.
Fig. 1 is a flowchart illustrating an embodiment of a template file generation method for code development according to an exemplary embodiment of the present invention, where the template file generation method for code development may be applied to a computer device, and the computer device may be a terminal device, a mobile terminal, a PC, a server, and the like, and as shown in fig. 1, the template file generation method for code development includes the following steps:
step 101: a creation target indicated by the received creation request is determined.
Optionally, the creation request is generated by a user through a configuration interface provided by the operation file generation tool.
In this embodiment, the generation of the template file includes file creation and interface definition creation. File creation refers to the creation of a new file, and interface definition creation refers to the creation of an interface definition in an already created file. Thus, the generation of a file may involve two creation goals: file creation object and interface definition creation object.
Based on this, when a creation request is received, it is necessary to first determine whether a creation target indicated by the creation request is a file creation target or an interface definition creation target.
In an optional embodiment, the creation type information carried in the creation request may be extracted, and if the creation type information is the first information, the creation target is determined to indicate to create the file, and if the creation type information is the second information, the creation target is determined to indicate to create the interface definition.
The first information and the second information are information for indicating two different creation targets, and may be negotiated in advance, and the presentation forms of the first information and the second information are not specifically limited in the present application.
It should be noted that, for different creation type information, the packaging format corresponding to the creation request is different because the configuration information content input by the user is different.
Step 102: configuration information is extracted from the creation request according to the creation target.
The configuration information refers to the content input by the user in the configuration interface provided by the file generation tool, for example, the content related to the interface definition or the content related to the file creation.
In an optional embodiment, if the creation target is to instruct to create a file, configuration information related to file creation may be extracted from the creation request according to a first parsing rule corresponding to the created file; if the creation target indicates that the interface definition is created, configuration information related to the interface definition may be extracted from the creation request according to a second parsing rule corresponding to the creation interface definition.
Wherein the first parsing rule corresponds to an encapsulation rule encapsulating a creation request for creating a file. The second parsing rule corresponds to an encapsulation rule encapsulating a create request for creating the interface definition.
In an exemplary scenario, the creation target shown in fig. 2 is a configuration information input diagram indicating that a file is created, and the configuration information includes an input box of creator information, an input box of a file function description, a selection key of a file type, an input box of a file name keyword, and a storage path input box of various files.
Specifically, after the user clicks the "create file" button, the interface loads the input interface shown in fig. 2, after the user fills each item of information in the input interface, the "confirm" button is clicked, and the background packages and obtains a creation request according to the first information and each item of information input by the user on the input interface according to the packaging requirement corresponding to the create file.
Further, an interface definition file is stored on the Service file path; the method comprises the steps that interface input parameter verification and output parameter encapsulation files are stored on a ServiceImpl file path; the Manager file path stores an interface function implementation file; the method comprises the steps that an out-reference definition file is stored on an out-reference file path; and the entry definition file is stored on the entry file path.
As can be seen from fig. 2, when the file type selected by the user is the Restful type, in addition to the path information that needs to be input in the input boxes of other file paths, path information needs to be input in the input box of the Restful file path, and the path information stores a file dedicated to the Restful type.
As can be seen, the configuration information related to file creation includes creator information, file function description information, file type information, keywords, and storage paths of various files.
The file type information indicates which type of interface the file created this time is used for implementing, and assuming that the Dubbo file type is selected, the file created under each storage path is used for creating the Dubbo interface definition.
Further, the various files include an interface definition file, an interface entry check and exit packaging file, an interface function implementation file, an entry definition file and an exit definition file.
In another exemplary scenario, the creation target shown in fig. 3 is a configuration information input diagram indicating that the interface definition is created, and the configuration information includes an input box of creator information, an input box of interface function description, a selection key of interface type, an input box of interface name, an input box of interface in-participation, an output box of interface out-participation, and an input box of full path of various files.
Specifically, after the user clicks the "create interface" button, the interface loads the input interface shown in fig. 3, after the user fills each item of information in the input interface, the "confirm" button is clicked, and the background packages and obtains a creation request according to the second information and each item of information input by the user on the input interface, according to the packaging requirements corresponding to the creation file.
In this embodiment, the full file path refers to path information specific to a file name, and a file can be directly opened according to the full file path to write content.
Specifically, a Service file full path indicates a certain created interface definition file; the whole path of the ServiceImpl file indicates an input parameter check and output parameter encapsulation file of a certain created interface; the Manager file full path indicates a certain created interface function file; the full path of the participating file indicates a certain participating definition file which is created; the full path of an entry definition file indicates a certain entry definition file that has been created.
As can be seen from fig. 3, when the interface type selected by the user is the Restful type, in addition to the input of the full path information in the input boxes of the full paths of other files, the input boxes of the call paths of the Restful interface and the input boxes of the call modes of the Restful interface need to input corresponding information respectively.
It can be seen that the configuration information associated with the interface definition includes creator information, interface function specification information, interface type, out-going information, in-going information, and full path of various files.
The interface type indicates which type of interface definition is created at this time, and if the Dubbo interface type is selected, file full path information for creating the Dubbo interface definition needs to be input in an input box of each file full path.
Further, the interface types that can be created include any one of a Dubbo interface, an App interface, and a Restful interface.
Step 103: and if the creation target indicates to create the file, creating the file based on the configuration information.
If the creation target is to indicate the creation of the file, the file is created by using the configuration information related to the creation of the file, the newly created file is equivalent to a new file without any interface definition added, and the related file function description is recorded in the new file.
In a specific embodiment, since the configuration information related to file creation includes file type information, keywords, and storage paths of various files, referring to fig. 4, the file creation process includes the following steps:
step 1031: a file name containing file type information and keywords is generated for each file.
Optionally, the file name may further include fixed string information corresponding to the corresponding storage path, in addition to the file type information and the keyword.
Step 1032: and creating a file corresponding to the corresponding file name under the storage path of each file.
In an example, assuming that the file type information is Bubbo, the keyword is health star, and the file names that need to be created under each storage path respectively include: healthStarBubboServer, healthStarBubboServer Impl, healthStarBubbomanager, grantStepHeadhStarBubboRequest, healthStarBubboNil. Wherein, healthStarBubboService is a file under the storage path of the interface definition file, healthStarBubboServiceImpl is a file under the storage path of the interface entry-entry verification and exit-entry packaging file, the HealthStarBubbomanager is a file under a file storage path realized by the interface function, the GrantStepHeathStarBubboRequest is a file under a storage path of the entry-entry definition file, and HealthStarBubboNil is a file under a storage path of the exit-entry definition file.
In another example, assuming that the file type information is Mapi, the keyword is health star, and the file names that need to be created under each storage path respectively are: healthStarMaPiService, healthStarMaPiServiceImpl, healthStarMaPiManager, grantStepHeathStarMaPiRequest, healthStarMapNil. Wherein, healthStarMaPiService is the file under the storage path of the interface definition file, healthStarMaPiServiceImpl is the file under the storage path of the interface entry and exit package file, healthStarMapiManager realizes the file under the file storage path for the interface function, grantStepHeathStarMapiRequest is the file under the file storage path of the entry definition, and HealthStarMapiriNil is the file under the file storage path of the exit definition.
Step 104: and if the creation target is to indicate to create the interface definition, adding the interface definition in the created file based on the configuration information to obtain the template file.
Wherein if the creation target is to instruct to create the interface definition, the interface definition is added in the created file by using the configuration information related to the interface definition. The template file finally used in the development process refers to a file to which interface definitions are added, and developers can write codes directly in the template file without adding repeated interface definition contents in the file.
Based on the above description of step 101, the generation of the template file may involve the creation of the file and the creation of the interface definition, so that the addition of the interface definition is required after the file is created. And obtaining a template file through the addition of the interface definition, wherein the template file records definition descriptions related to the newly added interface, and developers can directly write codes in the template file.
In a specific embodiment, for the interface definition creation target, since the configuration information related to the interface definition includes an interface name, an interface type, an out-reference information, an in-reference information, and a file full path, as shown in fig. 5, the interface definition creation process includes the following steps:
step 1033: and determining a target file indicated by the full file path.
Since the file full path includes a specific file name, which file it indicates can be directly obtained.
Step 1034: and determining an interface template corresponding to the interface type.
The interface template defines the information format related to the interface to be added in each file. Because the interface definitions of different interface types are different, an interface template is correspondingly arranged for each interface type in advance, so that the subsequent addition of the interface definitions according to the template is facilitated.
Step 1035: and adding an interface definition in the target file by using the interface template, the interface name, the parameter output information and the parameter input information to obtain a template file.
Specifically, according to a corresponding adding format specified in the interface template, the interface definition is added in the target file by using the interface name, the parameter-out information and the parameter-in information.
So far, the template file generation flow for code development shown in fig. 1 is completed, when a creation request is received, a creation target indicated by the creation request is determined, the creation request is analyzed according to the creation target indicated by the creation request to extract configuration information, then when the creation target is an indication creation file, the file is created based on the configuration information, and when the creation target is an indication creation interface definition, an interface definition is added to the created file based on the configuration information to obtain a template file, so that a developer only needs to write code logic in the template file in a development process, does not need to manually create various files, can reduce some tedious and repetitive work of the developer, and can only focus on writing the code logic, thereby improving development efficiency.
Corresponding to the embodiment of the template file generation method for code development, the invention also provides an embodiment of a template file generation device for code development.
Fig. 6 is a flowchart of an embodiment of a template file generating apparatus for code development according to an exemplary embodiment of the present invention, the apparatus is configured to execute a template file generating method for code development provided in any one of the embodiments described above, and as shown in fig. 6, the template file generating apparatus for code development includes:
a target determination module 610 for determining a creation target indicated by the received creation request;
an information extraction module 620, configured to extract configuration information from the creation request according to the creation target;
a file creating module 630, configured to create a file based on the configuration information if the creation target indicates that the file is created;
and an interface creating module 640, configured to add an interface definition to the created file based on the configuration information to obtain a template file if the creation target indicates that the interface definition is created.
The implementation process of the functions and actions of each unit in the above device is specifically described in the implementation process of the corresponding step in the above method, and is not described herein again.
For the device embodiments, since they substantially correspond to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points. The above-described embodiments of the apparatus are merely illustrative, and 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 modules can be selected according to actual needs to achieve the purpose of the scheme of the invention. One of ordinary skill in the art can understand and implement it without inventive effort.
The embodiment of the invention also provides electronic equipment corresponding to the template file generation method for code development provided by the foregoing embodiment, so as to execute the template file generation method for code development.
Fig. 7 is a hardware configuration diagram of an electronic device according to an exemplary embodiment of the present invention, the electronic device including: a communication interface 601, a processor 602, a memory 603, and a bus 604; the communication interface 601, the processor 602 and the memory 603 communicate with each other via the bus 604. The processor 602 may execute the template file generation method for code development described above by reading and executing machine executable instructions in the memory 603 corresponding to the control logic of the template file generation method for code development, and the specific content of the method is described in the above embodiments, which will not be described herein again.
The memory 603 referred to in this disclosure may be any electronic, magnetic, optical, or other physical storage device that can contain stored information, such as executable instructions, data, and so forth. Specifically, the Memory 603 may be a RAM (Random Access Memory), a flash Memory, a storage drive (e.g., a hard disk drive), any type of storage disk (e.g., an optical disk, a DVD, etc.), or similar storage medium, or a combination thereof. The communication connection between the network element of the system and at least one other network element is implemented through at least one communication interface 601 (which may be wired or wireless), and the internet, a wide area network, a local network, a metropolitan area network, and the like may be used.
Bus 604 can be an ISA bus, PCI bus, EISA bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. The memory 603 is used for storing a program, and the processor 602 executes the program after receiving the execution instruction.
The processor 602 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by instructions in the form of hardware integrated logic circuits or software in the processor 602. The Processor 602 may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; but may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components. The various methods, steps, and logic blocks disclosed in the embodiments of the present application may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present application may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor.
The electronic device provided by the embodiment of the application and the template file generation method for code development provided by the embodiment of the application have the same beneficial effects as the method adopted, operated or realized by the electronic device.
The present embodiment further provides a computer-readable storage medium corresponding to the template file generation method for code development provided in the foregoing embodiment, please refer to fig. 8, which illustrates the computer-readable storage medium as an optical disc 30, on which a computer program (i.e., a program product) is stored, and when the computer program is executed by a processor, the computer program will execute the template file generation method for code development provided in any foregoing embodiment.
It should be noted that examples of the computer-readable storage medium may also include, but are not limited to, a phase change memory (PRAM), a Static Random Access Memory (SRAM), a Dynamic Random Access Memory (DRAM), other types of Random Access Memories (RAM), a Read Only Memory (ROM), an Electrically Erasable Programmable Read Only Memory (EEPROM), a flash memory, or other optical and magnetic storage media, which are not described in detail herein.
The computer-readable storage medium provided by the above embodiment of the present application and the template file generation method for code development provided by the embodiment of the present application have the same inventive concept and have the same beneficial effects as the method adopted, run or implemented by the application program stored in the computer-readable storage medium.
Other embodiments of the invention will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. The invention is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the invention and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the invention being indicated by the following claims.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrases "comprising a," "8230," "8230," or "comprising" does not exclude the presence of other like elements in a process, method, article, or apparatus comprising the element.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.

Claims (10)

1. A template file generation method for code development, the method comprising:
determining a creation target indicated by the received creation request;
extracting configuration information from the creation request according to the creation target;
if the creation target indicates that a file is created, creating the file based on the configuration information;
and if the creation target indicates to create the interface definition, adding the interface definition in the created file based on the configuration information to obtain a template file.
2. The method according to claim 1, wherein the creation target is to indicate that when a file is created, the configuration information includes file type information, keywords, and storage paths of various files;
the creating a file based on the configuration information comprises:
generating a file name containing the file type information and the keyword for each file;
and creating a file corresponding to the corresponding file name under the storage path of each file.
3. The method of claim 2, wherein the various files include an interface definition file, an interface in-call check and out-call encapsulation file, an interface function implementation file, an in-call definition file, and an out-call definition file.
4. The method according to claim 1, wherein the creation target is to indicate that when an interface definition is created, the configuration information includes an interface name, an interface type, an exit information and an entry information, and a file full path;
adding an interface definition in the created file based on the configuration information, including:
determining a target file indicated by the full file path;
determining an interface template corresponding to the interface type;
and adding an interface definition in the target file by using the interface template, the interface name, the parameter-outputting information and the parameter-inputting information to obtain a template file.
5. The method of claim 4, wherein the interface type comprises any one of a Dubbo interface, an App interface, and a Restful interface.
6. The method of claim 1, wherein the determining the creation target indicated by the received creation request comprises:
extracting creation type information carried by the creation request;
determining the creation target as an instruction creation file according to the creation type information as first information;
and determining the creation target as an indication creation interface definition according to the creation type information as second information.
7. The method of claim 1, wherein extracting configuration information from the create request according to the create target comprises:
according to the creation target, indicating a created file, and extracting configuration information related to file creation from the creation request according to a first analysis rule corresponding to the created file;
and according to the creation target, creating an interface definition, and extracting configuration information related to the interface definition from the creation request according to a second analysis rule corresponding to the created interface definition.
8. An apparatus for generating a template file for code development, the apparatus comprising:
a target determination module for determining a creation target indicated by the received creation request;
an information extraction module for extracting configuration information from the creation request according to the creation target;
the file creating module is used for creating a file based on the configuration information if the creating target indicates to create the file;
and the interface creating module is used for adding the interface definition in the created file based on the configuration information to obtain the template file if the creation target indicates that the interface definition is created.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the steps of the method according to any of claims 1-7 are implemented when the processor executes the program.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 7.
CN202211435712.7A 2022-11-16 2022-11-16 Template file generation method, device, equipment and medium for code development Pending CN115729539A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211435712.7A CN115729539A (en) 2022-11-16 2022-11-16 Template file generation method, device, equipment and medium for code development

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211435712.7A CN115729539A (en) 2022-11-16 2022-11-16 Template file generation method, device, equipment and medium for code development

Publications (1)

Publication Number Publication Date
CN115729539A true CN115729539A (en) 2023-03-03

Family

ID=85296124

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211435712.7A Pending CN115729539A (en) 2022-11-16 2022-11-16 Template file generation method, device, equipment and medium for code development

Country Status (1)

Country Link
CN (1) CN115729539A (en)

Similar Documents

Publication Publication Date Title
CN107122296B (en) Method and apparatus for data assertion for test interface
CN110673839B (en) Distributed tool configuration construction generation method and system
CN106933887B (en) Data visualization method and device
CN108134812B (en) Data processing method and device
CN110717536A (en) Method and device for generating training sample
CN110990274A (en) Data processing method, device and system for generating test case
CN113010169A (en) Method and apparatus for converting UI diagram into code file
CN113495797A (en) Message queue and consumer dynamic creation method and system
CN110569429B (en) Method, device and equipment for generating content selection model
CN113452613A (en) Method and device for acquiring page routing address, electronic equipment and storage medium
CN104899203B (en) Webpage generation method and device and terminal equipment
EP3944242A1 (en) A system and method to customizing video
CN105824647A (en) Form page generating method and device
CN113535817A (en) Method and device for generating characteristic broad table and training business processing model
CN114461960B (en) Page generation method, page display method and page display device
CN115729539A (en) Template file generation method, device, equipment and medium for code development
CN112114794B (en) Automatic generation method and device of website application program and computer storage medium
CN113282285A (en) Code compiling method and device, electronic equipment and storage medium
CN110554867B (en) Application processing method and device
CN112486565A (en) Containerization-based continuous integration method and equipment
CN112579221A (en) Modal popup display method and device
CN115543323B (en) Page development method and device
CN112181407A (en) Service implementation processing method, device, system, electronic equipment and storage medium
CN110837896B (en) Storage and calling method and device of machine learning model
CN115390835A (en) Method and device for constructing small program labeling search box

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