Disclosure of Invention
In view of this, the embodiments of the present invention provide a method and an apparatus for processing project codes, which can solve the problems that the existing command line scaffold tool cannot delete the existing module codes and the function of modifying file increment is limited.
To achieve the above object, according to an aspect of the embodiments of the present invention, there is provided an item code processing method, including receiving a module processing command, selecting a module template type and a corresponding template type parameter from a configuration file to generate a template parameter; reading a code template file in a corresponding module template type subdirectory from a code template file catalogue, and replacing a preset placeholder in a code template file name by using an input template parameter; based on the extension type of the code template file, the execution module processes the command.
Optionally, the receiving module processes the command, selects a module template type and a corresponding template type parameter from the configuration file to generate a template parameter, including:
Receiving an add module processing command, reading a module template type list from a configuration file to select a template type and setting a module name; combining the module name with the corresponding template type parameter in the configuration file to generate a template parameter;
Or receiving a module deleting processing command, and reading a module list from the configuration file to select a module name; combining the module name with the corresponding template type parameter in the configuration file to generate a template parameter; the module list comprises a mapping relation between module template types and module names.
Optionally, based on the extension type of the code template file, further executing the module processing command includes:
detecting that the extension of the code template file is of a preset first type;
If the module processing command is the add module processing command, using a template engine to replace the template parameters to all preset placeholders in the code template file, then removing the extension and copying the code template file; storing the code template file to a corresponding position according to a template file directory structure in the code template file directory;
if the module processing command is a deletion module processing command, the code template file name with the extension name removed is obtained so as to delete the code template file at the corresponding position based on the template file directory structure in the code template file directory.
Optionally, based on the extension type of the code template file, further executing the module processing command includes:
detecting that the extension of the code template file is of a preset second type;
If the module processing command is the add module processing command, copying the code template file; storing the code template file to a corresponding position according to a template file directory structure in the code template file directory;
if the module processing command is a deletion module processing command, deleting the code template file at the corresponding position based on the template file directory structure in the code template file directory.
Optionally, based on the extension type of the code template file, further executing the module processing command includes:
Detecting that the extension of the code template file is of a preset third type;
If the module processing command is an add module processing command, analyzing a plurality of corresponding block code templates according to the block structures in the code template file, and using a template engine to respectively replace preset placeholders in each block code template with template parameters so as to obtain a rendered block code template; searching a corresponding existing file in an existing code project according to the file directory structure of the code template, respectively replacing corresponding annotation placeholders in the existing file with the rendered block code template, and generating an annotation placeholder behind the replaced annotation placeholders;
If the module processing command is a deletion module processing command, analyzing a plurality of corresponding block code templates according to the block structures in the code template file, and using a template engine to respectively replace preset placeholders in each block code template with template parameters so as to obtain a rendered block code template; and searching a corresponding existing file in the existing code engineering according to the code template file directory structure so as to locate the corresponding position in the existing file based on the rendered block code template and replace the corresponding position with an empty string.
Optionally, the replacing the placeholder preset in the code template file name with the input template parameter includes:
Detecting whether the file name of the code template comprises a preset branch reading identifier or not;
If yes, selecting a subdirectory of the catalogue where the code template file is located according to the module template type, and then, transferring template parameters to replace a preset placeholder in the code template file name included in the subdirectory;
If not, directly transmitting the template parameters to replace the preset placeholders in the file names of the code templates.
Optionally, the replacing the placeholder preset in the code template file name with the input template parameter includes:
Template parameters are entered and a template engine is used to replace a preset placeholder in the code template file name.
In addition, according to an aspect of the embodiment of the present invention, there is provided an item code processing apparatus, including a receiving module, configured to receive a module processing command, select a module template type and a corresponding template type parameter from a configuration file, so as to generate a template parameter; reading a code template file in a corresponding module template type subdirectory from a code template file catalogue, and replacing a preset placeholder in a code template file name by using an input template parameter; and the execution module is used for processing the command based on the extension type of the code template file.
According to another aspect of an embodiment of the present invention, there is also provided an electronic device including:
One or more processors;
Storage means for storing one or more programs,
The one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method of any of the computing embodiments described above.
According to another aspect of an embodiment of the present invention, there is also provided a computer readable medium having stored thereon a computer program which, when executed by a processor, implements any of the methods described above based on the computing embodiments.
One embodiment of the above invention has the following advantages or benefits: the invention selects the template type of the module and the corresponding template type parameter from the configuration file by the receiving module processing command so as to generate the template parameter; reading a code template file in a corresponding module template type subdirectory from a code template file catalogue, and replacing a preset placeholder in a code template file name by using an input template parameter; based on the extension type of the code template file, the execution module processes the command. Therefore, the invention provides two CLI commands to be added and deleted, which can automatically and rapidly add the initial codes of the templates or delete the codes of the existing modules, thereby greatly improving the working efficiency.
Further effects of the above-described non-conventional alternatives are described below in connection with the embodiments.
Detailed Description
Exemplary embodiments of the present invention will now be described with reference to the accompanying drawings, in which various details of the embodiments of the present invention are included to facilitate understanding, and are to be considered merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Fig. 1 is a schematic diagram of main flow of an item code processing method according to a first embodiment of the present invention, which may include:
Step S101, a receiving module processes a command, and selects a module template type and a corresponding template type parameter from a configuration file to generate a template parameter.
As an embodiment of the present invention, as shown in fig. 2, a schematic frame diagram of a project code processing method according to an embodiment of the present invention includes an existing code engineering, an add module command, and a delete module command. The CLI configuration file (for example, CLI. Config. Js configuration file) and the code template file directory (for example, templates directory) are included in the existing code engineering. Of course, conventional code required for project development is also included in existing code engineering. In the add module command, the module file is created and the existing file is modified in increment, and in the delete module command, the module file is deleted and the existing file is modified in decrement.
For example: the add module command uses node. Js to create a global command named cli, then creates an add module subcommand named: cliadd.
The delete module command uses node. Js to create a global command named cli, then creates a delete module subcommand named: CLI DELETE.
In further embodiments, CLI profiles may be written generally in js or xml format. The CLI configuration file may include: the templates field (i.e., a template type list) is an object structure, in which a component subfield (i.e., a tuple structure used for storing information such as different template types that need to be used when executing an add module command) is a module type parameter input when executing the add module command, so as to distinguish which type of new module is newly added. In addition, when a plurality of module types are preset, a plurality of templates subfields, such as pages, can be defined. The CLI profile may also include files fields (i.e., an existing module list that acts to hold existing module information for use in reading when a delete command is operated): the structure is similar to the templates and is also an object structure, and the component subfields are also similar to the component subfields in the templates field and are a array structure. Multiple files subfields, such as pages, may also be defined.
In a still further embodiment, the first layer directory of the code template file directory is a module type parameter input when executing the add module command, and each file storage location under the first layer directory is completely matched with each file structure in the existing code project. Wherein the file types include a first type, a second type, and a third type.
The first type is a hbs extension file, a template file that can be rendered by a template engine (e.g., using Handlebars template engine with default placeholders of "{ { xxx }" but the invention is not limited to using a certain template engine, such as EJS or a self-implemented simple template engine, and the corresponding file is generated by removing the hbs extension after rendering.
The second type is a.t.hbs extension file, the type file needs to be subjected to block analysis to obtain a block template, and after rendering, local codes are newly added or deleted in the corresponding file after the.t.hbs extension is removed.
The third type is the rest files, which are all regular files.
In some embodiments, if an add module processing command is received, a list of module template types is read from a configuration file (e.g., CLI configuration file) to select a template type and set a module name. And merging the module name with the corresponding template type parameter in the configuration file to generate the template parameter.
If a delete module processing command is received, reading a module list from the configuration file to select a module name; and merging the module name with the corresponding template type parameter in the configuration file to generate the template parameter. The module list comprises a mapping relation between module template types and module names.
Step S102, reading the code template file in the corresponding module template type subdirectory from the code template file catalogue, and replacing the preset placeholder in the code template file name by the input template parameter.
The placeholder is exemplified by handlebars template engines, which refer to { { { abc } }, namely the placeholder can only exist in the template file, and belongs to the existing concept, and each template engine is built-in to support the function of replacing the placeholder. The default supported placeholders are different for different template engines, e.g., EJS, with its placeholders being <%abc% >.
In some embodiments, when the incoming template parameter replaces a preset placeholder in the code template file name, it may be detected whether the code template file name includes a preset branch read identifier. If the preset branch reading identifier is included, selecting a subdirectory of the catalogue where the code template file is located according to the module template type, and then transmitting template parameters to replace a preset placeholder in the code template file name included in the subdirectory. If the preset branch reading identification is not included, directly transmitting the template parameters to replace the preset placeholders in the file name of the code template.
As a preferred embodiment, template parameters are entered and a template engine is used to replace preset placeholders in the code template file name.
Step S103, based on the extension type of the code template file, the module processing command is further executed.
In some embodiments, when detecting that the extension of the code template file is of a preset first type:
If the module processing command is the add module processing command, using a template engine to replace the template parameters to all preset placeholders in the code template file, then removing the extension and copying the code template file; and storing the code template file to a corresponding position according to the template file directory structure in the code template file directory. Thus, creating the module file is completed. For example: the template parameters are { a:100, b:200}, the template file content is { { a } + { b } = 300, when the template engine is used for replacement, the template parameters are required to be transmitted, the replacement is also required to be executed once, and the result after the replacement is as follows: 100+200=300.
And if the module processing command is a deletion module processing command, acquiring the code template file name with the extension name removed so as to delete the code template file at the corresponding position based on the template file directory structure in the code template file directory. Thus, the deletion of the module file is completed.
In still other embodiments, when detecting that the extension of the code template file is of a preset second type:
If the module processing command is an add module processing command, copying the code template file; and storing the code template file to a corresponding position according to the template file directory structure in the code template file directory. Thus, creating the module file is completed.
If the module processing command is a deletion module processing command, deleting the code template file at the corresponding position based on the template file directory structure in the code template file directory. Thus, the deletion of the module file is completed.
In other embodiments, when the extension of the code template file is detected as the preset third type:
If the module processing command is an add module processing command, analyzing a plurality of corresponding block code template files according to the block structures in the code template files, and using a template engine to respectively replace preset placeholders in each block code template with template parameters so as to obtain a rendered block code template; searching a corresponding existing file in the existing code engineering according to the file directory structure of the code template, respectively replacing corresponding annotation placeholders in the existing file by the rendered block code template, and generating an annotation placeholder behind the replaced annotation placeholders. Thus, incremental modification of the existing file is completed.
If the module processing command is a deletion module processing command, analyzing a plurality of corresponding block code template files according to the block structures in the code template files, and using a template engine to respectively replace preset placeholders in each block code template with template parameters so as to obtain a rendered block code template; and searching a corresponding existing file in the existing code engineering according to the code template file directory structure so as to locate the corresponding position in the existing file based on the rendered block code template and replace the corresponding position with an empty string. Thus, the decrement modification of the existing file is completed.
Wherein the annotation placeholder is predefined for inserting new content in an existing code file, while the annotation itself does not affect the functionality of the existing code. For example: the format in js (javascript) codes may be "// { placeholder }//", which is the name of the annotation placeholder. The format in css codes may be "/{ placeholder }".
Therefore, the project code processing method of the invention not only supports adding module codes, but also supports deleting module codes. Namely, two CLI commands are added or deleted, so that the template initial codes are automatically and rapidly added or the existing module codes are deleted, and the working efficiency is improved. Meanwhile, in addition to supporting incremental modification, the existing file also supports decremental modification. When the existing file is modified by increasing (decreasing) amount, a plurality of annotation placeholders can be customized and placed at any position. And the programming language of the existing code file is unlimited, codes are supported to be added or deleted at any position in any code language file, the expandability is strong, and the method is suitable for the existing code engineering of any file structure. In addition, the method supports the user to automatically expand and add or delete the new type of module, the learning difficulty and the development cost are low, and the user can automatically start to perform the personalized expansion function only by grasping a very simple concept.
Fig. 3 is a schematic diagram of a main flow of an item code processing method according to a second embodiment of the present invention, which may include, based on receiving an add module processing command:
In step S301, an add module process command is received.
For example: a command is received cli add component, wherein the component parameter is referred to as a module type.
Step S302, a module template type list is read from the configuration file to select a template type and set a module name.
For example: and reading a module template type list from the cli.config.js file, selecting the template type to be created, and inputting the module name. The module Name is saved with componentName (i.e., named "module type + Name") variables.
Step S303, combining the module name and the corresponding template type parameter in the configuration file to generate the template parameter.
Step S304, reading the code template file in the corresponding module template type subdirectory from the code template file catalogue.
Step S305, detecting whether the code template file name includes a preset branch reading identifier, if yes, proceeding to step S306 and proceeding to step S307, otherwise proceeding to step S307 directly.
For example: the templates/components/src/[ components ]/directory name contains "[ ]", representing that its subdirectories or files will be read in branches according to template type. Step S306, selecting a subdirectory of the catalogue where the code template file is located according to the module template type, and then, transferring in template parameters to replace a preset placeholder in the code template file name included in the subdirectory.
In an embodiment, the corresponding subdirectory (e.g., { { ComponentName } } } } } } -Input subdirectory) is selected according to the previously entered template type (e.g., input template type). This name naming of the subdirectory requires the addition of "-template types" at the end, which allows more reuse of common template files (e.g., main. Js. T. Hbs, etc. in the example) and easier maintenance when the number of template files is large.
Step S307, the template parameters are input and the template engine is used for replacing the preset placeholders in the code template file names.
For example: the Handlebars template engine is used to replace the preset placeholders in the code template file name. It should be noted that, in special cases: if the "-template type" suffix is included, then the "-template type needs to be removed. If included, "[ ]", then "[ ]" is also removed. For example: src/[ components ]/{ { { ComponentName } } } -Input is replaced with src/components/Test1.
Step S308, judging the extension type of the code template file, if the extension type is the preset first type, performing step S309, if the extension type is the preset second type, performing step S310, and if the extension type is the preset third type, performing step S311.
Step S309, using the template engine to replace the template parameters to all preset placeholders in the code template file, then removing the extension and copying the code template file; and storing the code template file to a corresponding position according to the template file directory structure in the code template file directory.
Step S310, copying the code template file; and storing the code template file to a corresponding position according to the template file directory structure in the code template file directory.
Step S311, a plurality of corresponding block code templates are analyzed according to the block structure in the code template file, and template parameters are respectively replaced by a template engine for a preset placeholder in each block code template so as to obtain a rendered block code template; searching a corresponding existing file in the existing code engineering according to the file directory structure of the code template, respectively replacing corresponding annotation placeholders in the existing file by the rendered block code template, and generating an annotation placeholder behind the replaced annotation placeholders.
For example: the template/component/src/main.js.t.hbs file, whose structure is composed of multiple < # template > tags, is called a block template. Each block template tag includes a name attribute therein, referred to as a block template name.
Fig. 4 is a schematic diagram of a main flow of an item code processing method according to a third embodiment of the present invention, which may include, based on receiving a delete module process command:
in step S401, a delete module process command is received.
For example: a component command is entered CLI DELETE, where the component parameter is called the module type.
Step S402, reading the module list from the configuration file to select the module name.
Step S403, combining the module name and the corresponding template type parameter in the configuration file to generate the template parameter.
The module list comprises a mapping relation between module template types and module names.
Step S404, reading the code template file in the corresponding module template type subdirectory from the code template file catalogue.
Step S405, detecting whether the code template file name comprises a preset branch reading identifier, if yes, proceeding to step S406, proceeding to step S407, otherwise proceeding to step S407 directly.
Step S406, selecting a subdirectory of the catalogue where the code template file is located according to the module template type, and then, transferring in template parameters to replace a preset placeholder in the code template file name included in the subdirectory.
Step S407, the template parameters are input and the template engine is used for replacing the preset placeholders in the code template file names.
Step S408, judging the extension type of the code template file, if the extension type is the preset first type, performing step S409, then performing step S410, if the extension type is the preset second type, then performing step S410 directly, and if the extension type is the preset third type, then performing step S411.
Step S409, the code template file name with the extension removed is obtained.
Step S410, deleting the code template file at the corresponding position based on the template file directory structure in the code template file directory.
Step S411, a plurality of corresponding block code templates are analyzed according to the block structure in the code template file, and template parameters are respectively replaced by a template engine for a preset placeholder in each block code template so as to obtain a rendered block code template; and searching a corresponding existing file in the existing code engineering according to the code template file directory structure so as to locate the corresponding position in the existing file based on the rendered block code template and replace the corresponding position with an empty string.
Fig. 5 is a schematic diagram of main modules of an item code processing apparatus according to a first embodiment of the present invention, and as shown in fig. 5, the item code processing apparatus 500 includes a receiving module 501 and an executing module 502. The receiving module 501 receives a module processing command, and selects a module template type and a corresponding template type parameter from the configuration file to generate a template parameter. And reading the code template file in the corresponding module template type subdirectory from the code template file catalogue, and replacing a preset placeholder in the code template file name by using the input template parameter. The execution module 502 proceeds to execute module processing commands based on the extension type of the code template file.
In a further embodiment, when the receiving module 501 receives a module processing command and selects a module template type and a corresponding template type parameter from a configuration file to generate a template parameter, the method may include:
Receiving an add module processing command, reading a module template type list from a configuration file to select a template type and setting a module name; and merging the module name with the corresponding template type parameter in the configuration file to generate the template parameter.
Or receiving a module deleting processing command, and reading a module list from the configuration file to select a module name; combining the module name with the corresponding template type parameter in the configuration file to generate a template parameter; the module list comprises a mapping relation between module template types and module names.
As yet another embodiment, the execution module 502 may detect that the extension of the code template file is of the preset first type when the execution module processes the command based on the extension type of the code template file. If the module processing command is the add module processing command, using a template engine to replace the template parameters to all preset placeholders in the code template file, then removing the extension and copying the code template file; and storing the code template file to a corresponding position according to the template file directory structure in the code template file directory. If the module processing command is a deletion module processing command, the code template file name with the extension name removed is obtained so as to delete the code template file at the corresponding position based on the template file directory structure in the code template file directory.
As yet another embodiment, the execution module 502 may detect that the extension of the code template file is of the preset second type based on the extension type of the code template file, and when the execution module processes the command. If the module processing command is the add module processing command, copying the code template file; and storing the code template file to a corresponding position according to the template file directory structure in the code template file directory. If the module processing command is a deletion module processing command, deleting the code template file at the corresponding position based on the template file directory structure in the code template file directory.
As another embodiment, the execution module 502 may detect that the extension of the code template file is of the preset third type when the execution module processes the command based on the extension type of the code template file. If the module processing command is an add module processing command, analyzing a plurality of corresponding block code template files according to the block structures in the code template files, and using a template engine to respectively replace preset placeholders in each block code template with template parameters so as to obtain a rendered block code template; searching a corresponding existing file in an existing code project according to the file directory structure of the code template, respectively replacing corresponding annotation placeholders in the existing file with the rendered block code template, and generating an annotation placeholder behind the replaced annotation placeholders; if the module processing command is a deletion module processing command, analyzing a plurality of corresponding block code template files according to the block structures in the code template files, and using a template engine to respectively replace preset placeholders in each block code template with template parameters so as to obtain a rendered block code template; and searching a corresponding existing file in the existing code engineering according to the code template file directory structure so as to locate the corresponding position in the existing file based on the rendered block code template and replace the corresponding position with an empty string.
It should be further noted that, the replacing, by the template parameter, the placeholder preset in the code template file name by the receiving module 501 includes:
Detecting whether the file name of the code template comprises a preset branch reading identifier or not;
If yes, selecting a subdirectory of the catalogue where the code template file is located according to the module template type, and then, transferring the template parameter to replace a preset placeholder in the code template file name included in the subdirectory.
If not, directly transmitting the template parameters to replace the preset placeholders in the file names of the code templates.
In some embodiments of the present invention, the receiving module 501 enters the template parameters and replaces the preset placeholders in the code template file name with the template engine.
In the method for processing an item code according to the present invention, the item code processing apparatus and the item code processing apparatus have a corresponding relationship in terms of implementation contents, and therefore, the repetitive contents will not be described.
Fig. 6 illustrates an exemplary system architecture 600 to which the project code processing method or project code processing apparatus of embodiments of the invention may be applied.
As shown in fig. 6, the system architecture 600 may include terminal devices 601, 602, 603, a network 604, and a server 605. The network 604 is used as a medium to provide communication links between the terminal devices 601, 602, 603 and the server 605. The network 604 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
A user may interact with the server 605 via the network 604 using the terminal devices 601, 602, 603 to receive or send messages, etc. Various communication client applications such as shopping class applications, web browser applications, search class applications, instant messaging tools, mailbox clients, social platform software, etc. (by way of example only) may be installed on the terminal devices 601, 602, 603.
The terminal devices 601, 602, 603 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smartphones, tablets, laptop and desktop computers, and the like.
The server 605 may be a server providing various services, such as a background management server (by way of example only) providing support for shopping-type websites browsed by users using terminal devices 601, 602, 603. The background management server may analyze and process the received data such as the product information query request, and feedback the processing result (e.g., the target push information, the product information—only an example) to the terminal device.
It should be noted that, the method for processing project codes provided in the embodiment of the present invention is generally executed by the server 605, and accordingly, the project code processing apparatus is generally disposed in the server 605.
It should be understood that the number of terminal devices, networks and servers in fig. 6 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 7, there is illustrated a schematic diagram of a computer system 700 suitable for use in implementing an embodiment of the present invention. The terminal device shown in fig. 7 is only an example, and should not impose any limitation on the functions and the scope of use of the embodiment of the present invention.
As shown in fig. 7, the computer system 700 includes a Central Processing Unit (CPU) 701, which can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 702 or a program loaded from a storage section 708 into a Random Access Memory (RAM) 703. In the RAM703, various programs and data required for the operation of the system 700 are also stored. The CPU701, ROM702, and RAM703 are connected to each other through a bus 704. An input/output (I/O) interface 705 is also connected to bus 704.
The following components are connected to the I/O interface 705: an input section 706 including a keyboard, a mouse, and the like; an output portion 707 including a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, a speaker, and the like; a storage section 708 including a hard disk or the like; and a communication section 709 including a network interface card such as a LAN card, a modem, or the like. The communication section 709 performs communication processing via a network such as the internet. The drive 710 is also connected to the I/O interface 705 as needed. A removable medium 711 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 710 as necessary, so that a computer program read therefrom is mounted into the storage section 708 as necessary.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication portion 709, and/or installed from the removable medium 711. The above-described functions defined in the system of the present invention are performed when the computer program is executed by a Central Processing Unit (CPU) 701.
The computer readable medium shown in the present invention may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules involved in the embodiments of the present invention may be implemented in software or in hardware. The described modules may also be provided in a processor, for example, as: a processor includes a receiving module and an executing module. The names of these modules do not constitute a limitation on the module itself in some cases.
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be present alone without being fitted into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to include: the receiving module processes the command, and selects the template type of the module and the corresponding template type parameter from the configuration file to generate the template parameter; reading a code template file in a corresponding module template type subdirectory from a code template file catalogue, and replacing a preset placeholder in a code template file name by using an input template parameter; based on the extension type of the code template file, the execution module processes the command.
According to the technical scheme provided by the embodiment of the invention, the problems that the existing command line scaffold tool cannot delete the existing module codes and the function of modifying the file increment is limited can be solved.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives can occur depending upon design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.