CN117270830A - Intelligent generation method and system for back-end codes based on front-end visual configuration - Google Patents

Intelligent generation method and system for back-end codes based on front-end visual configuration Download PDF

Info

Publication number
CN117270830A
CN117270830A CN202311415253.0A CN202311415253A CN117270830A CN 117270830 A CN117270830 A CN 117270830A CN 202311415253 A CN202311415253 A CN 202311415253A CN 117270830 A CN117270830 A CN 117270830A
Authority
CN
China
Prior art keywords
code
data
function
file
service
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311415253.0A
Other languages
Chinese (zh)
Inventor
王家文
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Dalian Jiabaixun Internet Of Things Industry Co ltd
Original Assignee
Dalian Jiabaixun Internet Of Things Industry 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 Dalian Jiabaixun Internet Of Things Industry Co ltd filed Critical Dalian Jiabaixun Internet Of Things Industry Co ltd
Priority to CN202311415253.0A priority Critical patent/CN117270830A/en
Publication of CN117270830A publication Critical patent/CN117270830A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/31Programming languages or programming paradigms
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/34Graphical or visual programming
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Human Computer Interaction (AREA)
  • Stored Programmes (AREA)

Abstract

The invention discloses a method and a system for intelligently generating a back-end code based on front-end visual configuration, wherein the method comprises the following steps: packaging a business processing process in a back-end development process into a public method, and establishing a template file by using necessary and repeated code blocks; receiving form completion back-end code business logic data configured by a user through a front-end UI visual interface; performing integrity check on the received data, and starting a code data generation program, wherein the code data generation program generates table operations of corresponding services based on the template file and the public method to generate code data; the file operating system writes the code data to the specified code file. The intelligent generation system of the back-end code based on the front-end visual configuration, which is independently developed, can improve the development efficiency of the front-end code.

Description

