Movatterモバイル変換


[0]ホーム

URL:


CN112905164B - Project code processing method and device - Google Patents

Project code processing method and device
Download PDF

Info

Publication number
CN112905164B
CN112905164BCN201911229763.2ACN201911229763ACN112905164BCN 112905164 BCN112905164 BCN 112905164BCN 201911229763 ACN201911229763 ACN 201911229763ACN 112905164 BCN112905164 BCN 112905164B
Authority
CN
China
Prior art keywords
template
module
file
code
type
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201911229763.2A
Other languages
Chinese (zh)
Other versions
CN112905164A (en
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.)
Beijing Wodong Tianjun Information Technology Co Ltd
Original Assignee
Beijing Wodong Tianjun Information Technology 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 Beijing Wodong Tianjun Information Technology Co LtdfiledCriticalBeijing Wodong Tianjun Information Technology Co Ltd
Priority to CN201911229763.2ApriorityCriticalpatent/CN112905164B/en
Publication of CN112905164ApublicationCriticalpatent/CN112905164A/en
Application grantedgrantedCritical
Publication of CN112905164BpublicationCriticalpatent/CN112905164B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Classifications

Landscapes

Abstract

The invention discloses a project code processing method and device, and relates to the technical field of computers. One embodiment of the method comprises the steps that a receiving module processes a command, and a module template type and a corresponding template type parameter are selected 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. Therefore, the implementation mode of the invention can solve the problems that the existing command line scaffold tool can not delete the existing module codes and the function of modifying the file increment is limited.

Description

Project code processing method and device
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and an apparatus for processing project codes.
Background
Initial code for a project is typically automatically generated using a command line scaffold tool (i.e., CLI tool) at the beginning of the project, i.e., a command is automatically created by a developer, reducing a lot of effort and error rate.
In the process of implementing the present invention, the inventor finds that at least the following problems exist in the prior art:
In existing code engineering, command line scaffold tools can only automatically add new module codes, and do not support deletion of existing module codes. Also, the functionality in incremental modification of existing files is limited, supporting only specific parts of certain code files that are specific to modification. In addition, the difficulty of the user in expanding the module command adding self-line is very high.
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.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
FIG. 1 is a schematic diagram of a main flow of an item code processing method according to a first embodiment of the present invention
FIG. 2 is a schematic diagram of a framework of an item code processing method according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of the main flow of an item code processing method according to a second embodiment of the present invention;
FIG. 4 is a schematic diagram of the main flow of an item code processing method according to a third embodiment of the present invention;
FIG. 5 is a schematic diagram of the main modules of an item code processing apparatus according to an embodiment of the present invention;
FIG. 6 is an exemplary system architecture diagram in which embodiments of the present invention may be applied;
Fig. 7 is a schematic diagram of a computer system suitable for use in implementing an embodiment of the invention.
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.

Claims (9)

The receiving module processes the command, selects the template type of the module and the corresponding template type parameter from the configuration file to generate the template parameter, and comprises the following steps: 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;
The receiving module is used for processing the command, selecting the template type of the module and the corresponding template type parameter from the configuration file to generate the template parameter, and comprises the following steps: 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; 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;
CN201911229763.2A2019-12-042019-12-04Project code processing method and deviceActiveCN112905164B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN201911229763.2ACN112905164B (en)2019-12-042019-12-04Project code processing method and device

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN201911229763.2ACN112905164B (en)2019-12-042019-12-04Project code processing method and device

Publications (2)

Publication NumberPublication Date
CN112905164A CN112905164A (en)2021-06-04
CN112905164Btrue CN112905164B (en)2024-10-18

Family

ID=76111222

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN201911229763.2AActiveCN112905164B (en)2019-12-042019-12-04Project code processing method and device

Country Status (1)

CountryLink
CN (1)CN112905164B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN115098076B (en)*2022-07-182024-12-06扬州航盛科技有限公司 A code generation method for Android system
CN115437657A (en)*2022-09-012022-12-06深圳前海环融联易信息科技服务有限公司Service starting method, device, equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN108228161A (en)*2016-12-142018-06-29中国航空工业集团公司西安航空计算技术研究所A kind of system and method for expansion structure order line
CN110309498A (en)*2019-07-052019-10-08广东铭太信息科技有限公司 Implementation method and device for generating review report based on parameters, and method for generating review report using same

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US20040216138A1 (en)*2001-04-202004-10-28Microsoft CorporationMethod and system for processing input from a command line interface
JP2005141380A (en)*2003-11-052005-06-02Matsushita Electric Ind Co Ltd Template compilation method
US20050251786A1 (en)*2004-05-072005-11-10International Business Machines CorporationSystem and method for dynamic software installation instructions
US10037317B1 (en)*2013-07-172018-07-31Yseop SaTechniques for automatic generation of natural language text
DE102014210854A1 (en)*2014-06-062015-12-17Oliver Rode A computer-implemented method and signal sequence for a program for reusing executable software configurations for software systems, as well as a computer system and a computer program with program code for performing the method
CN110362295A (en)*2019-05-272019-10-22深圳壹账通智能科技有限公司Code generating method, device, computer installation and storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN108228161A (en)*2016-12-142018-06-29中国航空工业集团公司西安航空计算技术研究所A kind of system and method for expansion structure order line
CN110309498A (en)*2019-07-052019-10-08广东铭太信息科技有限公司 Implementation method and device for generating review report based on parameters, and method for generating review report using same

Also Published As

Publication numberPublication date
CN112905164A (en)2021-06-04

Similar Documents

PublicationPublication DateTitle
CN112947992B (en)Code version management method and device
US10572546B2 (en)Information processing apparatus, document display method, document display system, and medium
CN110019350A (en)Data query method and apparatus based on configuration information
US11487595B2 (en)API adapter creation device, API adapter creation method, and API adapter creation program
CN113377653B (en)Method and device for generating test cases
CN112835568B (en) A project construction method and device
CN109194714B (en) A copywriting push method, device, terminal device and storage medium
EP2972827B1 (en)Collaborative editing
CN110647327B (en)Method and device for dynamic control of user interface based on card
CN112947912A (en)Method and device for generating code, electronic equipment and storage medium
CN113382083A (en)Webpage screenshot method and device
WO2023092580A1 (en)Page display method and apparatus, storage medium, and electronic device
CN112905164B (en)Project code processing method and device
CN113742321B (en)Data updating method and device
CN113495730B (en) Resource package generation and parsing method and device
CN116069725A (en)File migration method, device, apparatus, medium and program product
CN113535221B (en)Method and device for managing application version
CN110543520B (en)Data migration method and device
CN110096392B (en)Method and device for outputting information
CN110858240A (en)Front-end module loading method and device
CN111782995B (en)Graphics paging loading method and device
CN111221610B (en)Page element acquisition method and device
AU2018313995B2 (en)Systems and methods for providing globalization features in a service management application interface
CN112905182B (en) A method and device for data analysis
CN112965747B (en)Method, apparatus, device and computer readable medium for mining code loopholes

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant

[8]ページ先頭

©2009-2025 Movatter.jp