CN114579109A - Code generation method and device, electronic equipment and storage medium - Google Patents

Code generation method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN114579109A
CN114579109A CN202210272495.8A CN202210272495A CN114579109A CN 114579109 A CN114579109 A CN 114579109A CN 202210272495 A CN202210272495 A CN 202210272495A CN 114579109 A CN114579109 A CN 114579109A
Authority
CN
China
Prior art keywords
code file
file
code
database
entity
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.)
Withdrawn
Application number
CN202210272495.8A
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.)
Shanghai Sensetime Intelligent Technology Co Ltd
Original Assignee
Shanghai Sensetime Intelligent 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 Shanghai Sensetime Intelligent Technology Co Ltd filed Critical Shanghai Sensetime Intelligent Technology Co Ltd
Priority to CN202210272495.8A priority Critical patent/CN114579109A/en
Publication of CN114579109A publication Critical patent/CN114579109A/en
Withdrawn legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code

Abstract

The present disclosure relates to a code generation method and apparatus, an electronic device, and a storage medium, the method including: acquiring database table information of a database, wherein the database table information represents basic configuration of a table in the database; generating an entity code file and a mapping code file according to the database table information; and generating a source code file according to the entity code file and the mapping code file, wherein the source code file comprises at least one of a service model layer code file, a view layer code file and a controller layer code file, the controller layer code file is used for providing a data access address aiming at the database, the service model layer code file is used for performing data access on the database based on a data access request transmitted by the data access address, and the view layer code file is used for returning a data access result of the data access request. The embodiment of the disclosure can improve the code development efficiency.

Description