Intelligent generation method and system for back-end codes based on front-end visual configuration
Technical Field
The invention relates to the technical field of intelligent code development, in particular to a method and a system for intelligently generating a back-end code based on front-end visual configuration.
Background
The back-end development mainly enables the server, the application and the database to interact with each other, and needs to consider how to realize functions, data access, platform stability and performance and the like. In short, the main work of the back-end engineer is to coordinate the interaction prototype with the front-end engineer according to the requirement document of the product function point, and make the most effective and simplified scheme to realize the product function point.
The following result problems exist in the backend code development process: the method codes at the back end of 80% are all in the CURD operation (namely C: create record, U: modify record, R: read query record, D: delete record) of processing database, and in order to guarantee the completeness of the historical data, delete operation is rarely used to Delete the data record in the database, and CURD operation sentence grammar is relatively fixed, so that the back end developer needs to write a great deal of necessary and repeated codes for different business scenes and different data tables, and is liable to waste much effort of the developer, and in the writing process, in order to avoid the error of the table names and field names of the database, the third party tool is often required to be used to link to the database, and the table names and the field names of the corresponding data tables are queried, so that the working efficiency is low, and the loss of the database data caused by the operation of the third party tool is unavoidable.
Disclosure of Invention
In view of this, the invention provides a method and a system for generating back-end codes intelligently based on front-end visual configuration, which firstly packages the common business processing process in the background development process into a common method, establishes templates for necessary and repeated code blocks, and then autonomously develops a back-end code generating system based on front-end visual configuration so as to improve the development efficiency of the front-end codes.
For this purpose, the invention provides the following technical scheme:
the invention discloses a method for intelligently generating a back-end code based on front-end visual configuration, which comprises the following steps:
packaging a business processing process in a back-end development process into a public method, and establishing a template file by using necessary and repeated code blocks;
receiving form completion back-end code business logic data configured by a user through a front-end UI visual interface;
performing integrity check on the received data, and starting a code data generation program, wherein the code data generation program generates table operations of corresponding services based on the template file and the public method to generate code data;
the file operating system writes the code data to the specified code file.
Further, before the user configuration, the method further comprises: according to team code development specifications, the formatting data of various function bodies are configured in the function body formatting file, and the formatting data are copied into the util controller of the app folder through the program file, so that the starting condition of the program can be completed.
Further, the user configured form completion back-end code business logic data includes:
writing a file path of a code, inputting a function method name, remarks in the function method and service types;
the service type is a record service creation, and the user configured form completes the back-end code service logic, and the method further comprises the following steps: a database main table and associated fields of the operation;
the service type is a modified record service, and the user configured form completes the back-end code service logic, and the method further comprises the following steps: the method comprises the steps of operating a database main table, a main table main key and an associated field;
the service type is a read query record service, and the user configured form completes the back-end code service logic, and the method further comprises the following steps: a database main table of operations, a sorting field, a sorting mode, a query field and additional conditions.
Further, generating code data includes:
according to the service type processed by the specified function method, automatically starting a corresponding code generation program;
if the record service is created, uploading function body formatting data for creating the record service from the template file; locating the writing position of annotation information of the formatted data, and automatically generating function annotation information according to the Chinese remarks and associated fields in the function method; positioning a function starting position of formatted data, writing a function name according to the configured information, and calling a public method for checking a Request method in a mode of a method name (); positioning the position of a database operation statement of the formatted data, and automatically generating a table operation for creating a record statement according to the selected data table and the associated field;
if the record service is the modification record service, loading function body formatting data of the modification record service from the template file; locating the writing position of annotation information of the formatted data, and automatically generating function annotation information according to the Chinese remarks and associated fields in the function method; positioning a function starting position of formatted data, writing a function name according to the configured information, and calling a public method for checking a Request method in a mode of a method name (); positioning the position of a database operation statement of the formatted data, and automatically generating a table operation for modifying the record statement according to the selected data table and the associated field;
if the query service is read, loading function body formatting data of the query record service from the template file; locating the writing position of annotation information of the formatted data, and automatically generating function annotation information according to the Chinese remarks and associated fields in the function method; positioning a function starting position of formatted data, writing a function name according to the configured information, and calling a public method for checking a Request method in a mode of a method name (); and locating the position of the database operation statement of the formatted data, and automatically generating a table operation for reading the query record statement according to the selected data table, the associated field and the related database operation condition.
Further, the file operating system writes the code data to the specified code file, comprising:
reading a designated code file according to a file path configured by the front end;
locating the line 1 of the Class type of the code file, typing in a line feed character, and saving the writing format of the code;
and writing the generated code data into a code file to complete intelligent generation of the code.
The invention also discloses a back-end code intelligent generation method based on the front-end visual configuration, wherein the system comprises the following steps:
the template building module is used for packaging the business processing process in the back-end development process into a public method and building a template file from necessary and repeated code blocks;
the configuration receiving module is used for receiving the back-end code business logic data of the form completion configured by the user through the front-end UI visual interface;
the code generation module is used for carrying out integrity check on the received data, starting a code data generation program, and automatically generating table operation of corresponding service based on the template file and the public method by the code data generation program to generate code data;
and the writing module is used for writing the code data into the appointed code file by the file operating system.
Further, the method further comprises the following steps: and the program starting module is used for configuring formatting data of various function bodies in the function body formatting file according to team code development specifications before user configuration, and copying the formatting data into an util controller of the app folder through the program file so as to finish starting conditions of the program.
Further, the user configured form completion back-end code business logic data includes:
writing a file path of a code, inputting a function method name, remarks in the function method and service types;
the service type is a record service creation, and the user configured form completes the back-end code service logic, and the method further comprises the following steps: a database main table and associated fields of the operation;
the service type is a modified record service, and the user configured form completes the back-end code service logic, and the method further comprises the following steps: the method comprises the steps of operating a database main table, a main table main key and an associated field;
the service type is a read query record service, and the user configured form completes the back-end code service logic, and the method further comprises the following steps: a database main table of operations, a sorting field, a sorting mode, a query field and additional conditions.
Further, the code generation module includes:
the starting unit is used for automatically starting the corresponding code generation program according to the service type processed by the specified function method;
the first generating unit is used for loading function body formatted data for creating the record service from the template file if the record service is created; locating the writing position of annotation information of the formatted data, and automatically generating function annotation information according to the Chinese remarks and associated fields in the function method; positioning a function starting position of formatted data, writing a function name according to the configured information, and calling a public method for checking a Request method in a mode of a method name (); positioning the position of a database operation statement of the formatted data, and automatically generating a table operation for creating a record statement according to the selected data table and the associated field;
the second generating unit is used for loading function body formatting data of the modified record service from the template file if the modified record service is the modified record service; locating the writing position of annotation information of the formatted data, and automatically generating function annotation information according to the Chinese remarks and associated fields in the function method; positioning a function starting position of formatted data, writing a function name according to the configured information, and calling a public method for checking a Request method in a mode of a method name (); positioning the position of a database operation statement of the formatted data, and automatically generating a table operation for modifying the record statement according to the selected data table and the associated field;
the third generating unit is used for loading function body formatted data of the query record service from the template file if the query record service is read; locating the writing position of annotation information of the formatted data, and automatically generating function annotation information according to the Chinese remarks and associated fields in the function method; positioning a function starting position of formatted data, writing a function name according to the configured information, and calling a public method for checking a Request method in a mode of a method name (); and locating the position of the database operation statement of the formatted data, and automatically generating a table operation for reading the query record statement according to the selected data table, the associated field and the related database operation condition.
Further, the writing module includes:
the file reading unit is used for reading the designated code file according to the file path configured at the front end;
the locating unit is used for locating the line 1 of the Class type of the code file, typing in a line feed character and storing the writing format of the code;
and the writing unit is used for writing the generated code data into the code file to complete intelligent generation of the code.
The invention has the advantages and positive effects that:
in the development process, through using the back-end code intelligent generation system based on the front-end visual configuration, the research personnel is saved from spending a large amount of time to write necessary and repeated database CURD operation sentences, all operations related to data are selected based on the original data of the database, the problem of field writing errors is avoided, meanwhile, the process that the research personnel is connected with the database through a third-party database management tool is also saved, the working efficiency is improved, the error rate is reduced, the data safety of the database is also improved, a standardized single-table query function is written for example, the back-end personnel is used for writing function bodies and remark information, and through the back-end code intelligent generation system based on the front-end visual configuration, the research personnel only needs to spend 2-3 minutes to complete the writing of codes through the front-end visual configuration page, and the manual writing speed of the research personnel is improved by 5-4 times, and the development efficiency of the research and development team is greatly improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings may be obtained according to the drawings without inventive effort to a person skilled in the art.
FIG. 1 is a flowchart of a method for intelligently generating a back-end code based on a front-end visual configuration in an embodiment of the present invention;
FIG. 2 is a flow chart of the front end configuration code business logic in an embodiment of the present invention;
FIG. 3 is a flowchart of a back-end automatic code generation in an embodiment of the present invention;
fig. 4 is a flowchart of writing generated code data into a file by a back end in an embodiment of the present invention.
Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present invention and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
As shown in fig. 1, in an embodiment of the present invention, a method for intelligently generating a backend code based on a front-end visualization configuration, a main process from configuration to generation of the backend code includes:
s1, a user selects a file path to which a function method is to be added through a front-end UI visual interface;
the UI is simply called User Interface (UI).
The method also comprises the following steps before the user configuration: according to team code development specifications, the formatting data of various function bodies are configured in a function body formatting file, and copied into an util controller (util controller is a Net Core Application framework) of an app folder (Application) through a program file, so that the starting condition of the program can be completed.
S2, the user configures the form to finish the service logic data of the back-end code through the UI interface, and submits the configuration data to the back-end;
s3, the rear end receives the configuration data of the front end, and after the data integrity verification is completed, a code data generating program is started to generate code data;
firstly, common business processing procedures in the back-end development process are packaged into a common method, and necessary and repeated code blocks are built into a template file. The code data generating program generates a table operation of the corresponding service based on the template file and the common method, and generates code data.
S4, the file operating system writes the code data into the specified code file.
The flow of the front-end configuration code service logic is shown in fig. 2, and S2 specifically includes:
s2.1, selecting a file path/input function method name of a written code to finish definition of URL routing;
the URL (Uniform Resource Locator ) is a concise representation of the location and access method of a resource available on the internet, and is the address of a standard resource on the internet.
S2.2, inputting Chinese remarks in the function method;
s2.3, selecting a service type;
if the create record service is selected:
(2.31) selecting a database master table of the operation;
(2.32) selecting an associated field, i.e., a list of table fields to be written to when creating a record;
if the modified record service is selected:
(2.33) selecting a database master table of the operation;
(2.34) selecting a primary table primary key, i.e., when modifying the record, locating the record according to which field;
(2.35) selecting an associated field, i.e. a list of table fields that can be modified during editing;
if the read query record service is selected:
(2.36) selecting a database master table of the operation;
(2.37) selecting a ranking field, i.e. setting the results of the query, ranking with this field;
(2.38) selecting a sorting mode, namely setting the queried result to display in a positive order or a reverse order by a sorting field;
(2.39) selecting a query field, i.e. the selected field information needs to be displayed in the queried record;
(2.310) additional conditions, i.e. in addition to the above configuration, defined query conditions are required;
s2.4, submitting the configured data to the back end.
The flow of the back-end automatic code generation is shown in fig. 3, and S3 specifically includes:
s3.1, receiving service logic data configured by the front end, and automatically starting a corresponding code generation program according to the service type processed by a specified function method;
if it is the creation of the record service:
(3.11) the code generating program loading function body formatting data for creating the record service from the template file;
(3.12) the program locates the annotation information writing position of the formatted data, and automatically generates function annotation information (comprising a function Chinese name and a request body parameter list) according to the Chinese remarks and associated fields in the function method;
(3.13) positioning the program to the function starting position of the formatted data, writing a function name according to the configured information and calling a public method of checking a Request method in a mode of 'method name ()';
(3.14) program locating to the database operation statement location of the formatted data, automatically generating a table operation from the selected data table and associated fields-C: creating a record sentence;
(3.15) transferring the code data generated in (3.12) - (3.14) to the file operating system of S4;
if it is the modified record service:
(3.16) loading function body formatting data for modifying the recording service from the template file;
(3.17) the program locates the annotation information writing position of the formatted data, and automatically generates function annotation information (comprising function Chinese name and request body parameter list annotation) according to the Chinese remarks and associated fields in the function method;
(3.18) program positioning to function starting position of formatted data, writing function name according to configured information and calling public method of Request method check in "method name ()" form
(3.19) the program locates the database operation statement location of the formatted data, automatically generating a table operation-U-based on the selected data table and associated fields: modifying record statements
(3.110) transferring the code data generated in (3.16) - (3.19) to the file operating system of S4.
If it is the read query service:
(3.111) loading function body formatted data of the query record service from the template file;
(3.112) the program locates the annotation information writing position of the formatted data, and automatically generates function annotation information (comprising function Chinese name + request body parameter list + returned field list annotation) according to the Chinese remarks and associated fields in the function method;
(3.113) the program locates the function starting position of the formatted data, writes in the function name according to the configured information and calls the public method of the Request method verification in the form of 'method name ()';
(3.114) the program locates the database operation statement location of the formatted data, automatically generating a table operation-R-based on the selected data table, associated fields and related database operation conditions: reading inquiry record sentences;
(3.115) transferring the code data generated in (3.111) - (3.114) to the file operating system of S4;
the flow of the back end writing the generated code data into the file is shown in fig. 4, and S4 specifically includes:
s4.1, the file operating system reads the appointed code file according to the file path configured at the front end;
s4.2, the file operating system locates to the 1 st line of the code file Class type, keys in a line-changing character and stores the writing format of the code;
and S4.3, the file operating system writes the generated code data into a code file to complete intelligent generation of the code.
In another embodiment, the invention also discloses a back-end code intelligent generation method based on the front-end visual configuration, wherein the system comprises the following steps:
the program starting module is used for configuring formatting data of various function bodies in the function body formatting file according to team code development specifications before user configuration, and copying the formatting data into an util controller of the app folder through the program file, so that starting conditions of the program can be completed;
the template building module is used for packaging the business processing process in the back-end development process into a public method and building a template file from necessary and repeated code blocks;
the configuration receiving module is used for receiving the back-end code business logic data of the form completion configured by the user through the front-end UI visual interface;
the user-configured form completion back-end code service logic data comprises: writing a file path of a code, inputting a function method name, remarks in the function method and service types; the service type is a record service creation, and the user configured form completes the back-end code service logic, and the method further comprises the following steps: a database main table and associated fields of the operation; the service type is a modified record service, and the user configured form completes the back-end code service logic, and the method further comprises the following steps: the method comprises the steps of operating a database main table, a main table main key and an associated field; the service type is a read query record service, and the user configured form completes the back-end code service logic, and the method further comprises the following steps: a database main table of operations, a sorting field, a sorting mode, a query field and additional conditions.
The code generation module is used for carrying out integrity check on the received data, starting a code data generation program, and automatically generating table operation of corresponding service based on the template file and the public method by the code data generation program to generate code data;
wherein, the code generation module includes:
the starting unit is used for automatically starting the corresponding code generation program according to the service type processed by the specified function method;
the first generating unit is used for loading function body formatted data for creating the record service from the template file if the record service is created; locating the writing position of annotation information of the formatted data, and automatically generating function annotation information according to the Chinese remarks and associated fields in the function method; positioning a function starting position of formatted data, writing a function name according to the configured information, and calling a public method for checking a Request method in a mode of a method name (); positioning the position of a database operation statement of the formatted data, and automatically generating a table operation for creating a record statement according to the selected data table and the associated field;
the second generating unit is used for loading function body formatting data of the modified record service from the template file if the modified record service is the modified record service; locating the writing position of annotation information of the formatted data, and automatically generating function annotation information according to the Chinese remarks and associated fields in the function method; positioning a function starting position of formatted data, writing a function name according to the configured information, and calling a public method for checking a Request method in a mode of a method name (); positioning the position of a database operation statement of the formatted data, and automatically generating a table operation for modifying the record statement according to the selected data table and the associated field;
the third generating unit is used for loading function body formatted data of the query record service from the template file if the query record service is read; locating the writing position of annotation information of the formatted data, and automatically generating function annotation information according to the Chinese remarks and associated fields in the function method; positioning a function starting position of formatted data, writing a function name according to the configured information, and calling a public method for checking a Request method in a mode of a method name (); and locating the position of the database operation statement of the formatted data, and automatically generating a table operation for reading the query record statement according to the selected data table, the associated field and the related database operation condition.
And the writing module is used for writing the code data into the appointed code file by the file operating system.
Wherein, write module includes:
the file reading unit is used for reading the designated code file according to the file path configured at the front end;
the locating unit is used for locating the line 1 of the Class type of the code file, typing in a line feed character and storing the writing format of the code;
and the writing unit is used for writing the generated code data into the code file to complete intelligent generation of the code.
The intelligent back-end code generating system based on the front-end visual configuration is suitable for a scene of back-end development by adopting a ThinkPHP technology (the ThinkPHP is a quick and simple lightweight PHP development framework facing to objects), firstly, formatting data of various function bodies are configured in a function body formatting file according to team code development specifications, and the formatting data are copied into an util controller of an app folder through a program file, so that starting conditions of a program can be finished, then the front-end is logged in, and back-end code logic can be configured through a UI visual interface, so that intelligent generation of back-end codes is finished. Taking writing a standardized single-table query function as an example, the back-end personnel can write the function body and remark information in about 10 minutes, and the database is connected by a third-party database manager in order to ensure the correctness of writing parameters, and through the back-end code intelligent generation system based on front-end visual configuration, the research and development personnel can write codes by only taking 2-3 minutes to complete business configuration through a front-end visual configuration page, and the writing speed is 5-4 times higher than the manual writing speed of the research and development personnel, and all operations related to data are selected based on the original data of the database, so that the problem of field writing errors is avoided, meanwhile, the process of connecting the database by using the third-party database manager is omitted, and the data safety of the database is improved while the work efficiency of the research and development personnel is improved.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present invention, and not for limiting the same; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some or all of the technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit of the invention.

