CRUD page generation method and system, storage medium and electronic equipment

By generating CRUD interface and jar packages, and combining the table fields configured by the user, CRUD pages are automatically generated, which solves the problem of developers writing code repeatedly and improves development efficiency and efficiency.

CN119621052AInactive Publication Date: 2025-03-14SHENZHEN YISHIHUOLALA TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411632155.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-15
Publication Date
2025-03-14
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

When developers develop CRUD pages for different projects, they often need to repeatedly write relatively repetitive web code, resulting in wasting time and reducing development efficiency.

Method used

By generating the CRUD interface of the target single table and the jar package containing the CRUD interface logical code, combined with the user's configuration of the table fields, the CRUD page is automatically generated to avoid users writing duplicate code.

Benefits of technology

It reduces the time to develop CRUD pages, improves development efficiency, avoids duplicate code writing, and reduces development difficulty.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119621052A_ABST
    Figure CN119621052A_ABST
Patent Text Reader

Abstract

The invention provides a CRUD page generation method and system, a storage medium and electronic equipment, and is applied to the technical field of computers, the scheme comprises the following steps: determining a target single table based on a form request sent by a user, generating a CRUD interface of the target single table, and then generating a jar package containing logic codes of various operations of the CRUD interface; according to the method, the fields of the target single table are displayed to the user, the user configures the fields, after the fields of the target table are configured, the configured fields and the jar package are used for generating the CRUD page, the user does not need to write codes in the whole process, it is avoided that the user writes repeated codes, the time for developing the CRUD page is shortened, and the development efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a CRUD page generation method and system, a storage medium and an electronic device. Background Art

[0002] CRUD (Create, Read, Update, Delete) pages refer to the pages for adding, reading, updating, and deleting resources in the customer-facing front-end pages. The functions of CRUD pages are generally similar, so the web page codes corresponding to CRUD pages have relatively repeated parts. Developers usually write this repeated code repeatedly when developing CRUD pages for different projects, which wastes the developers' working time and reduces development efficiency. Summary of the invention

[0003] In view of this, an embodiment of the present application provides a CRUD page generation method and system, a storage medium and an electronic device. The solution provided by the present application is applied to generate a CRUD interface of a target single table, and then a jar package containing the logic code of each operation of the CRUD interface is generated. After configuring each field of the target single table, the configured fields and the jar package are used to generate a CRUD page. The entire process does not require the user to write code, thus avoiding the user from writing repetitive code, reducing the time for developing CRUD pages, and improving development efficiency.

[0004] To achieve the above objectives, the embodiments of the present invention provide the following technical solutions:

[0005] A CRUD page generation method, comprising:

[0006] Get the form request sent by the user;

[0007] Determine the single table corresponding to the form request as the target single table;

[0008] Generate a CRUD interface corresponding to the target single table, and generate a jar package of the CRUD interface, wherein the jar package contains logic codes for various operations of the CRUD interface;

[0009] Acquire each field of the target single table, and display each field to the user so that the user can configure each field;

[0010] Apply the jar package and the configured fields to generate the CRUD page of the target table.

[0011] In the above method, optionally, determining the single table corresponding to the form request as the target single table includes:

[0012] Obtaining a database identifier and a table identifier in the form request;

[0013] Determine a database corresponding to the database identifier;

[0014] A single table corresponding to the table identifier is determined from the database, and the single table is determined as a target single table.

[0015] In the above method, optionally, determining from the database a single table corresponding to the table identifier includes:

[0016] Obtaining configuration data of the database;

[0017] Applying the configuration data to establish a link with the database;

[0018] Obtain all single tables in the database through the link established with the database;

[0019] A single table corresponding to the table identifier is determined in each of the single tables.

[0020] In the above method, optionally, generating the jar package of the CRUD interface includes:

[0021] Generate logic code for each operation of the CRUD interface;

[0022] Package each of the logic codes into a jar package.

[0023] The above method, optionally, includes configuring each of the fields:

[0024] Obtaining field selection information input by the user;

[0025] determining at least one target field in each of the fields based on the field selection information;

[0026] Obtaining configuration data of each target field input by the user;

[0027] Based on the configuration data of each of the target fields, adding a configuration identifier to each of the target fields;

[0028] All fields are determined as configured fields to complete the configuration of the fields.

[0029] In the above method, optionally, each operation of the CRUD interface includes creation, reading, updating and deletion.

[0030] The above method, optionally, after applying the jar package and the configured fields to generate the CRUD page of the target table, further includes:

[0031] Test the generated CRUD page and obtain the test result of the CRUD page;

[0032] The test result is fed back to the user.

[0033] A CRUD page generation system, comprising:

[0034] User terminals, service platforms and configuration centers;

[0035] The service platform receives the form request sent by the user terminal, uses the form request to obtain configuration data from the configuration center, and uses the configuration data to determine the target form from the database, generates a CRUD interface corresponding to the target single table, and generates a jar package of the CRUD interface, wherein the jar package contains the logic code of each operation of the CRUD interface; obtains each field of the target single table, and feeds back each field to the user terminal;

[0036] The user terminal configures each of the fields and feeds back each of the configured fields to the service platform;

[0037] The service platform applies the jar package and the configured fields to generate the CRUD page of the target single table.

[0038] In the above system, optionally, the process of the service platform using the form request to obtain configuration data from the configuration center includes:

[0039] Obtaining a database identifier and a table identifier from the form request;

[0040] The database identifier is sent to the configuration center to obtain the configuration data of the database fed back by the configuration center after the configuration center determines the database corresponding to the database identifier.

[0041] In the above system, optionally, the process of the service platform using the configuration data to determine the target form from the database includes:

[0042] establishing a link with the database using the configuration data;

[0043] Obtain all single tables in the database through the link established with the database;

[0044] A single table corresponding to the table identifier is determined in each of the single tables.

[0045] In the above system, optionally, the process of the service platform generating the jar package of the CRUD interface includes:

[0046] Generate logic code for each operation of the CRUD interface;

[0047] Package each of the logic codes into a jar package.

[0048] In the above system, optionally, the process of the user terminal configuring each of the fields includes:

[0049] Obtaining field selection information input by the user;

[0050] determining at least one target field in each of the fields based on the field selection information;

[0051] Obtaining configuration data of each target field input by the user;

[0052] Based on the configuration data of each of the target fields, adding a configuration identifier to each of the target fields;

[0053] All fields are determined as configured fields to complete the configuration of the fields.

[0054] In the above system, optionally, each operation of the CRUD interface includes create, read, update and delete.

[0055] In the above system, optionally, the service platform is further used to test the generated CRUD page to obtain the test result of the CRUD page; and feed back the test result to the user.

[0056] A storage medium includes stored instructions, wherein when the instructions are executed, a device where the storage medium is located is controlled to execute the CRUD page generation method as described above.

[0057] An electronic device includes a memory and one or more instructions, wherein the one or more instructions are stored in the memory and are configured to execute the CRUD page generation method described above by one or more processors.

[0058] Compared with the prior art, this application has the following advantages:

[0059] The present application provides a CRUD page generation method and system, a storage medium and an electronic device, comprising: determining a target single table based on a form request sent by a user, generating a CRUD interface of the target single table, and then generating a jar package containing logic codes for various operations of the CRUD interface; displaying various fields of the target single table to a user, and the user configuring various fields. After configuring various fields of the target form, the configured various fields and the jar package are used to generate a CRUD page. The entire process does not require the user to write code, thus avoiding the user from writing repetitive code, reducing the time for developing CRUD pages, and improving development efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0061] Figure 1 A method flow chart of a CRUD page generation method provided in an embodiment of the present application;

[0062] Figure 2 A flowchart of determining a single table corresponding to a form request as a target single table provided in an embodiment of the present application;

[0063] Figure 3 A flow chart of a method for determining a single table corresponding to a table identifier from a database and determining the single table as a target single table provided in an embodiment of the present application;

[0064] Figure 4 A flow chart of a method for configuring each field provided in an embodiment of the present application;

[0065] Figure 5 A diagram showing an example of a data processing scenario for a CRUD page generation system provided in an embodiment of the present application;

[0066] Figure 6 An example diagram of a visualization page for user information filling provided in an embodiment of the present application;

[0067] Figure 7 An example diagram of a visualization page of a user-written field provided in an embodiment of the present application;

[0068] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0069] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0070] In this application, the terms "comprises", "comprising" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprising a ..." does not exclude the presence of other identical elements in the process, method, article or device comprising the element.

[0071] Terminology explanation:

[0072] IDEA: IntelliJ IDEA is an integrated development environment, mainly used for Java development, but also supports many other programming languages ​​​​and frameworks.

[0073] CRUD: is a term widely used in software development, representing four basic database operations: Create, Retrieve, Update, and Delete. These four operations are an integral part of database management and software development, and are used in almost any application involving data storage.

[0074] DGS: Domain Graph Service, domain graph service.

[0075] Faced with numerous business needs, developers need to develop CRUD pages corresponding to the business needs. The functions of CRUD pages are generally similar. When developing CRUD pages, developers need to write similar codes over and over again, which causes developers to spend time constantly writing repetitive codes, which takes a lot of time and reduces development efficiency. Both front-end developers and back-end developers face this problem.

[0076] In addition to the above problems, back-end developers usually use the IDEA plug-in EasyCode during the development process. This development method requires configuring the structure of the plug-in's configuration table, as well as data types and comments, and the development process is not simple. Front-end developers can use the visual platform to build pages during the development process, assemble them into pages by dragging and dropping, and change the interface calls. This development method requires configuring components on the visual platform based on the interface returns of the back-end developers. This development method requires front-end and back-end developers to spend time communicating the configuration of the interface documents, and they need to manually change the calls of the CRUD interfaces. The entire development process is time-consuming and labor-intensive.

[0077] In order to solve the above problems, the present application provides a CRUD page generation scheme, which determines the target single table based on the form request initiated by the user, generates a CRUD interface corresponding to the target single table, and generates a jar package containing the logic code of each operation of the CRUD interface; the various fields of the target single table are displayed to the user, the user configures each field, and then the jar package and the configured fields are used to generate the CRUD page. Applying the scheme provided by the present application, when developing a CRUD page, the logic code of each operation of the CRUD interface can be generated by itself. After the user configures the fields of the single table, the CRUD page can be generated using the jar package and the configured fields. The CRUD page can be generated without the developer having to repeatedly edit the logic code of the CRUD interface, thereby reducing development time and improving development efficiency.

[0078] The present invention can be used in many general or special computing device environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multi-processor devices, distributed computing environments including any of the above devices or devices, etc. The present invention can be applied to a processor of a computer or a server.

[0079] Reference Figure 1 , which is a method flow chart of a CRUD page generation method provided in an embodiment of the present application, with reference to S101-S105, the specific description is as follows:

[0080] S101. Obtain a form request sent by a user.

[0081] The user can be a developer.

[0082] The user enters a form request on the front end, which includes but is not limited to the database identifier and table identifier entered by the user; the database identifier is the unique identifier of the database, which can be understood as the identity identifier of the database. The table identifier can also be understood as the identity identifier of a single table. The database is used to store a single table. A single table in a database refers to an independent table structure that contains data records of a specific type, and these data records do not need to be directly connected to data in other tables through relationships such as foreign keys.

[0083] S102: Determine the single table corresponding to the form request as the target single table.

[0084] Reference Figure 2 , which is a flowchart of determining a single table corresponding to a form request as a target single table provided in an embodiment of the present application, and the process refers to S201-S203, and the specific description is as follows.

[0085] S201. Obtain a database identifier and a table identifier in a form request.

[0086] Parse the form request to obtain the database ID and table ID.

[0087] S202: Determine a database corresponding to the database identifier.

[0088] After determining the database corresponding to the database identifier, preferably, determine whether the user has the authority of the database. If the user does not have the authority of the database, it is necessary to remind the user to obtain the authority of the database. After the user obtains the authority of the database, re-obtain the table identifier and then execute S203; after the user has the authority of the database, execute S203.

[0089] Preferably, the user can resend the form request at any time during the process of obtaining the database permission. If the user resends the form request, the Figure 1 Step S101 is re-executed; the table identifier in the form request may also be changed.

[0090] S203: Determine a single table corresponding to the table identifier from the database, and determine the single table as a target single table.

[0091] Reference Figure 3 , which is a flow chart of a method for determining a single table corresponding to a table identifier from a database and determining the single table as a target single table provided in an embodiment of the present application, wherein steps are as S301-S304, and related instructions are as follows.

[0092] S301. Obtain configuration data of a database.

[0093] Configuration data includes but is not limited to database address, user name, password, etc. Preferably, the configuration data can also be called a link string.

[0094] S302: Establish a link between the application configuration data and the database.

[0095] Use the configuration data to establish a link with the database. For example, connect to the database according to the database address in the configuration data, and then log in to the database using the user name and password. After the login is successful, the link with the database is established.

[0096] S303. Obtain all single tables in the database through the link established with the database.

[0097] S304: Determine the single table corresponding to the table identifier in each single table.

[0098] Each single table obtained from the database has an identifier, and the obtained table identifier is compared with the identifiers of each single table one by one, and the single table with the same identifier as the table identifier is determined as the single table corresponding to the table identifier. After the single table corresponding to the table identifier is determined, the single table is determined as the target single table.

[0099] In the solution provided by the embodiment of the present application, the database can be accurately determined using the database table identifier, and the database configuration is used to establish a link with the database to obtain a single table in the database. Then, the target single table can be accurately determined using the table identifier.

[0100] S103: Generate a CRUD interface corresponding to the target single table, and generate a jar package of the CRUD interface, wherein the jar package includes logic codes of various operations of the CRUD interface.

[0101] After determining the target single label, generate a CRUD interface corresponding to the target single label, then generate the logic code for each operation of the CRUD interface, and encapsulate each logic code into a jar package. It should be noted that the operations of the CRUD interface include but are not limited to operations such as create, read, update, and delete. The logic code for different operations is different. It should be noted that the logic code for each operation is the implementation code for the corresponding operation. In other words, after executing the logic code, the corresponding operation will be realized.

[0102] S104: Acquire each field of the target single table, and display each field to the user so that the user can configure each field.

[0103] Reference Figure 4 , which is a flow chart of a method for configuring each field provided in an embodiment of the present application, wherein the specific steps are as follows: S401-S405, and the related descriptions are as follows:

[0104] S401: Obtain field selection information input by the user.

[0105] After displaying the fields of the target single label to the user, it can be displayed to the user on the front-end interface. The user can select the field based on his or her own needs. After the user selects the field, the field selection information input by the user can be obtained. The field selection information includes the information of the field selected by the user, such as the field name and field identifier of the selected field.

[0106] S402: Determine at least one target field in each field based on the field selection information.

[0107] After receiving the field selection information, the backend determines at least one target field in each field according to the field selection information. It should be noted that the target field is the field selected by the user. When determining the target field, it can be determined according to the field name and field identifier in the field selection information.

[0108] S403: Obtain configuration data for each target field input by the user.

[0109] The user inputs the configuration data of the target field through the front-end interface. The configuration data includes but is not limited to the data type selected for the field, whether the field is displayed, whether it supports query, whether it supports modification, and other configuration information.

[0110] Furthermore, different fields support different data types. Some fields can support multiple data types. When a field supports multiple data types, the user can select the data type that the field ultimately supports when applied from the data types supported by the field according to actual needs.

[0111] Data types include but are not limited to strings, Boolean values, numbers, time formats, etc.; for example, the data types supported by Field 1 include strings, Boolean values, numbers, and time formats. If the user chooses to support a number as the data type for Field 1 when applying, then after configuration, the data type supported by Field 1 when it is subsequently put into application is a number.

[0112] S404: Based on the configuration data of each target field, add a configuration identifier to each target field.

[0113] For each target field, a configuration identifier is added to the target field based on the configuration data of the target field. Furthermore, the target field is configured by adding the configuration identifier to the target field. It should be noted that different configurations have different configuration identifiers. For example, when configuring the data type of the field, different data types have different configuration identifiers. When configuring whether the field is displayed, the identifiers for display and non-display are different. When configuring whether the field supports query, the identifiers for supporting query and not supporting query are different.

[0114] S405: Determine all fields as configured fields to complete the configuration of the fields.

[0115] All fields are determined as configured fields, where all fields include configured target fields and fields that are not configured. For example, all fields are fields A, B, C, D and E, where fields A, B and C are target fields selected by the user, and fields A, B and C are configured, then all fields are determined as configured fields, which can be understood as: the configured fields A, B and C, as well as fields C and D are determined as configured fields.

[0116] Users can configure each field of a single table according to their own needs so that the CRUD pages generated subsequently can meet their own needs.

[0117] The purpose of configuring each field of a single table is to meet user needs when generating CRUD pages later.

[0118] S105. Apply the jar package and the configured fields to generate a CRUD page for the target table.

[0119] Use the jar package and the configured fields to generate the CRUD page of the target single table, so that the page has operations such as creation, reading, updating and deletion, and the fields of the target single table can be displayed in the page. The fields in the CRUD page are set by the user in advance to meet the needs of the user when displayed, so that a CRUD page that meets the needs of the user can be generated. The fields in the generated CRUD page support calling the CRUD interface of the corresponding single table, so there is no need to frequently drag and drop components to configure the interface fields, which reduces the difficulty of opening the CRUD page and speeds up the generation of the CRUD page.

[0120] Furthermore, after the CRUD page is generated, the CRUD page is tested, mainly the functions supported by the CRUD page are tested, so as to obtain the test result of the CRUD page, which includes a specific description of the functions supported by the CRUD page, and the test result is fed back to the user so that the user can determine whether the CRUD page meets the requirements based on the test result. By testing the CRUD page, the relevant information of the functions supported by the generated CRUD page can be quickly obtained so that the user can do subsequent processing.

[0121] In the method provided in the embodiment of the present application, the form request sent by the user is obtained, and the single table corresponding to the form request is determined as the target single table; a CRUD interface corresponding to the target single table is generated, and a jar package of the CRUD interface is generated, and the jar package contains the logic code of each operation of the CRUD interface; each field of the target single table is obtained, and each field is displayed to the user so that the user can configure each field; the jar package and the configured fields are applied to generate the CRUD page of the target single table. When generating the CRUD page, the user does not need to write repetitive logic code, and the CRUD page is generated using the fields configured by the user and the jar package of the CRUD interface of the generated single table, and there is no need to frequently drag and drop components to configure the interface fields, thereby reducing the development difficulty and speeding up the development of the CRUD page.

[0122] The embodiment of the present application also provides a CRUD page generation system, which includes a user terminal, a service platform and a configuration center.

[0123] Preferably, the user terminal can be various types of computer terminals.

[0124] Among them, the service platform receives the form request sent by the user terminal, uses the form request to obtain configuration data from the configuration center, and uses the configuration data to determine the target single table from the database, generates a CRUD interface corresponding to the target single table, and generates a jar package of the CRUD interface, which contains the logic code of each operation of the CRUD interface; obtains each field of the target single table, and feeds back each field to the user terminal.

[0125] The user terminal configures each field and feeds back the configured fields to the service platform.

[0126] The service platform applies the jar package and the configured fields to generate the CRUD page of the target table.

[0127] Furthermore, the process of the service platform obtaining configuration data from the configuration center using a form request includes: obtaining a database identifier and a table identifier from the form request; sending the database identifier to the configuration center to obtain the configuration data of the database fed back by the configuration center after the configuration center determines the database corresponding to the database identifier.

[0128] The process of the service platform using configuration data to determine the target single table from the database includes: using the configuration data to establish a link with the database; obtaining all single tables in the database through the link established with the database; and determining the single table corresponding to the table identifier in each single table.

[0129] Preferably, the process of generating the jar package of the CRUD interface by the service platform, the process of configuring each field by the user terminal and other processing contents can refer to the relevant description above, and will not be repeated here.

[0130] After generating the CRUD page, the service platform can also test the generated CRUD page to obtain the test result of the CRUD page and feedback the test result to the user. The test result includes the functions supported by the CRUD page. The user can decide whether to generate a new CRUD page, modify the CRUD page, or put the CRUD page into use based on the test result.

[0131] In the system provided by the embodiment of the present application, a user can use a user terminal to send a single-table request to the service platform, and then the service platform uses the form request to obtain configuration data from the configuration center, uses the data to determine the target single table, generates the CRUD interface of the target single table, and generates a jar package containing the logic code of each operation of the CRUD interface. After obtaining the various fields configured by the user through the user terminal, the configured fields and the jar package are used to generate the CRUD page of the single table. Thus, in the process of generating the CRUD page, a jar package containing the logic code of each operation of the CRUD interface of the single table is automatically generated, and the jar package and the configured fields are subsequently used to generate the CRUD page of the single table. The entire process does not require the user to manually write code, thereby reducing the time for developers to develop CRUD pages, improving development efficiency, and eliminating the need for users to repeatedly drag components for interface matching, reducing development difficulty.

[0132] Reference Figure 5 , is a scenario example diagram of data processing of a CRUD page generation system provided in an embodiment of the present application. The User in the figure represents a user terminal, and the DGS platform represents a service platform. Preferably, the service platform is a platform that needs to provide the ability to generate a single-table CRUD interface with one click. Apollo represents a configuration center, and DB represents a database, which is the abbreviation of Datebase.

[0133] based on Figure 5 The relevant description of the data processing flow of the CRUD page generation system shown is described in detail as follows.

[0134] The user uses the user terminal to log in to the DGS platform, and then creates a new application on the DGS platform. The DGS platform then feeds back a prompt to the user terminal to enter a DB. The user terminal enters the DB name (equivalent to the database identifier mentioned above). The DGS platform pulls the DB configuration from Apollo based on the DB name entered by the user terminal, so that Apollo returns a link string (i.e., the configuration data described above) to the DGS platform. The DGS platform uses the link string to establish a link with the DB (database), thereby obtaining all tables in the DB, i.e., obtaining all single tables in the DB. The DGS platform feeds back all tables to the user terminal, i.e., feeding back an optional data table (i.e., a single table) to the user terminal, which can be understood as the table name (equivalent to the table identifier mentioned above) selected by the user terminal. The user terminal selects a data table from it and selects The data table is the target single table mentioned above, and the DGS platform generates a CRUD interface for the target single table. Further, generating a CRUD interface can be understood as generating a schema file containing the CRUD interface, and then generating a DateFecher, which is each DataFetcher for generating the CRUD interface. Preferably, each DataFetcher is a specific logic code for implementing a C / R / U / D operation, and each DataFetcher can be encapsulated into a jar package; preferably, after generating DateFecher, the completion of application construction can be fed back to the user terminal, and the user terminal can subsequently continue to configure the various fields of the target single table, and then the DGS platform uses the configured fields and jar package to generate a CRUD page.

[0135] Preferably, the user can enter the DB name and table name at the same time in the user terminal. When entering the DB name and table name, the user can enter them on the visualization page of the user terminal to request to obtain the data of the table (single table) and perform header preprocessing.

[0136] Furthermore, the process of generating a CRUD page in the CRUD page generation system provided in the embodiment of the present application can also be summarized as follows: the user uses the user terminal to log in to the GUI platform, the user uses the user terminal to fill in the database name (ie, database identifier) ​​and the table name (ie, table identifier), uploads a single table, obtains the GraphQL schema interface, selects input parameters according to the GraphQL schema, waits for the response of the interface, generates a java code jar package, and returns all fields in the table, such as Figure 6 As shown, Figure 6 This is an example diagram of a visualization page for user information filling provided in an embodiment of the present application. Figure 6 In the database column, the user can enter the name of the database, and in the table column, the user can enter the name of the single table that the user needs. Edit the fields of the returned table on the page, add flags to the fields, such as whether to delete, add, support editing, etc. Figure 7As shown, Figure 7 This is an example diagram of a visualization page of a user-written field provided in an embodiment of the present application, such as Figure 7 As shown, it contains multiple fields, such as id, name, age, etc. You can set the name of the field, whether to support query, whether to display in the table, etc. After editing the field, save the edited table field, jump to the visualization platform, preview the generated page, and generate the front-end page, that is, the CRUD page, if no modification is required.

[0137] This application uses a single table to generate CRUD java code jar package and front-end page, which can shorten the user's time and greatly reduce the cost of demand investment, improve the system's throughput capacity for demand, and allow users who cannot write front-end pages or back-end code to independently complete a complete demand; it also allows back-end users to customize some personalized needs based on the generated jar package. Front-end users no longer need to worry about the selection of components in the visualization platform, and only need to perform simple configuration in the GUI; back-end users only need to design the table structure in a standardized manner, and no longer need to worry about some structured codes and pages.

[0138] By applying the solution provided by this application, the service platform has the ability to generate a single-table CRUD interface based on opinions, which can reduce the cost of users building a backend management system, reduce the migration cost of users, provide code generation capabilities, and this solution obtains the metadata of a single table, infers the data type and annotation information through the metadata of the single table, and generates the field name of the code according to the convention of converting underscores to camel case, so there is no need to configure the field name additionally. This allows developers to no longer need to write duplicate code when building a backend management platform, and front-end personnel can generate CRUD pages without frequently dragging components and adapting interface fields when building pages using a visualization platform, reducing the difficulty of developing CRUD pages.

[0139] This application can apply Graphql technology. By using the server-side + dynamic data source provided by Graphql technology, the diversification of interface fields is guaranteed. Users can design field selections according to their own needs, reducing the time for front-end and back-end coordination, and dynamically generate schemas based on interface returns and single table pre-settings, reducing user operations and saving time in generating CRUD pages.

[0140] An embodiment of the present invention further provides a storage medium, which includes stored instructions, wherein when the instructions are executed, the device where the storage medium is located is controlled to execute the above-mentioned CRUD page generation method.

[0141] The embodiment of the present invention further provides an electronic device, the structural diagram of which is shown in FIG. Figure 8As shown, it specifically includes a memory 601 and one or more instructions 602, wherein the one or more instructions 602 are stored in the memory 601 and are configured to be executed by one or more processors 603 to execute the one or more instructions 602 to execute the above CRUD page generation method.

[0142] It should be noted that the information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards in the relevant regions.

[0143] The specific implementation processes and derivative methods of the above-mentioned embodiments are all within the protection scope of the present invention.

[0144] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can refer to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system or system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiment. The system and system embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without creative work.

[0145] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0146] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A CRUD page generation method, characterized in that: include: Get the form request sent by the user; Determine the single table corresponding to the form request as the target single table; Generate a CRUD interface corresponding to the target single table, and generate a jar package of the CRUD interface, wherein the jar package contains logic codes for various operations of the CRUD interface; Acquire each field of the target single table, and display each field to the user so that the user can configure each field; Apply the jar package and the configured fields to generate the CRUD page of the target table.

2. The method according to claim 1, characterized in that The step of determining the single table corresponding to the form request as the target single table includes: Obtaining a database identifier and a table identifier in the form request; Determine a database corresponding to the database identifier; A single table corresponding to the table identifier is determined from the database, and the single table is determined as a target single table.

3. The method according to claim 2, characterized in that The determining the single table corresponding to the table identifier from the database includes: Obtaining configuration data of the database; Applying the configuration data to establish a link with the database; Obtain all single tables in the database through the link established with the database; A single table corresponding to the table identifier is determined in each of the single tables.

4. The method according to claim 1, characterized in that: The jar package for generating the CRUD interface includes: Generate logic code for each operation of the CRUD interface; Package each of the logic codes into a jar package.

5. The method according to claim 1, characterized in that The process of configuring each of the fields includes: Obtaining field selection information input by the user; determining at least one target field in each of the fields based on the field selection information; Obtaining configuration data of each target field input by the user; Based on the configuration data of each of the target fields, adding a configuration identifier to each of the target fields; All fields are determined as configured fields to complete the configuration of the fields.

6. The method according to claim 1, characterized in that The operations of the CRUD interface include create, read, update and delete.

7. The method according to claim 1, characterized in that After applying the jar package and the configured fields to generate the CRUD page of the target table, it also includes: Test the generated CRUD page and obtain the test result of the CRUD page; The test result is fed back to the user.

8. A CRUD page generation system, characterized in that: include: User terminals, service platforms and configuration centers; The service platform receives the form request sent by the user terminal, uses the form request to obtain configuration data from the configuration center, and uses the configuration data to determine the target form from the database, generates a CRUD interface corresponding to the target single table, and generates a jar package of the CRUD interface, wherein the jar package contains the logic code of each operation of the CRUD interface; obtains each field of the target single table, and feeds back each field to the user terminal; The user terminal configures each of the fields and feeds back each of the configured fields to the service platform; The service platform applies the jar package and the configured fields to generate the CRUD page of the target single table.

9. A storage medium, characterized in that: The storage medium includes stored instructions, wherein when the instructions are executed, the device where the storage medium is located is controlled to execute the CRUD page generation method according to any one of claims 1 to 7.

10. An electronic device, characterized in that: The system comprises a memory and one or more instructions, wherein the one or more instructions are stored in the memory and configured to be executed by one or more processors to execute the CRUD page generation method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Code generation method in front-end and back-end separation development mode

    CN115904327A

  • Configuration generation method and device of operation function page, equipment and storage medium

    CN117874387A

  • System and a method for automating application development and deployment

    US20210149648A1