Code generation method and device, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a code generation method and apparatus, an electronic device, and a storage medium.
Background
MyBatis Generator (MBG) is a code Generator for MyBatis and iBATIS. It can generate Mybatis versions of code and iBATIS 2.2.0 version later code. It can introspecte a table (or tables) of the database and then generate a base object that can be used to access the table. This reduces the process of creating objects and profiles when interacting with the database. MBG implements some simple CRUD (add, query, update, delete) operations on a database.
An MVC framework (MVC, which is an abbreviation of a service Model (Model) -View (View) -Controller), a software design framework, which can generate a method organization code for separating service logic, data and interface display by adopting the MVC framework, and aggregate the service logic into one component, so that the development of web projects is not required to rewrite the service logic while improving and personalizing a customized interface and user interaction.
When the project code of a web project is developed based on an MVC framework, since the code generated by the MBG belongs to a back-end business model (model) layer, a developer needs to develop the code of a view (view) layer and a controller (controller) layer, and thus, the problems of irregular code writing, low development efficiency and the like may occur.
Disclosure of Invention
The present disclosure proposes a code generation technical solution.
According to an aspect of the present disclosure, there is provided a code generation method including: acquiring database table information of a database, wherein the database table information represents basic configuration of a table in the database; generating an entity code file and a mapping code file according to the database table information, wherein the entity code file is used for mapping the database table information into an entity class, and the mapping code file is used for generating a structured query statement aiming at the database; generating a source code file according to the entity code file and the mapping code file, wherein the source code file comprises at least one of a service model layer code file, a view layer code file and a controller layer code file, the controller layer code file is used for providing a data access address for the database, the service model layer code file is used for performing data access on the database based on a data access request transmitted by the data access address, and the view layer code file is used for returning a data access result of the data access request.
In a possible implementation manner, the generating a source code file according to the entity code file and the mapping code file includes: and generating the business model layer code file according to a basic operation method code and a preset self-defined query method code in the mapping code file, wherein the self-defined query method code is used for realizing at least one self-defined query method in a paging query method and a condition query method for the database, and the basic operation method code is used for realizing at least one basic operation method in addition, deletion, modification and basic query for the database.
In a possible implementation manner, the generating a source code file according to the entity code file and the mapping code file includes: and generating the view layer code file according to a data transmission field obtained by using the entity code file, wherein the data transmission field corresponds to a table field of a table in the database.
In a possible implementation manner, the generating a source code file according to the entity code file and the mapping code file includes: and generating the controller layer code file according to the service model layer code file and a preset access address generation code, wherein the access address generation code is used for generating a data access address of the database.
In a possible implementation manner, the generating the service model layer code file according to the basic operation method code and the preset custom query method code in the mapping code file includes: creating a class file; adding a dependent item of the mapping code file in the class file, quoting the basic operation method code in the class file, adding a method body of the basic operation method in the class file, and adding the self-defined query method code in the class file to obtain a service code file; wherein, the service code file, the mapping code file and the entity code file are included in the service model layer code file.
In a possible implementation manner, the generating the view layer code file according to the data transmission field obtained by using the entity code file includes: creating at least one class file, and creating data transmission objects in the at least one class file respectively, wherein the data transmission objects comprise at least one of data transmission objects of adding operation, data transmission objects of modifying operation, data transmission objects of inquiring operation and data transmission objects of listing operation; and adding the data transmission field into a data transmission object of the at least one class file, and respectively adding a first annotation of a method creation tool in the at least one class file to obtain the at least one data transmission code file, wherein the method creation tool is used for creating a method indicated by the first annotation for the data transmission field in the data transmission object.
In a possible implementation manner, the generating the view layer code file according to the data transmission field obtained by using the entity code file further includes: creating an interface file, and adding a second annotation of a conversion tool in the interface file, wherein the conversion tool is used for generating a method code of a conversion method in a code compiling process, and the conversion method is used for realizing name conversion between a data transmission field in the data transmission code file and a table field in the entity code file; and adding a method statement of the conversion method in the interface file to which the second annotation is added to obtain the conversion code file, wherein the method name of the conversion method in the method statement is named according to the file name of the data transmission code file and the file name of the entity code file.
In a possible implementation manner, the service model layer code file further includes a service code file, and the service code file inherits at least one method in the service code file, where the at least one method includes: the base operation method and/or the custom query method.
In a possible implementation manner, the generating the controller layer code file according to the service model layer code file and a preset access address generation code includes: adding an access address generation code in a specified class file based on method information of each operation method in the service model layer code file to obtain the controller layer code file; wherein the method information comprises at least one of a method name and a calling parameter, and each operation method comprises at least one of the basic operation method and the custom query method.
In one possible implementation, the database table information includes field information and description information of tables in the database, the field information includes at least one of a field name, a field type, and a field attribute of each table field in the table, and the description information includes at least one of a table name and a primary foreign key relationship of the table; the method further comprises the following steps: and adding the annotation description of the entity class and the annotation description of each table field in the entity class into the entity code file according to the field information and the description information.
According to an aspect of the present disclosure, there is provided a code generation apparatus including: the system comprises an acquisition module, a data processing module and a data processing module, wherein the acquisition module is used for acquiring database table information of a database, and the database table information represents the basic configuration of a table in the database; the generating module is used for generating an entity code file and a mapping code file according to the database table information, wherein the entity code file is used for mapping the database table information into an entity class, and the mapping code file is used for generating a structured query statement aiming at the database; a source code generation module, configured to generate a source code file according to the entity code file and the mapping code file, where the source code file includes at least one of a service model layer code file, a view layer code file, and a controller layer code file, the controller layer code file is used to provide a data access address for the database, the service model layer code file is used to perform data access on the database based on a data access request transmitted by the data access address, and the view layer code file is used to return a data access result of the data access request.
In one possible implementation manner, the source code generation module includes: and the model layer code generation submodule is used for generating the business model layer code file according to a basic operation method code and a preset custom query method code in the mapping code file, wherein the custom query method code is used for realizing at least one custom query method in a paging query method and a condition query method for the database, and the basic operation method code is used for realizing at least one basic operation method in addition, deletion, modification and basic query for the database.
In one possible implementation, the source code generation module includes: and the view layer code generation submodule is used for generating the view layer code file according to a data transmission field obtained by utilizing the entity code file, and the data transmission field corresponds to a table field of a table in the database.
In one possible implementation, the source code generation module includes: and the controller layer code generation submodule is used for generating the controller layer code file according to the business model layer code file and a preset access address generation code, and the access address generation code is used for generating a data access address of the database.
In a possible implementation manner, the generating the service model layer code file according to the basic operation method code and the preset custom query method code in the mapping code file includes: creating a class file; adding a dependent item of the mapping code file in the class file, quoting the basic operation method code in the class file, adding a method body of the basic operation method in the class file, and adding the self-defined query method code in the class file to obtain a service code file; wherein, the service code file, the mapping code file and the entity code file are included in the service model layer code file.
In a possible implementation manner, the generating the view layer code file according to the data transmission field obtained by using the entity code file includes: creating at least one class file, and respectively creating data transmission objects in the at least one class file, wherein the data transmission objects comprise at least one of data transmission objects of adding operation, data transmission objects of modifying operation, data transmission objects of inquiring operation and data transmission objects of listing operation; and adding the data transmission field to a data transmission object of the at least one class file, and respectively adding a first annotation of a method creation tool in the at least one class file to obtain the at least one data transmission code file, wherein the method creation tool is used for creating the method indicated by the first annotation for the data transmission field in the data transmission object.
In a possible implementation manner, the generating the view layer code file according to the data transmission field obtained by using the entity code file further includes: creating an interface file, and adding a second annotation of a conversion tool in the interface file, wherein the conversion tool is used for generating a method code of a conversion method in a code compiling process, and the conversion method is used for realizing name conversion between a data transmission field in the data transmission code file and a table field in the entity code file; and adding a method statement of the conversion method in the interface file to which the second annotation is added to obtain the conversion code file, wherein the method name of the conversion method in the method statement is named according to the file name of the data transmission code file and the file name of the entity code file.
In a possible implementation manner, the service model layer code file further includes a service code file, and the service code file inherits at least one method in the service code file, where the at least one method includes: the base operation method and/or the custom query method.
In a possible implementation manner, the generating the controller layer code file according to the service model layer code file and a preset access address generation code includes: adding access address generation codes in a specified class file based on method information of each operation method in the service model layer code file to obtain the controller layer code file; wherein the method information comprises at least one of a method name and a calling parameter, and each operation method comprises at least one of the basic operation method and the custom query method.
In one possible implementation, the database table information includes field information and description information of tables in the database, the field information includes at least one of a field name, a field type, and a field attribute of each table field in the table, and the description information includes at least one of a table name and a primary foreign key relationship of the table; the device further comprises: and the comment generation module is used for adding the comment explanation of the entity class and the comment explanation of each table field in the entity class into the entity code file according to the field information and the description information.
According to an aspect of the present disclosure, there is provided an electronic device including: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to invoke the memory-stored instructions to perform the above-described method.
According to an aspect of the present disclosure, there is provided a computer readable storage medium having stored thereon computer program instructions which, when executed by a processor, implement the above-described method.
In the embodiment of the disclosure, the entity code file and the mapping code file are generated according to the data table information, and then the source code file including the service model layer code file, the view layer code file and the controller layer code file is generated according to the entity code file and the mapping code file, that is, the standard source code file with the complete MVC frame is automatically generated, so that the code development efficiency can be improved, and the code development cost can be reduced.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure. Other features and aspects of the present disclosure will become apparent from the following detailed description of exemplary embodiments, which proceeds with reference to the accompanying drawings.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the disclosure.
FIG. 1 shows a flow diagram of a code generation method according to an embodiment of the present disclosure.
FIG. 2 shows a schematic diagram of a code generation system in accordance with an embodiment of the present disclosure.
Fig. 3 shows a block diagram of a code generation apparatus according to an embodiment of the present disclosure.
Fig. 4 shows a block diagram of an electronic device 1900 according to an embodiment of the disclosure.
Detailed Description
Various exemplary embodiments, features and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. In the drawings, like reference numbers can indicate functionally identical or similar elements. While the various aspects of the embodiments are presented in drawings, the drawings are not necessarily drawn to scale unless specifically indicated.
The word "exemplary" is used exclusively herein to mean "serving as an example, embodiment, or illustration. Any embodiment described herein as "exemplary" is not necessarily to be construed as preferred or advantageous over other embodiments.
The term "and/or" herein is merely an association relationship describing an associated object, and means that there may be three relationships, for example, a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the term "at least one" herein means any one of a plurality or any combination of at least two of a plurality, for example, including at least one of A, B, C, and may mean including any one or more elements selected from the group consisting of A, B and C.
Furthermore, in the following detailed description, numerous specific details are set forth in order to provide a better understanding of the present disclosure. It will be understood by those skilled in the art that the present disclosure may be practiced without some of these specific details. In some instances, methods, means, elements and circuits that are well known to those skilled in the art have not been described in detail so as not to obscure the present disclosure.
It should be noted that the code generation method of the present disclosure generates each code file based on an object-oriented programming language (e.g., Java language). It should be understood by those skilled in the art that terms such as "class", "class name", "object", "method body", "method name", "interface", "dependency", "inheritance", "reference", "annotation", "declaration", "annotation" and the like, which are involved in the generation of code, are basic concepts in object-oriented programming languages, except for special explanations.
Fig. 1 illustrates a flowchart of a code generation method according to an embodiment of the present disclosure, which may be performed by an electronic device such as a terminal device or a server, where the terminal device may be a User Equipment (UE), a mobile device, a User terminal, a cellular phone, a cordless phone, a Personal Digital Assistant (PDA), a handheld device, a computing device, a vehicle-mounted device, a wearable device, or the like, and the method may be implemented by a processor calling computer-readable instructions stored in a memory, or the code generation method may be performed by the server. As shown in fig. 1, the code generation method includes:
in step S11, database table information of the database is acquired.
Wherein the database table information characterizes a base configuration of a table in the database. In one possible implementation, the database table information may include, but is not limited to, field information and description information of tables in the database, the field information includes at least one of field names, field types, and field attributes of respective table fields in the tables, and the description information includes at least one of table names and primary foreign key relationships of the tables. The database may be any type of database such as oracle, mysql, sqlserver, and the like, and the embodiment of the present disclosure is not limited thereto.
It should be understood that those skilled in the art can configure the contents contained in the database table information, for example, the field information may also include the names of the various table fields used in the code, etc., according to the actual project development requirements, and the embodiments of the present disclosure are not limited thereto.
In step S12, an entity code file and a mapping code file are generated based on the database table information.
In a possible implementation manner, the database table information may be imported into the code generator MBG in a configuration file manner, so that the generation of an entity code file (entity file) and a mapping code file (mapper file) according to the database table information can be realized by using the code generator MBG. Wherein the configuration file can be added to a specified file directory specified by the code generator MBG, so that the database table information can be imported into the code generator MBG. It should be understood that a code generator developed autonomously and having the same function as the MBG code generator described above may also be employed by those skilled in the art, and the disclosed embodiments are not limited thereto.
The entity code file is used for mapping the database table information into an entity class, and the mapping code file is used for generating a Structured Query Statement (SQL) for the database. It can be known that, in addition to the entity file and the mapper file, the code generator MBG also generates a DAO (Data Access Object) file, where the DAO file is an Object-oriented database interface file and is used for implementing Access connection to a database to execute SQL operation on the database, and the DAO file includes the mapper file; a service Model layer (Model layer, abbreviated as M layer) in the MCV framework includes the above entity file, mapper file, and DAO file.
Considering that the entity file generated by the code generator MBG usually does not have any comment specification, in one possible implementation, the method further comprises: and adding the annotation specification of the entity class and the annotation specification of each table field in the entity class into the entity code file according to the field information and the description information. By the method, annotation explanation can be added to the classes and the fields in the entity code file automatically, and developers can know the meaning of the code conveniently.
For example, the description information of the table in the data table information is acquired to add the comment explanation of the entity class, and the field information in the data table information is acquired to add the comment explanation of the table field in the entity class by an autonomously developed comment adding method. It should be understood that the above annotation adding method can be developed by those skilled in the art by using software development technology known in the art, and the embodiment of the present disclosure is not limited thereto.
In step S13, a source code file is generated from the entity code file and the mapping code file.
The source code file comprises at least one of a service model layer code file (namely belonging to M-layer codes in an MCV framework), a view layer code file (namely belonging to V-layer codes in the MCV framework) and a controller layer code file (namely belonging to C-layer codes in the MCV framework).
It can be known that, in the MVC framework of the backend code, the controller layer code file is used to provide a data access address, the service model layer code file is used to perform data access on the database based on a data access request transmitted by the data access address, and the view layer code file is used to return a data access result of the data access request. The data access to the database can be understood as operations of increasing, deleting, modifying, checking and the like on the data in the database; the data access address may be, for example, a URL (Uniform Resource Locator) address.
The method comprises the steps of generating a source code file according to an entity code file and a mapping code file, wherein the source code file is generated according to the entity code file and the mapping code file, and generating a service model layer code file, a view layer code file and a controller layer code file by utilizing method codes, tools required by code generation, a preset code template and the like in the entity code file and the mapping code file according to the requirement of generating three layers of codes by an MVC frame, so that the source code file containing a complete MVC frame is obtained.
In the embodiment of the disclosure, the entity code file and the mapping code file are generated according to the data table information, and then the source code file including the service model layer code file, the view layer code file and the controller layer code file is generated according to the entity code file and the mapping code file, that is, the standard source code file with the complete MVC frame is automatically generated, so that the code development efficiency can be improved, and the code development cost can be reduced.
In one possible implementation manner, in step S13, generating a source code file according to the entity code file and the mapping code file includes: and generating a service model layer code file according to the basic operation method code in the mapping code file and a preset self-defined query method code.
The user-defined query method code is used for realizing at least one user-defined query method of a paging query method and a conditional query method for the database, and the basic operation method code is used for realizing at least one basic operation method of adding, deleting, modifying and basic query for the database. It can be known that the basic operation method code is a self-contained method code in the mapper file, the basic query refers to performing full-text retrieval query on the table in the database, the paging query refers to performing page-by-page retrieval query on the table in the database, and the conditional query refers to performing retrieval query on all table fields of the table in the database according to a set condition.
In a possible implementation manner, the custom query method code may be obtained by replacing a variable placeholder in a pre-written query method code template, where the variable placeholder may include, for example, a placeholder for representing a table name in a database, a placeholder for a table field, and the like, and may be specifically set according to a parameter entry requirement of the custom query method code, which is not limited in this embodiment of the present disclosure.
In a possible implementation manner, generating a service model layer code file according to a basic operation method code and a preset custom query method code in a mapping code file includes: creating a class file; adding a dependence item of a mapping code file in the class file, quoting a basic operation method code in the class file, adding a method body of the basic operation method in the class file and adding a self-defined inquiry method code in the class file to obtain a service code file; the service model layer code file comprises a service code file, a mapping code file and an entity code file. By the method, the self-defined query method can be provided in the service model layer code of the automatically generated source code file, developers do not need to independently write the self-defined query method, the code development efficiency is improved, and the code development cost is reduced.
Wherein creating the class file may include: creating a class file (top class) named by a file name of a mapping code file, namely creating a blank class file capable of writing codes, wherein the name (also called class name) of the class file can be the file name of a mapper file, the created class file usually contains a statement of a class, such as a "public class name", and the class name is the file name of the class file.
It can be understood that adding a dependency item of a mapping code file in a class file, referencing a basic operation method code in the class file, and adding a method body of a basic operation method in the class file can enable a generated service file to call the basic operation method in a mapper file; and adding a custom query method code in the class file, so that the generated service file can have the capability of executing the custom query method.
By the method, the service model layer code file comprising the service code file, the mapping code file and the entity code file has the capability of executing a basic operation method and a custom query method on the database, so that data access on the database is realized.
In one possible implementation, the service model layer code file further includes a service code file, and the service code file inherits at least one method in the service code file, where the at least one method includes a basic operation method and/or a custom query method. Through the method, technicians can write the service logic codes required by realizing other service logics in the service code file (called BIZ file), so that even if the table structure in the database is changed, other codes in the service code file do not need to be modified, and the source code file of a new version can be regenerated only by adjusting the service file.
Wherein, a class file may be created, and all methods in the service file are inherited in the class file, so that the BIZ file is equivalent to a parent class in an inheritance relationship, the service file is equivalent to a child class in the inheritance relationship, and for example, the method may be based on a Java language relay bearer format: the class parent class { } class subclass extensions parent class { } "implements all or part of the method for inheriting the service file in the BIZ file.
In one possible implementation manner, in step S13, generating a source code file according to the entity code file and the mapping code file includes: and generating a view layer code file according to a data transmission field obtained by utilizing the entity code file, wherein the data transmission field corresponds to a table field of a table in a database.
It can be known that, in the data interaction process between the front end and the back end, in order to ensure the data security of the back end database, the table name and the field name of the table field adopted in the back end database are usually not directly provided to the front end (such as a browser), so that the data transmission field corresponding to the table field in the database is usually set, each table field corresponds to each data transmission field one to one, or the mapping relationship exists between the table field and the data transmission field.
The data table information (i.e., in the configuration file corresponding to the data table information) may further include a mapping relationship between the table fields and the data transmission fields, and as described above, the entity code file is used to map the data table information into the entity class, so that the data transmission fields corresponding to the table fields may be obtained by using the entity code file.
As described above, the view layer code file is used for returning a data access result of an access instruction sent based on the data access address, and if the front-end browser sends the access instruction based on the data access address, the view layer code file may return the data access result (for example, a result of performing addition, deletion, and modification on the database) to the front-end browser, and the front-end browser may present the data access result to the user through the view interface, thereby effectively implementing human-computer interaction.
In a possible implementation manner, the generating of the view layer code file according to the data transmission field obtained by using the entity code file includes: creating at least one class file, and creating a Data Transfer Object (DTO) in the at least one class file, respectively; and adding the data transmission field to the data transmission object of the at least one class file, and respectively adding a first annotation of the method creation tool in the at least one class file to obtain at least one data transmission code file. By the method, the data transmission object code file can be automatically generated, so that the source code file has a data interaction function between the front end and the back end, and the name conversion between the data transmission field and the table field can be conveniently realized later.
The data transmission objects comprise at least one of data transmission objects of adding operation, data transmission objects of modifying operation, data transmission objects of inquiring operation and data transmission objects of listing operation; the method creation tool is used for creating the method indicated by the first annotation for the data transmission field in the data transmission object.
In one possible implementation, at least one class file (TopLevelClass) is created, which may be understood as creating at least one blank class of writable code, for example, four class files may be created, and the four class files may be named by an add operation (add), a modify operation (update), a query operation (query), and a list operation (list or response), respectively; creating a data transmission object of an increase operation (called as an increase DTO for short) in a class file named by the increase operation, creating a data transmission object of a modification operation (called as a modification DTO for short) in a class file named by the modification operation, creating a data transmission object of a query method (called as a query DTO for short) in a class file named by the query operation, and creating a data transmission object of a list operation (called as a list DTO for short) in a class file named by the list operation.
It should be understood that different data accesses to the database may correspond to different data transmission objects, so that different data accesses and data access results of different data accesses are realized based on different data transmission objects, for example, increasing the DTO may realize data access for performing an increase operation on the database, modifying the DTO may realize data access for performing a modification operation on the database, querying the DTO may realize data access for performing a query operation on the database, and returning the data access results of the DTOs of the respective data transmission objects in a list form by using the list DTO, where the list operation may be understood as transmitting the data access results in a list form.
The method creation tool can adopt Lombok (annotation tool capable of automatically creating reading (Getter method) and writing (Setter method) of fields on the class), and Lombok can simplify and eliminate some fussy Java codes through annotation forms, for example, adding a first annotation "@ Getter" in the class file using the Getter method, adding a first annotation "@ Setter" in the class file using the Setter method, and the like. Of course, those skilled in the art can also create tools by other methods known in the art, and the embodiments of the present disclosure are not limited thereto.
As described above, in the data interaction process between the front end and the back end, since the field names of the data transmission field and the table field are different, the names between the data transmission field and the table field are to be mutually converted, so as to implement the data interaction between the front end and the back end, in one possible implementation manner, the view layer code file further includes a conversion code file (convert file), and the view layer code file is generated according to the data transmission field obtained by using the entity code file, including: creating an interface file, and adding a second annotation of a conversion tool in the interface file, wherein the conversion tool is used for generating a method code of a conversion method in the code compiling process, and the conversion method is used for realizing name conversion between a data transmission field in a data transmission code file and a table field in an entity code file; and adding a method statement of a conversion method in the interface file added with the second annotation to obtain a conversion code file, wherein the method name of the conversion method in the method statement is named according to the file name of the data transmission code file and the file name of the entity code file. By the method, the mutual conversion between the data transmission field in the DTO file and the table field in the entity file can be effectively realized, so that the data interaction between the front end and the back end is realized.
Creating an interface file may be understood as creating a blank interface file in which codes can be written, and the interface file usually contains a statement of an interface, such as a "public interface name". It should be understood that the first annotation and the second annotation are only used for distinguishing the annotation corresponding to the method creation tool and the conversion tool, and both the first annotation and the second annotation are annotation modes defined in an object-oriented programming language. In the embodiment of the present disclosure, the method code of the conversion method generated by the conversion tool may be called by adding a second annotation of the conversion tool, and the second annotation may further indicate a field, an object, and the like that are converted between the two class files.
The conversion tool may adopt mapreduce (a tool for implementing mutual conversion of Java objects), a method that needs Mapping (i.e. a method declaration) may be declared by defining an interface file through mapreduce, in the code compiling process, mapreduce may automatically generate an implementation class, which may implement the conversion method, i.e. compile a method code of the conversion method, so that the interface file to which the second annotation is added has a function of converting a source object in a certain type of file to a target object in another type of file, the second annotation of mapreduce may include "@ Mapper, @ mappingand @ Mapping", where the @ Mapper may be used to call mapreduce, and the @ Mapper and the @ mappingmay be used to indicate fields that need to be converted in two types of files, for example: @ Mapping (source ═ name ═ target ═ username ") represents that" name "in a certain type of file is mapped into" username "in another type of file, and at least one @ Mapping can be included in @ Mapping.
For example, if a source object in the personnadddto class file is converted into a target object in the Person class file, the method name of the conversion method declared in the interface file may be: personnadddtotoperson, otherwise, the method name may be: PersonToPersonAdddDto. Then, under the condition that the file names of the DTO file and the entity file are known, the method name of the conversion method can be automatically generated according to the file names of the DTO file and the entity file.
In one possible implementation manner, in step S13, generating a source code file according to the entity code file and the mapping code file includes: and generating a code according to the business model layer code file and a preset access address, wherein the access address generation code is used for generating a data access address of the database.
In a possible implementation manner, the access address generation code may be obtained by replacing a variable placeholder in a pre-written address generation code template, where the variable placeholder may include, for example, a placeholder that characterizes a method name, a placeholder that characterizes a call parameter, and the like, and may be specifically set according to an entry requirement of the access address generation code, which is not limited in this embodiment of the present disclosure. The call parameter may include, for example, a table name of a specified table in the database, a field name of a table field, and the like, which is not limited to this embodiment of the present disclosure.
It should be understood that a person skilled in the art may develop an address generation code template for generating data access addresses using software development techniques known in the art, and embodiments of the present disclosure are not limited thereto. In a possible implementation manner, the data access address may be, for example, a Uniform Resource Locator (URL) address provided externally, so that the front end can send a data access request to the back end through the URL address, thereby effectively implementing data interaction between the front end and the back end.
In a possible implementation manner, generating a code according to a service model layer code file and a preset access address, and generating a controller layer code file includes: adding an access address generation code in a specified class file based on method information of each operation method in a service model layer code file to obtain a controller layer code file (called a controller file); the method information comprises at least one of a method name and a calling parameter, and each operation method in the service model layer code file comprises at least one of a basic operation method and a custom query method. By the method, the controller layer code file can have the capability of providing the data access addresses corresponding to the operation methods, and the data access request transmitted based on the data access addresses can be transmitted to the service model layer code file, so that data interaction between the front end and the back end is effectively realized.
The method comprises the steps of adding an access address generation code in a specified class file based on method information of each operation method in a service model layer code file to obtain a controller layer code file, wherein the method comprises the steps of replacing variable placeholders in an address generation code template based on the method information of each operation method to obtain access address generation codes corresponding to each operation method, and adding the access address generation codes corresponding to each operation method to the created class file to obtain the controller layer code file. It should be understood that the data access addresses for different operation methods are different, and the specified class file may be any blank class file that has been created into writable code.
In the embodiment of the disclosure, the entity code file and the mapping code file are generated according to the data table information, and then the service model layer code file, the view layer code file and the controller layer code file are generated according to the entity code file and the mapping code file, so that a standard source code file with a complete MVC frame is automatically generated, the code development efficiency can be improved, and the code development cost can be reduced.
Fig. 2 shows a schematic diagram of a code generation system according to an embodiment of the present disclosure, as shown in fig. 2, the code generation system comprising: a code generator MBG and a code generation plug-in;
the code generator MBG is used for generating an entity code file (entity file) and a mapping code file (mapper file) according to the database table information; the code generation plug-in is used for generating a service code file (service file), a data transmission code file (DTO file), a conversion code file (convert file), a service code file (BIZ file) and a controller layer code file (controller file) according to the entity code file and the mapping code file.
With reference to the code generation method in the embodiment of the present disclosure, the generation of the service code file (service file), the data transfer code file (DTO file), the object conversion code file (convert file), the service code file (BIZ file), and the controller layer code file (controller file) according to the entity code file and the mapping code file is implemented, which is not described herein again.
According to the embodiment of the disclosure, a source code file with a complete MVC three-layer framework can be generated, the source code file has the capabilities of a paging query method and a condition query method, a DTO file can be generated, meanwhile, a method for field interconversion between the DTO file and an entry file is generated, annotation description of an entity class and a table field can be generated in the entry file, when a table structure in a database is changed, the source code file can be regenerated by updating a small number of service files, the code development efficiency is improved integrally, and the code development cost is reduced.
It is understood that the above-mentioned embodiments of the method of the present disclosure can be combined with each other to form a combined embodiment without departing from the principle logic, which is limited by the space, and the detailed description of the present disclosure is omitted. Those skilled in the art will appreciate that in the above methods of the specific embodiments, the specific order of execution of the steps should be determined by their function and possibly their inherent logic.
In addition, the present disclosure also provides a code generation apparatus, an electronic device, a computer-readable storage medium, and a program, which can be used to implement any one of the code generation methods provided by the present disclosure, and the corresponding technical solutions and descriptions and corresponding descriptions in the methods section are omitted for brevity.
Fig. 3 shows a block diagram of a code generation apparatus according to an embodiment of the present disclosure, which includes, as shown in fig. 3:
an obtaining module 101, configured to obtain database table information of a database, where the database table information represents a basic configuration of a table in the database;
a generating module 102, configured to generate an entity code file and a mapping code file according to the database table information, where the entity code file is used to map the database table information into an entity class, and the mapping code file is used to generate a structured query statement for the database;
a source code generating module 103, configured to generate a source code file according to the entity code file and the mapping code file, where the source code file includes at least one of a service model layer code file, a view layer code file, and a controller layer code file, the controller layer code file is used to provide a data access address for the database, the service model layer code file is used to perform data access on the database based on a data access request transmitted by the data access address, and the view layer code file is used to return a data access result of the data access request.
In one possible implementation, the source code generating module 103 includes: and the model layer code generation submodule is used for generating the business model layer code file according to a basic operation method code and a preset custom query method code in the mapping code file, wherein the custom query method code is used for realizing at least one custom query method in a paging query method and a condition query method for the database, and the basic operation method code is used for realizing at least one basic operation method in addition, deletion, modification and basic query for the database.
In one possible implementation, the source code generating module 103 includes: and the view layer code generation submodule is used for generating the view layer code file according to a data transmission field obtained by utilizing the entity code file, and the data transmission field corresponds to a table field of a table in the database.
In one possible implementation, the source code generating module 103 includes: and the controller layer code generation submodule is used for generating the controller layer code file according to the business model layer code file and a preset access address generation code, and the access address generation code is used for generating a data access address of the database.
In a possible implementation manner, the generating the service model layer code file according to the basic operation method code and the preset custom query method code in the mapping code file includes: creating a class file; adding a dependent item of the mapping code file in the class file, quoting the basic operation method code in the class file, adding a method body of the basic operation method in the class file, and adding the self-defined query method code in the class file to obtain a service code file; wherein, the service code file, the mapping code file and the entity code file are included in the service model layer code file.
In a possible implementation manner, the generating the view layer code file according to the data transmission field obtained by using the entity code file includes: creating at least one class file, and respectively creating data transmission objects in the at least one class file, wherein the data transmission objects comprise at least one of data transmission objects of adding operation, data transmission objects of modifying operation, data transmission objects of inquiring operation and data transmission objects of listing operation; and adding the data transmission field to a data transmission object of the at least one class file, and respectively adding a first annotation of a method creation tool in the at least one class file to obtain the at least one data transmission code file, wherein the method creation tool is used for creating the method indicated by the first annotation for the data transmission field in the data transmission object.
In a possible implementation manner, the generating the view layer code file according to the data transmission field obtained by using the entity code file further includes: creating an interface file, and adding a second annotation of a conversion tool in the interface file, wherein the conversion tool is used for generating a method code of a conversion method in a code compiling process, and the conversion method is used for realizing name conversion between a data transmission field in the data transmission code file and a table field in the entity code file; and adding a method statement of the conversion method in the interface file to which the second annotation is added to obtain the conversion code file, wherein the method name of the conversion method in the method statement is named according to the file name of the data transmission code file and the file name of the entity code file.
In one possible implementation, the service model layer code file further includes a service code file, and the service code file inherits at least one method in the service code file, where the at least one method includes: the base operation method and/or the custom query method.
In a possible implementation manner, the generating the controller layer code file according to the service model layer code file and a preset access address generation code includes: adding an access address generation code in a specified class file based on method information of each operation method in the service model layer code file to obtain the controller layer code file; wherein the method information comprises at least one of a method name and a calling parameter, and each operation method comprises at least one of the basic operation method and the custom query method.
In one possible implementation, the database table information includes field information and description information of tables in the database, the field information includes at least one of a field name, a field type, and a field attribute of each table field in the table, and the description information includes at least one of a table name and a primary foreign key relationship of the table; the device further comprises: and the comment generation module is used for adding the comment explanation of the entity class and the comment explanation of each table field in the entity class into the entity code file according to the field information and the description information.
In the embodiment of the disclosure, the entity code file and the mapping code file are generated according to the data table information, and then the source code file including the service model layer code file, the view layer code file and the controller layer code file is generated according to the entity code file and the mapping code file, that is, the standard source code file with the complete MVC frame is automatically generated, so that the code development efficiency can be improved, and the code development cost can be reduced.
In some embodiments, functions of or modules included in the apparatus provided in the embodiments of the present disclosure may be used to execute the method described in the above method embodiments, and specific implementation thereof may refer to the description of the above method embodiments, and for brevity, will not be described again here.
Embodiments of the present disclosure also provide a computer-readable storage medium having stored thereon computer program instructions, which when executed by a processor, implement the above-mentioned method. The computer readable storage medium may be a volatile or non-volatile computer readable storage medium.
An embodiment of the present disclosure further provides an electronic device, including: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to invoke the memory-stored instructions to perform the above-described method.
The disclosed embodiments also provide a computer program product comprising computer readable code or a non-transitory computer readable storage medium carrying computer readable code, which when run in a processor of an electronic device, the processor in the electronic device performs the above method.
The electronic device may be provided as a terminal, server, or other form of device.
Fig. 4 illustrates a block diagram of an electronic device 1900 in accordance with an embodiment of the disclosure. For example, the electronic device 1900 may be provided as a server or terminal device. Referring to fig. 4, electronic device 1900 includes a processing component 1922 further including one or more processors and memory resources, represented by memory 1932, for storing instructions, e.g., applications, executable by processing component 1922. The application programs stored in memory 1932 may include one or more modules that each correspond to a set of instructions. Further, the processing component 1922 is configured to execute instructions to perform the above-described method.
The electronic device 1900 may also include a power component 1926 configured to perform power management of the electronic device 1900, a wired or wireless network interface 1950 configured to connect the electronic device 1900 to a network, and an input/output (I/O) interface 1958. The electronic device 1900 may operate based on an operating system, such as the Microsoft Server operating system (Windows Server), stored in the memory 1932TM) Apple Inc. of the present application based on the graphic user interface operating System (Mac OS X)TM) Multi-user, multi-process computer operating system (Unix)TM) Free and open native code Unix-like operating System (Linux)TM) Open native code Unix-like operating System (FreeBSD)TM) Or the like.
In an exemplary embodiment, a non-transitory computer readable storage medium, such as the memory 1932, is also provided that includes computer program instructions executable by the processing component 1922 of the electronic device 1900 to perform the above-described methods.
The present disclosure may be systems, methods, and/or computer program products. The computer program product may include a computer-readable storage medium having computer-readable program instructions embodied thereon for causing a processor to implement various aspects of the present disclosure.
The computer readable storage medium may be a tangible device that can hold and store the instructions for use by the instruction execution device. The computer readable storage medium may be, for example, but is not limited to, an electronic memory device, a magnetic memory device, an optical memory device, an electromagnetic memory device, a semiconductor memory device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: 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), a Static Random Access Memory (SRAM), a portable compact disc read-only memory (CD-ROM), a Digital Versatile Disc (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as punch cards or in-groove raised structures having instructions stored thereon, and any suitable combination of the foregoing. Computer-readable storage media as used herein is not to be construed as transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission medium (e.g., optical pulses through a fiber optic cable), or electrical signals transmitted through electrical wires.
The computer-readable program instructions described herein may be downloaded from a computer-readable storage medium to a respective computing/processing device, or to an external computer or external storage device via a network, such as the internet, a local area network, a wide area network, and/or a wireless network. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers and/or edge servers. The network adapter card or network interface in each computing/processing device receives computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in a computer-readable storage medium in the respective computing/processing device.
The computer program instructions for carrying out operations of the present disclosure may be assembler instructions, Instruction Set Architecture (ISA) instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source or object code written in any combination of one or more programming languages, including an object oriented programming language such as Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The computer-readable program instructions may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider). In some embodiments, the electronic circuitry that can execute the computer-readable program instructions implements aspects of the present disclosure by utilizing the state information of the computer-readable program instructions to personalize the electronic circuitry, such as a programmable logic circuit, a Field Programmable Gate Array (FPGA), or a Programmable Logic Array (PLA).
Various aspects of the present disclosure are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the disclosure. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer-readable program instructions.
These computer-readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks. These computer-readable program instructions may also be stored in a computer-readable storage medium that can direct a computer, programmable data processing apparatus, and/or other devices to function in a particular manner, such that the computer-readable medium storing the instructions comprises an article of manufacture including instructions which implement the function/act specified in the flowchart and/or block diagram block or blocks.
The computer readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer, other programmable apparatus or other devices implement the functions/acts specified in the flowchart and/or block diagram block or blocks.
The flowchart 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 disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more executable instructions for implementing the specified logical function(s). 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 and/or flowchart illustration, and combinations of blocks in the block diagrams and/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 computer program product may be embodied in hardware, software or a combination thereof. In an alternative embodiment, the computer program product is embodied in a computer storage medium, and in another alternative embodiment, the computer program product is embodied in a Software product, such as a Software Development Kit (SDK), or the like.
The foregoing description of the various embodiments is intended to highlight various differences between the embodiments, and the same or similar parts may be referred to each other, and for brevity, will not be described again herein.
It will be understood by those skilled in the art that in the method of the present invention, the order of writing the steps does not imply a strict order of execution and any limitations on the implementation, and the specific order of execution of the steps should be determined by their function and possible inherent logic.
If the technical scheme of the application relates to personal information, a product applying the technical scheme of the application clearly informs personal information processing rules before processing the personal information, and obtains personal independent consent. If the technical scheme of the application relates to sensitive personal information, a product applying the technical scheme of the application obtains individual consent before processing the sensitive personal information, and simultaneously meets the requirement of 'express consent'. For example, at a personal information collection device such as a camera, a clear and significant identifier is set to inform that the personal information collection range is entered, the personal information is collected, and if the person voluntarily enters the collection range, the person is regarded as agreeing to collect the personal information; or on the device for processing the personal information, under the condition of informing the personal information processing rule by using obvious identification/information, obtaining personal authorization by modes of popping window information or asking a person to upload personal information of the person by himself, and the like; the personal information processing rule may include information such as a personal information processor, a personal information processing purpose, a processing method, and a type of personal information to be processed.
Having described embodiments of the present disclosure, the foregoing description is intended to be exemplary, not exhaustive, and not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The terminology used herein was chosen in order to best explain the principles of the embodiments, the practical application, or improvements to the technology in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein.