Claims (10)

1. The intelligent back-end code generation method based on the front-end visual configuration is characterized by comprising the following steps of:
packaging a business processing process in a back-end development process into a public method, and establishing a template file by using necessary and repeated code blocks;
receiving form completion back-end code business logic data configured by a user through a front-end UI visual interface;
performing integrity check on the received data, and starting a code data generation program, wherein the code data generation program generates table operations of corresponding services based on the template file and the public method to generate code data;
the file operating system writes the code data to the specified code file.
2. The method for intelligently generating the back-end code based on the front-end visual configuration according to claim 1, further comprising, before the user configuration: according to team code development specifications, the formatting data of various function bodies are configured in the function body formatting file, and the formatting data are copied into the util controller of the app folder through the program file, so that the starting condition of the program can be completed.
3. The intelligent back-end code generation method based on front-end visual configuration according to claim 1, wherein the user-configured form completes back-end code business logic data, comprising:
writing a file path of a code, inputting a function method name, remarks in the function method and service types;
the service type is a record service creation, and the user configured form completes the back-end code service logic, and the method further comprises the following steps: a database main table and associated fields of the operation;
the service type is a modified record service, and the user configured form completes the back-end code service logic, and the method further comprises the following steps: the method comprises the steps of operating a database main table, a main table main key and an associated field;
the service type is a read query record service, and the user configured form completes the back-end code service logic, and the method further comprises the following steps: a database main table of operations, a sorting field, a sorting mode, a query field and additional conditions.
4. A method for intelligent generation of back-end code based on front-end visualization configuration according to claim 3, wherein generating code data comprises:
according to the service type processed by the specified function method, automatically starting a corresponding code generation program;
if the record service is created, uploading function body formatting data for creating the record service from the template file; locating the writing position of annotation information of the formatted data, and automatically generating function annotation information according to the Chinese remarks and associated fields in the function method; positioning a function starting position of formatted data, writing a function name according to the configured information, and calling a public method for checking a Request method in a mode of a method name (); positioning the position of a database operation statement of the formatted data, and automatically generating a table operation for creating a record statement according to the selected data table and the associated field;
if the record service is the modification record service, loading function body formatting data of the modification record service from the template file; locating the writing position of annotation information of the formatted data, and automatically generating function annotation information according to the Chinese remarks and associated fields in the function method; positioning a function starting position of formatted data, writing a function name according to the configured information, and calling a public method for checking a Request method in a mode of a method name (); positioning the position of a database operation statement of the formatted data, and automatically generating a table operation for modifying the record statement according to the selected data table and the associated field;
if the query service is read, loading function body formatting data of the query record service from the template file; locating the writing position of annotation information of the formatted data, and automatically generating function annotation information according to the Chinese remarks and associated fields in the function method; positioning a function starting position of formatted data, writing a function name according to the configured information, and calling a public method for checking a Request method in a mode of a method name (); and locating the position of the database operation statement of the formatted data, and automatically generating a table operation for reading the query record statement according to the selected data table, the associated field and the related database operation condition.
5. The method for intelligent generation of back-end code based on front-end visualization configuration according to claim 4, wherein the file operating system writes the code data into the specified code file, comprising:
reading a designated code file according to a file path configured by the front end;
locating the line 1 of the Class type of the code file, typing in a line feed character, and saving the writing format of the code;
and writing the generated code data into a code file to complete intelligent generation of the code.
6. The intelligent back-end code generation method based on the front-end visual configuration is characterized in that the system comprises the following steps:
the template building module is used for packaging the business processing process in the back-end development process into a public method and building a template file from necessary and repeated code blocks;
the configuration receiving module is used for receiving the back-end code business logic data of the form completion configured by the user through the front-end UI visual interface;
the code generation module is used for carrying out integrity check on the received data, starting a code data generation program, and automatically generating table operation of corresponding service based on the template file and the public method by the code data generation program to generate code data;
and the writing module is used for writing the code data into the appointed code file by the file operating system.
7. The back-end code intelligence generation system based on front-end visualization configuration of claim 6, further comprising: and the program starting module is used for configuring formatting data of various function bodies in the function body formatting file according to team code development specifications before user configuration, and copying the formatting data into an util controller of the app folder through the program file so as to finish starting conditions of the program.
8. The intelligent back-end code generation system based on front-end visual configuration of claim 6, wherein the user-configured form completes back-end code business logic data, comprising:
writing a file path of a code, inputting a function method name, remarks in the function method and service types;
the service type is a record service creation, and the user configured form completes the back-end code service logic, and the method further comprises the following steps: a database main table and associated fields of the operation;
the service type is a modified record service, and the user configured form completes the back-end code service logic, and the method further comprises the following steps: the method comprises the steps of operating a database main table, a main table main key and an associated field;
the service type is a read query record service, and the user configured form completes the back-end code service logic, and the method further comprises the following steps: a database main table of operations, a sorting field, a sorting mode, a query field and additional conditions.
9. The back-end code intelligence generation system based on front-end visualization configuration of claim 8, wherein the code generation module comprises:
the starting unit is used for automatically starting the corresponding code generation program according to the service type processed by the specified function method;
the first generating unit is used for loading function body formatted data for creating the record service from the template file if the record service is created; locating the writing position of annotation information of the formatted data, and automatically generating function annotation information according to the Chinese remarks and associated fields in the function method; positioning a function starting position of formatted data, writing a function name according to the configured information, and calling a public method for checking a Request method in a mode of a method name (); positioning the position of a database operation statement of the formatted data, and automatically generating a table operation for creating a record statement according to the selected data table and the associated field;
the second generating unit is used for loading function body formatting data of the modified record service from the template file if the modified record service is the modified record service; locating the writing position of annotation information of the formatted data, and automatically generating function annotation information according to the Chinese remarks and associated fields in the function method; positioning a function starting position of formatted data, writing a function name according to the configured information, and calling a public method for checking a Request method in a mode of a method name (); positioning the position of a database operation statement of the formatted data, and automatically generating a table operation for modifying the record statement according to the selected data table and the associated field;
the third generating unit is used for loading function body formatted data of the query record service from the template file if the query record service is read; locating the writing position of annotation information of the formatted data, and automatically generating function annotation information according to the Chinese remarks and associated fields in the function method; positioning a function starting position of formatted data, writing a function name according to the configured information, and calling a public method for checking a Request method in a mode of a method name (); and locating the position of the database operation statement of the formatted data, and automatically generating a table operation for reading the query record statement according to the selected data table, the associated field and the related database operation condition.
10. The back-end code intelligent generation system based on front-end visualization configuration of claim 9, wherein the writing module comprises:
the file reading unit is used for reading the designated code file according to the file path configured at the front end;
the locating unit is used for locating the line 1 of the Class type of the code file, typing in a line feed character and storing the writing format of the code;
and the writing unit is used for writing the generated code data into the code file to complete intelligent generation of the code.
CN202311415253.0A 2023-10-28 2023-10-28 Intelligent generation method and system for back-end codes based on front-end visual configuration Pending CN117270830A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311415253.0A CN117270830A (en) 2023-10-28 2023-10-28 Intelligent generation method and system for back-end codes based on front-end visual configuration

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311415253.0A CN117270830A (en) 2023-10-28 2023-10-28 Intelligent generation method and system for back-end codes based on front-end visual configuration

