Invention content
The present invention in order to the code redundancy phenomenon and development efficiency that overcome the exploitation of rear end in the prior art existing are low and
The problem of development cycle is long provides a kind of back-end code generation method and system based on template.
On the one hand, the present invention provides a kind of back-end code generation method based on template, including:
S1, the business demand provided according to user obtain the business module that the business demand includes, from pre-set
The corresponding service template of the business module is inquired in template library;
S2, when inquiring the corresponding service template of the business module, preset template is utilized to import grammer will
The service template imports back-end code editing interface, generates the corresponding back-end code of the business demand.
Preferably, it is further included after the step S2:
S3 obtains the corresponding target service of the business demand, and the corresponding back-end code of the business demand is packaged into
The corresponding target template of the target service, by the mark of the target service and the target template associated storage in the mould
In plate library.
Preferably, it is further included after the step S3:
S4 receives request of the user to the target service, it is corresponding that the target service is obtained from the template library
The template content of target template obtains the function module included in the template content, is corresponded to and called according to the function module
Pre-set analytics engine parses the template content, and analysis result is fed back to the use using the analytics engine
Family.
Preferably, the template content is parsed using the analytics engine described in step S4 to further comprise:
The template content is parsed using Freemarker engines, obtains corresponding JSON arrays;Drawn using the parsing
The parsing JSON arrays are held up, and the data source types in the template content call corresponding data source parser to institute
It states JSON arrays to be parsed, obtains analysis result.
Preferably, the corresponding service template of the business module is inquired described in step S1 from pre-set template library
Further comprise:
Obtain the identification information of the business module, inquired from pre-set database according to the identification information with
The identical template identification of the identification information obtains corresponding service template according to the template identification.
Preferably, the step S2 is further included:When not inquiring the corresponding service template of the business module, journey is obtained
The service code is packaged into the corresponding business of the business module by sequence person according to the service code of the business module editor
Template, by the identification information of the business module and the service template associated storage in the template library.
On the one hand, the present invention provides a kind of back-end code generation system based on template, including:
Template query module, the business demand for being provided according to user obtain the business mould that the business demand includes
Block inquires the corresponding service template of the business module from pre-set template library;
Code generation module, for when inquiring the corresponding service template of the business module, utilization to be preset
Template imports grammer and the service template is imported back-end code editing interface, generates the business demand corresponding rear end generation
Code.
Preferably, it further includes:
Encapsulation storage module, it is for obtaining the corresponding target service of the business demand, the business demand is corresponding
Back-end code is packaged into the corresponding target template of the target service, and the mark of the target service and the target template are closed
Connection is stored in the template library.
Preferably, it further includes:
Template parsing module, for receiving request of the user to the target service, from the template library described in acquisition
The template content of the corresponding target template of target service, obtains the function module included in the template content, according to the work(
Energy module calls corresponding analytics engine, and the template content is parsed, and analysis result is fed back to using the analytics engine
The user.
On the one hand, the present invention provides a kind of equipment of the back-end code generation method based on template, including:
At least one processor;And
At least one processor being connect with the processor communication, wherein:
The memory is stored with the program instruction that can be performed by the processor, and the processor calls described program to refer to
It enables and is able to carry out any of the above-described method.
A kind of back-end code generation method and system based on template provided by the invention, the business need provided according to user
It asks and obtains the business module that business demand includes, the corresponding service template of inquiry business module from pre-set template library;
When inquiring the corresponding service template of business module, import grammer using preset template and service template is imported into rear end
Code Edit interface, you can the corresponding back-end code of generation business demand.After this method is effectively prevented by the multiplexing of template
Code redundancy phenomenon in the presence of the exploitation of end, improves whole development efficiency to a certain extent;Simultaneously by importing front end
Template in template library is conducive to developer and is tested while back-end code is write, without recompilating and issuing,
Effectively shorten the whole development cycle.
Specific embodiment
With reference to the accompanying drawings and examples, the specific embodiment of the present invention is described in further detail.Implement below
Example is used to illustrate the present invention, but be not limited to the scope of the present invention.
Fig. 1 is a kind of overall flow schematic diagram of back-end code generation method based on template of the embodiment of the present invention, such as
Shown in Fig. 1, the present invention provides a kind of back-end code generation method based on template, including:
S1, the business demand provided according to user obtain the business module that the business demand includes, from pre-set
The corresponding service template of the business module is inquired in template library;
S2, when inquiring the corresponding service template of the business module, preset template is utilized to import grammer will
The service template imports back-end code editing interface, generates the corresponding back-end code of the business demand.
Specifically, during system development, developer obtains the business demand that user provides, and developer is by industry
In business demand input system, system analyzes the business module that business demand includes according to business demand, then from pre-set
The corresponding service template of inquiry business module in template library.Wherein, pre-set template library be front end data library, developer
In history development process, corresponding back-end code is write, and back-end code is packaged into business mould for different business demand
Plate is stored in pre-set template library.
Further, it when inquiring the corresponding service template of business module in pre-set template library, then utilizes
Preset template imports grammer and the service template inquired is imported back-end code editing interface, i.e., need not be directed to above-mentioned industry
Business module rewrites code again, and only needs to write the corresponding mould of above-mentioned business module using preset template importing grammer
Plate imports code, you can the corresponding back-end code of generation business demand.Wherein, template, which imports grammer, is set in advance by developer
Fixed, the specific manifestation form that template imports grammer can be configured according to actual demand, be not specifically limited herein.Example
Such as, the specific manifestation form for the grammer that template imports can be:
Wherein, type represents the type of template;Name represents the title of template, passes through the type of template and the title of template
Unique mark is carried out to template.
Above method step in order to better understand is now illustrated with following examples:
For example, in house property system, the business demand that user provides is:The newly-increased source of houses band amount of seeing is sent out in the form of mail
User is given, can analyze the business demand for the business demand system includes two business modules, respectively:(1) it obtains
Take the newly-increased source of houses band amount of seeing;(2) user is sent in the form of mail.On this basis, according to above-mentioned two business module, from
The corresponding service template of above-mentioned two business module is inquired in pre-set template library.If it was realized in history development process
Above-mentioned two business module then then preserves the corresponding service template of above-mentioned two business module in pre-set template library.
When inquiring the corresponding service template of above-mentioned two business module, then write using preset template grammar and import generation
Code, so as to which the corresponding service template of above-mentioned two business module is imported back-end code editing interface, you can be organized into above-mentioned industry
The corresponding back-end code of business demand.
A kind of back-end code generation method based on template provided by the invention is obtained according to the business demand that user provides
The business module that business demand includes, the corresponding service template of inquiry business module from pre-set template library;Work as inquiry
During service template corresponding to business module, import grammer using preset template and service template is imported into back-end code volume
Editing interface, you can the corresponding back-end code of generation business demand.This method effectively prevents rear end by the multiplexing of template and develops
In the presence of code redundancy phenomenon, improve whole development efficiency to a certain extent;Simultaneously by importing front-end template library
In template, be conducive to developer and tested while back-end code is write, without recompilating and issuing, effectively contract
The short whole development cycle.
Based on any of the above-described embodiment, a kind of back-end code generation method based on template is provided, after the step S2
It further includes:S3 obtains the corresponding target service of the business demand, and the corresponding back-end code of the business demand is packaged into institute
The corresponding target template of target service is stated, by the mark of the target service and the target template associated storage in the template
In library.
Specifically, based on the above technical solution, after the corresponding back-end code of above-mentioned business demand is generated,
For the ease of being subsequently multiplexed to the corresponding back-end code of the business demand, in the present embodiment, determined according to the business demand
The corresponding target service of the business demand, and obtain the corresponding service identification of target service;It is simultaneously that the business demand is corresponding
Back-end code is packaged into the corresponding target template of target service, and most the mark of target service and target template associated storage exist at last
In pre-set template library.
Further, in subsequent development process, when developer need to write back-end code for new business demand
When, if can be directly using advance there are above-mentioned target service, developer in the business module that new business demand includes
The template of setting imports grammer and the corresponding target template of above-mentioned target service is imported from template library, you can realizes above-mentioned target mould
The multiplexing of plate.
A kind of back-end code generation method based on template provided by the invention, in generation business demand corresponding rear end generation
After code, the corresponding back-end code of business demand is packaged into template correspondence and is stored in pre-set template library, convenient for exploitation
Personnel are multiplexed the corresponding back-end code of the business demand during subsequent development, are conducive to improve development efficiency.
Based on any of the above-described embodiment, a kind of back-end code generation method based on template is provided, after the step S3
It further includes:S4 receives request of the user to the target service, the corresponding mesh of the target service is obtained from the template library
The template content of template is marked, obtains the function module included in the template content, is corresponded to and is called in advance according to the function module
The analytics engine first set parses the template content, and analysis result is fed back to the user using the analytics engine.
Specifically, on the basis of the corresponding target template of above-mentioned target service is stored in pre-set template library,
When user initiates request for above-mentioned target service, system receives request of the user to target service, and from pre-set
The corresponding target template of target service is obtained in template library, and then obtains the corresponding template content of target template.Wherein in template
It can be HTML or XML or JSON texts to hold, and can also include Freemarker masterplate codes, be not specifically limited herein.
Further, in the present embodiment, the corresponding template content of each template in pre-set template library be by
It is write according to uniform traffic logic, wherein uniform traffic logic for example can be:Step 1: processing required parameter and verification
User right;Step 2: obtain data from each data source;Step 3: it according to business logic processing data and is organized into certain
Form etc..Wherein step 1 correspondence is accomplished that the function of initialization;Step 2 is accomplished that the function of data acquisition;Step 3
It is accomplished that the function of data processing.I.e. each template content corresponds to multiple function modules, and can be each in compiling procedure
Separator is set between a function module, in order to be separated to each function module.
Based on the above technical solution, in the present embodiment, according to the separation in the corresponding template content of target service
Symbol obtains function module wherein included, i.e., template content being realized, cutting is multiple function modules according to specific function.No
Same function module needs different analytics engines to parse it, therefore, for the function module calling pair of above-mentioned acquisition
The analytics engine answered, recycles corresponding analytics engine to parse each function module one by one, finally realizes entire template
The parsing of content obtains corresponding analysis result, and analysis result is fed back to user, i.e., the request of user is responded.
Wherein, analytics engine is pre-set for each function module, and is prestored in the database, so, in processing not
With service request when, for identical function module, corresponding analytics engine can be called to be parsed from database, i.e.,
Realize the multiplexing of analytics engine.
A kind of back-end code generation method based on template provided by the invention, in request of the processing user to target service
When, the template content of the corresponding target template of target service can be obtained directly from template library, without recompilating and issuing,
Effectively shorten the whole development cycle;The function module included in template content is obtained simultaneously, is corresponded to and adjusted according to function module
Template content is parsed with pre-set analytics engine, the multiplexing of analytics engine is effectively realized, further improves
Whole development efficiency.
Based on any of the above-described embodiment, a kind of back-end code generation method based on template is provided, it is sharp described in step S4
The template content is parsed with the analytics engine to further comprise:The template content is parsed using Freemarker engines,
Obtain corresponding JSON arrays;The JSON arrays, and the number in the template content are parsed using the analytics engine
Corresponding data source parser is called to parse the JSON arrays according to Source Type, obtain analysis result.
Specifically, it is above-mentioned using analytics engine parsing template content the specific implementation process is as follows:
Preliminary Analysis is carried out to template content first with Freemarker engines, the spy of numerical value will be represented in template content
Different character resolution obtains the corresponding JSON arrays of template content into specific numerical value.On this basis, above-mentioned acquisition is utilized
Each function module corresponding analytics engine parsing JSON arrays, in resolving, while obtain in template content and include
Data source types, and corresponding data source parser is called to carry out each element in JSON arrays according to data source types
Parsing, finally obtains analysis result, while can store analysis result in the mapping table in the form of key-value pair.In addition,
In other embodiment, when carrying out Preliminary Analysis to template content, other than calling Freemarker engines, it may call upon
Velocity engines can be configured according to actual demand, be not specifically limited herein.
A kind of back-end code generation method based on template provided by the invention, in request of the processing user to target service
When, the template content of the corresponding target template of target service is obtained from template library, and tentatively solve using Freemarker engines
Template content is analysed, obtains corresponding JSON arrays, JSON arrays, and the data in template content are parsed using analytics engine
Source Type calls corresponding data source parser to parse JSON arrays, finally obtains analysis result, effectively realizes pair
The parsing of template content, and the multiplexing of analytics engine is effectively realized, further improve whole development efficiency.
Based on any of the above-described embodiment, provide a kind of back-end code generation method based on template, described in step S1 from
The corresponding service template of the business module is inquired in pre-set template library to further comprise:Obtain the business module
Identification information inquires the template mark identical with the identification information according to the identification information from pre-set database
Know, corresponding service template is obtained according to the template identification.
Specifically, in pre-set template library, for each template wherein stored, each template of associated storage
Corresponding template identification, template identification includes template type and template name, by template type and template name to each mould
Plate carries out unique mark.On this basis, when need from pre-stored database the corresponding business mould of inquiry business module
During plate, detailed process is as follows:The identification information of business module is obtained first, further according to identification information from pre-set database
The middle inquiry template identification identical with identification information, corresponding service template is obtained further according to template identification.
In addition, in pre-set template library, it, can be with each mould of associated storage for each template wherein stored
Corresponding template general introduction of plate etc., can be configured according to actual demand, be not specifically limited herein.
A kind of back-end code generation method based on template provided by the invention, to each in pre-set template library
Module carries out unique mark, in the corresponding service template of inquiry business module, can be inquired from pre-set database
The template identification identical with the identification information of business module obtains corresponding service template further according to template identification, effectively realizes
The multiplexing of template avoids the code redundancy phenomenon in the presence of the exploitation of rear end, improves whole exploitation to a certain extent
Efficiency.
Based on any of the above-described embodiment, a kind of back-end code generation method based on template is provided, the step S2 is also wrapped
It includes:When not inquiring the corresponding service template of the business module, industry of the programmer according to the business module editor is obtained
Business code, the corresponding service template of the business module is packaged by the service code, and the mark of the business module is believed
Breath and the service template associated storage are in the template library.
Specifically, the business demand provided according to user analyzes the business module that business demand includes, then is set from advance
The corresponding service template of inquiry business module in the template library put, when not inquiring the corresponding service template of business module, journey
Sequence person then needs to write corresponding service code according to business module.On this basis, system acquisition procedure person is according to business module
The service code of editor, and service code is packaged into the corresponding service template of business module, and the mark of business module is believed
Breath is used as template identification, and by template identification and service template associated storage in pre-set template library, so as to be conducive to
Subsequently service template is multiplexed.
For example, common service template includes initialization template, data acquisition template and data processing template, and certain industry
Business demand may include following business module:It needs to export data processed result with mail he.If at this time in template library not
There are the corresponding service templates of above-mentioned business module, then programmer need to write the corresponding service code of above-mentioned business module, and incite somebody to action
Service code is packaged into the corresponding service template of above-mentioned business module, and the identification information of above-mentioned business module and service template are closed
Connection is stored in template library.
A kind of back-end code generation method based on template provided by the invention is analyzed according to the business demand that user provides
Go out the business module that business demand includes, then the corresponding service template of inquiry business module from pre-set template library, when
When not inquiring the corresponding service template of business module, service code of the programmer according to business module editor is obtained, by business
Code wrap is into the corresponding service template of business module, by the identification information of business module and service template associated storage in template
In library, be conducive to subsequently realize the multiplexing of template, effectively prevent the code redundancy phenomenon in the presence of the exploitation of rear end, certain journey
Whole development efficiency is improved on degree;Simultaneously by the way that template is stored in front-end template library, be conducive to developer and compiling
It is tested while writing back-end code, without recompilating and issuing, effectively shortens the whole development cycle.
Fig. 2 is that a kind of back-end code based on template of the embodiment of the present invention generates the overall structure diagram of system, such as
Shown in Fig. 2, the present invention provides a kind of back-end code generation system based on template, including:
Template query module 1, the business demand for being provided according to user obtain the business mould that the business demand includes
Block inquires the corresponding service template of the business module from pre-set template library;
Code generation module 2, for when inquiring the corresponding service template of the business module, utilization to be preset
Template imports grammer and the service template is imported back-end code editing interface, generates the business demand corresponding rear end generation
Code.
Specifically, the present invention provides a kind of back-end code generation system based on template, including template query module 1 and generation
Code generation module 2 realizes the back-end code generation method based on template in any of the above-described embodiment by each module, specific real
It is now as follows:
During system development, developer obtains the business demand that user provides, and developer is by business demand
Input module enquiry module 1, module polls module 1 analyze the business module that business demand includes according to business demand, then from
The corresponding service template of inquiry business module in pre-set template library.Wherein, pre-set template library is front end data
Library, developer write corresponding back-end code, and back-end code is sealed in history development process, for different business demand
Service template is dressed up to be stored in pre-set template library.
Further, when template query module 1 inquires the corresponding business of business module in pre-set template library
During template, code generation module 2 then imports grammer using preset template and the service template inquired is imported rear end generation
Code editing interface that is, without rewriting code again for above-mentioned business module, and only needs to import using preset template
Grammer writes the corresponding template of above-mentioned business module and imports code, you can the corresponding back-end code of generation business demand.Wherein, mould
Plate import grammer be it is preset by developer, template import grammer specific manifestation form can according to actual demand into
Row setting, is not specifically limited herein.For example, the specific manifestation form for the grammer that template imports can be:
Wherein, type represents the type of template;Name represents the title of template, passes through the type of template and the title of template
Unique mark is carried out to template.
A kind of back-end code generation system based on template provided by the invention, obtains according to the business demand that user provides
The business module that business demand includes, the corresponding service template of inquiry business module from pre-set template library;Work as inquiry
During service template corresponding to business module, import grammer using preset template and service template is imported into back-end code volume
Editing interface, you can the corresponding back-end code of generation business demand.This method effectively prevents rear end by the multiplexing of template and develops
In the presence of code redundancy phenomenon, improve whole development efficiency to a certain extent;Simultaneously by importing front-end template library
In template, be conducive to developer and tested while back-end code is write, without recompilating and issuing, effectively contract
The short whole development cycle.
Based on any of the above-described embodiment, a kind of back-end code generation system based on template is provided, is further included:Sealed storage
The corresponding back-end code of the business demand for obtaining the corresponding target service of the business demand, is packaged into institute by module 3
The corresponding target template of target service is stated, by the mark of the target service and the target template associated storage in the template
In library.
Specifically, based on the above technical solution, to generate above-mentioned business demand in code generation module 2 corresponding
After back-end code, for the ease of being subsequently multiplexed to the corresponding back-end code of the business demand, in the present embodiment, envelope is utilized
Dress memory module 3 determines the corresponding target service of the business demand, and obtain the corresponding industry of target service according to the business demand
Business mark;The corresponding back-end code of the business demand is packaged into the corresponding target template of target service simultaneously, most target at last
The mark and target template associated storage of business are in pre-set template library.
Further, in subsequent development process, when developer need to write back-end code for new business demand
When, if can be directly using advance there are above-mentioned target service, developer in the business module that new business demand includes
The template of setting imports grammer and the corresponding target template of above-mentioned target service is imported from template library, you can realizes above-mentioned target mould
The multiplexing of plate.
A kind of back-end code generation system based on template provided by the invention, in generation business demand corresponding rear end generation
After code, the corresponding back-end code of business demand is packaged into template correspondence and is stored in pre-set template library, convenient for exploitation
Personnel are multiplexed the corresponding back-end code of the business demand during subsequent development, are conducive to improve development efficiency.
Based on any of the above-described embodiment, a kind of back-end code generation system based on template is provided, is further included:Template parses
Module 4 for receiving request of the user to the target service, obtains the corresponding mesh of the target service from the template library
The template content of template is marked, obtains the function module included in the template content, is called according to the function module corresponding
Analytics engine parses the template content, and analysis result is fed back to the user using the analytics engine.
Specifically, on the basis of the corresponding target template of above-mentioned target service is stored in pre-set template library,
When user initiates request for above-mentioned target service, request of the user to target service is received using template parsing module 4, and
The corresponding target template of target service is obtained from pre-set template library, and then is obtained in the corresponding template of target template
Hold.Wherein template content can be HTML or XML or JSON texts, can also include Freemarker masterplate codes, herein not
It is specifically limited.
Further, in the present embodiment, the corresponding template content of each template in pre-set template library be by
It is write according to uniform traffic logic, wherein uniform traffic logic for example can be:Step 1: processing required parameter and verification
User right;Step 2: obtain data from each data source;Step 3: it according to business logic processing data and is organized into certain
Form etc..Wherein step 1 correspondence is accomplished that the function of initialization;Step 2 is accomplished that the function of data acquisition;Step 3
It is accomplished that the function of data processing.I.e. each template content corresponds to multiple function modules, and can be each in compiling procedure
Separator is set between a function module, in order to be separated to each function module.
Based on the above technical solution, it is corresponding according to target service using template parsing module 4 in the present embodiment
Separator in template content obtains function module wherein included, i.e., template content being realized, cutting is according to specific function
Multiple function modules.Different function modules needs different analytics engines to parse it, therefore, for above-mentioned acquisition
Function module calls corresponding analytics engine, corresponding analytics engine is recycled to parse each function module one by one, most
The parsing of entire template content is realized eventually, obtains corresponding analysis result, and analysis result is fed back into user, i.e., to user's
Request is responded.Wherein, analytics engine is pre-set for each function module, and is prestored in the database,
So when handling different service requests, for identical function module, corresponding parsing can be called to draw from database
It holds up and is parsed, that is, realize the multiplexing of analytics engine.
A kind of back-end code generation system based on template provided by the invention, in request of the processing user to target service
When, the template content of the corresponding target template of target service can be obtained directly from template library, without recompilating and issuing,
Effectively shorten the whole development cycle;The function module included in template content is obtained simultaneously, is corresponded to and adjusted according to function module
Template content is parsed with pre-set analytics engine, the multiplexing of analytics engine is effectively realized, further improves
Whole development efficiency.
Fig. 3 shows a kind of structure diagram of the equipment of back-end code generation method based on template of the embodiment of the present invention.
Reference Fig. 3, the equipment of the back-end code generation method based on template, including:Processor (processor) 31, memory
(memory) 32 and bus 33;Wherein, the processor 31 and memory 32 complete mutual communication by the bus 33;
The processor 31 is used to call the program instruction in the memory 32, to perform the side that above-mentioned each method embodiment is provided
Method, such as including:The business demand provided according to user obtains the business module that business demand includes, from pre-set template
The corresponding service template of inquiry business module in library;When inquiring the corresponding service template of business module, using presetting
Template import grammer service template imported into back-end code editing interface, the corresponding back-end code of generation business demand.
The present embodiment discloses a kind of computer program product, and the computer program product includes being stored in non-transient calculating
Computer program on machine readable storage medium storing program for executing, the computer program include program instruction, when described program instruction is calculated
When machine performs, computer is able to carry out the method that above-mentioned each method embodiment is provided, such as including:The industry provided according to user
Business demand obtains the business module that business demand includes, the corresponding business mould of inquiry business module from pre-set template library
Plate;When inquiring the corresponding service template of business module, import grammer using preset template and import service template
Back-end code editing interface, the corresponding back-end code of generation business demand.
The present embodiment provides a kind of non-transient computer readable storage medium storing program for executing, the non-transient computer readable storage medium storing program for executing
Computer instruction is stored, the computer instruction makes the computer perform the method that above-mentioned each method embodiment is provided, example
Such as include:The business demand provided according to user obtains the business module that business demand includes, from pre-set template library
The corresponding service template of inquiry business module;When inquiring the corresponding service template of business module, preset mould is utilized
Plate imports grammer and service template is imported back-end code editing interface, the corresponding back-end code of generation business demand.
One of ordinary skill in the art will appreciate that:Realizing all or part of step of above method embodiment can pass through
The relevant hardware of program instruction is completed, and aforementioned program can be stored in a computer read/write memory medium, the program
When being executed, step including the steps of the foregoing method embodiments is performed;And aforementioned storage medium includes:ROM, RAM, magnetic disc or light
The various media that can store program code such as disk.
The embodiments such as the equipment of back-end code generation method based on template described above are only schematical,
Described in the unit that illustrates as separating component may or may not be physically separate, to be shown as unit portion
Part may or may not be physical unit, you can be located at a place or can also be distributed to multiple network lists
In member.Some or all of module therein can be selected according to the actual needs to realize the purpose of this embodiment scheme.This
Field those of ordinary skill is not in the case where paying performing creative labour, you can to understand and implement.
Through the above description of the embodiments, those skilled in the art can be understood that each embodiment can
It is realized by the mode of software plus required general hardware platform, naturally it is also possible to pass through hardware.Based on such understanding, on
Technical solution is stated substantially in other words to embody the part that the prior art contributes in the form of software product, it should
Computer software product can store in a computer-readable storage medium, such as ROM/RAM, magnetic disc, CD, including several fingers
It enables and (can be personal computer, server or the network equipment etc.) so that computer equipment is used to perform each implementation
Method described in certain parts of example or embodiment.
Summary, a kind of back-end code generation method and system based on template provided by the invention, carries according to user
The business demand of confession obtains the business module that business demand includes, and inquiry business module is corresponding from pre-set template library
Service template;When inquiring the corresponding service template of business module, grammer is imported by business mould using preset template
Plate imports back-end code editing interface, you can the corresponding back-end code of generation business demand.This method is multiplexed with by template
Effect avoids the code redundancy phenomenon in the presence of the exploitation of rear end, improves whole development efficiency to a certain extent;Lead to simultaneously
The template imported in front-end template library is crossed, is conducive to developer and is tested while back-end code is write, without again
Compiling and publication, effectively shorten the whole development cycle.
Finally, the present processes are only preferable embodiment, are not intended to limit the scope of the present invention.It is all
Within the spirit and principles in the present invention, any modification, equivalent replacement, improvement and so on should be included in the protection of the present invention
Within the scope of.