Claims (13)

1. A code generation method, comprising:
acquiring database table information of a database, wherein the database table information represents basic configuration of a table in the database;
generating an entity code file and a mapping code file according to the database table information, wherein the entity code file is used for mapping the database table information into an entity class, and the mapping code file is used for generating a structured query statement aiming at the database;
generating a source code file according to the entity code file and the mapping code file, wherein the source code file comprises at least one of a service model layer code file, a view layer code file and a controller layer code file, the controller layer code file is used for providing a data access address for the database, the service model layer code file is used for performing data access on the database based on a data access request transmitted by the data access address, and the view layer code file is used for returning a data access result of the data access request.
2. The method of claim 1, wherein generating a source code file from the entity code file and the mapping code file comprises:
and generating the business model layer code file according to a basic operation method code and a preset self-defined query method code in the mapping code file, wherein the self-defined query method code is used for realizing at least one self-defined query method in a paging query method and a condition query method for the database, and the basic operation method code is used for realizing at least one basic operation method in addition, deletion, modification and basic query for the database.
3. The method of claim 1 or 2, wherein generating a source code file from the entity code file and the mapping code file comprises:
and generating the view layer code file according to a data transmission field obtained by using the entity code file, wherein the data transmission field corresponds to a table field of a table in the database.
4. The method of any of claims 1-3, wherein generating a source code file from the entity code file and the mapping code file comprises:
and generating the controller layer code file according to the service model layer code file and a preset access address generation code, wherein the access address generation code is used for generating a data access address of the database.
5. The method of claim 2, wherein generating the service model layer code file according to the basic operation method code and the preset custom query method code in the mapping code file comprises:
creating a class file;
adding a dependent item of the mapping code file in the class file, quoting the basic operation method code in the class file, adding a method body of the basic operation method in the class file, and adding the self-defined query method code in the class file to obtain a service code file;
wherein, the service code file, the mapping code file and the entity code file are included in the service model layer code file.
6. The method according to claim 3, wherein the view layer code file includes at least one data transmission code file, and wherein generating the view layer code file according to the data transmission field obtained by using the entity code file includes:
creating at least one class file, and respectively creating data transmission objects in the at least one class file, wherein the data transmission objects comprise at least one of data transmission objects of adding operation, data transmission objects of modifying operation, data transmission objects of inquiring operation and data transmission objects of listing operation;
and adding the data transmission field to a data transmission object of the at least one class file, and respectively adding a first annotation of a method creation tool in the at least one class file to obtain the at least one data transmission code file, wherein the method creation tool is used for creating the method indicated by the first annotation for the data transmission field in the data transmission object.
7. The method according to claim 3 or 6, wherein the view layer code file further includes a conversion code file, and the generating the view layer code file according to the data transmission field obtained by using the entity code file includes:
creating an interface file, and adding a second annotation of a conversion tool in the interface file, wherein the conversion tool is used for generating a method code of a conversion method in a code compiling process, and the conversion method is used for realizing name conversion between a data transmission field in the data transmission code file and a table field in the entity code file;
and adding a method statement of the conversion method in the interface file to which the second annotation is added to obtain the conversion code file, wherein the method name of the conversion method in the method statement is named according to the file name of the data transmission code file and the file name of the entity code file.
8. The method of claim 2 or 5, wherein the business model layer code file further comprises a business code file, and the business code file inherits at least one method in the service code file, and the at least one method comprises: the base operation method and/or the custom query method.
9. The method of claim 4, wherein generating the controller layer code file according to the service model layer code file and a preset access address generation code comprises:
adding an access address generation code in a specified class file based on method information of each operation method in the service model layer code file to obtain the controller layer code file;
wherein the method information comprises at least one of a method name and a calling parameter, and each operation method comprises at least one of the basic operation method and the custom query method.
10. The method according to any one of claims 1-9, wherein the database table information includes field information and description information of tables in the database, the field information includes at least one of field name, field type and field attribute of each table field in the table, and the description information includes at least one of table name and primary foreign key relationship of the table;
the method further comprises the following steps: and adding the annotation description of the entity class and the annotation description of each table field in the entity class into the entity code file according to the field information and the description information.
11. A code generation apparatus, comprising:
the system comprises an acquisition module, a data processing module and a data processing module, wherein the acquisition module is used for acquiring database table information of a database, and the database table information represents the basic configuration of a table in the database;
the generating module is used for generating an entity code file and a mapping code file according to the database table information, wherein the entity code file is used for mapping the database table information into an entity class, and the mapping code file is used for generating a structured query statement aiming at the database;
a source code generation module, configured to generate a source code file according to the entity code file and the mapping code file, where the source code file includes at least one of a service model layer code file, a view layer code file, and a controller layer code file, the controller layer code file is used to provide a data access address for the database, the service model layer code file is used to perform data access on the database based on a data access request transmitted by the data access address, and the view layer code file is used to return a data access result of the data access request.
12. An electronic device, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to invoke the memory-stored instructions to perform the method of any one of claims 1 to 10.
13. A computer readable storage medium having computer program instructions stored thereon, which when executed by a processor implement the method of any one of claims 1 to 10.
CN202210272495.8A 2022-03-18 2022-03-18 Code generation method and device, electronic equipment and storage medium Withdrawn CN114579109A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210272495.8A CN114579109A (en) 2022-03-18 2022-03-18 Code generation method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210272495.8A CN114579109A (en) 2022-03-18 2022-03-18 Code generation method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114579109A true CN114579109A (en) 2022-06-03

Family

ID=81776229

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210272495.8A Withdrawn CN114579109A (en) 2022-03-18 2022-03-18 Code generation method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114579109A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116501335A (en) * 2023-06-28 2023-07-28 北京安锐卓越信息技术股份有限公司 Deployment method, device and medium of one-stop type station building system
CN117608560A (en) * 2024-01-24 2024-02-27 卡奥斯创智物联科技有限公司 LVGL page display code generation method, device, equipment and medium

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116501335A (en) * 2023-06-28 2023-07-28 北京安锐卓越信息技术股份有限公司 Deployment method, device and medium of one-stop type station building system
CN116501335B (en) * 2023-06-28 2023-09-19 北京安锐卓越信息技术股份有限公司 Deployment method, device and medium of one-stop type station building system
CN117608560A (en) * 2024-01-24 2024-02-27 卡奥斯创智物联科技有限公司 LVGL page display code generation method, device, equipment and medium
CN117608560B (en) * 2024-01-24 2024-04-12 卡奥斯创智物联科技有限公司 LVGL page display code generation method, device, equipment and medium

Similar Documents

Publication Publication Date Title
CN114579109A (en) Code generation method and device, electronic equipment and storage medium
CN109933571B (en) Database design document generation method, device and computer readable storage medium
CN110928548B (en) Data processing method and device
CN112000320A (en) Automatic code generation method, device, equipment and storage medium
CN113076153A (en) Interface calling method and device
CN113778445A (en) Cross-platform component generation method and device, electronic equipment and storage medium
CN112130830A (en) Interface generation method and device and electronic equipment
CN108845864B (en) Spring frame-based JVM garbage recycling method and device
CN114153473A (en) Module integration method, device, storage medium and electronic equipment
CN110109983B (en) Method and device for operating Redis database
CN111488144B (en) Data processing method and device
CN108595160B (en) Method and storage medium for calling native object by JS
CN113656433B (en) Entity object expansion method, entity object expansion device, electronic equipment and storage medium
CN114880020A (en) Software development kit management method, related device and computer program product
US7567971B2 (en) Generic symbol referencing mechanism
CN110471708B (en) Method and device for acquiring configuration items based on reusable components
CN112269664A (en) Cloud server resource management method, device and system
CN112882698A (en) Development environment generation method and device, computer storage medium and electronic device
CN115203176B (en) Database operation method, device, equipment, storage medium and program product
CN113656010B (en) Method, system, equipment and medium for automatically creating code warehouse by micro service
CN113326041B (en) Virtual method calling method, electronic equipment and computer readable storage medium
CN117311799B (en) Configuration method of software project page
Nguyen et al. Data storage adapter in big data platform
US20170249196A1 (en) Interacting with a source object via a virtual object
CN112130860B (en) JSON object analysis method and device, electronic equipment and storage 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
WW01 Invention patent application withdrawn after publication
WW01 Invention patent application withdrawn after publication

Application publication date: 20220603