Publications (1)

Publication Number Publication Date
CN117270830A true CN117270830A (en) 2023-12-22

Family

ID=89210595

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311415253.0A Pending CN117270830A (en) 2023-10-28 2023-10-28 Intelligent generation method and system for back-end codes based on front-end visual configuration

Country Status (1)

Country Link
CN (1) CN117270830A (en)

Similar Documents

Publication Publication Date Title
CN100498695C (en) Workflow schedule authoring tool
CN109739766B (en) System and method for rapidly building FPGA digital simulation model
CN108762743B (en) Data table operation code generation method and device
CN115617327A (en) Low code page building system, method and computer readable storage medium
US7757025B2 (en) Programmable logic controller peripheral device and program creation method thereof
CN110659018B (en) Method and device for realizing flow engine
CN110543303A (en) Visual business platform
CN108388623B (en) ER relationship generation method and device, computer equipment and storage medium
CN112650766A (en) Database data operation method, system and server
CN112506505A (en) Method for producing program code by code template engine
CN109361628A (en) Message assemble method, device, computer equipment and storage medium
CN102323858B (en) Identify the input method of modification item in input, terminal and system
JP5747698B2 (en) Requirements management support device
JP4477531B2 (en) Data import method and data import apparatus
CN110989999A (en) Code generation method and device, electronic equipment and medium
CN117270830A (en) Intelligent generation method and system for back-end codes based on front-end visual configuration
CN116225902A (en) Method, device and equipment for generating test cases
CN111399900B (en) API document automatic generation method and system based on python and regular expression
JP2003150762A (en) Cooperation method for project information and its system
CN114356430A (en) DAG (demand oriented architecture) dependency configuration tool based on airflow scheduling system
CN112130841B (en) SQL development method and device and terminal equipment
CN114579112B (en) Method, device, equipment and storage medium for assisting system development
US20060277251A1 (en) Information processing apparatus and system development method
CN113537954B (en) Project milestone processing method and device, storage medium and electronic equipment
CN113064588B (en) Command arranging method, device and computer readable medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination