Visual code rapid generation method and system based on template configuration
By building a standardized code asset library and dynamic templates, and providing a visual configuration interface, the system solves the problems of insufficient flexibility and difficulty in front-end and back-end collaboration in traditional code generators, and achieves efficient, flexible and standardized code generation to adapt to diverse technology stacks and business needs.
Patent Information
- Application Number
- CN202511458743.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-13
- Publication Date
- 2026-01-09
AI Technical Summary
Traditional code generators suffer from problems such as rigid code generation logic, low code reusability, insufficient visualization, and difficulty in front-end and back-end collaboration, resulting in low development efficiency and difficulty in adapting to diverse technology stacks and business needs.
It adopts a template-based visual code generation method, which provides a visual configuration interface by building a standardized code asset library and dynamic templates, supports flexible adaptation to multiple technology stacks, and ensures the consistency of front-end and back-end code styles through a four-layer template architecture design.
It improves development efficiency, enhances the flexibility and adaptability of code generation, achieves efficient, flexible and standardized code generation, lowers the development threshold, and ensures that the generated code is reusable in different projects and that the front-end and back-end are consistent.
Smart Images

Figure CN121300765A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of software development auxiliary tools technology, specifically relating to a method and system for rapid generation of visual code based on template configuration. Background Technology
[0002] In the field of software development, code generation tools are crucial for improving development efficiency and ensuring code quality. Research on code generator technology continues to deepen both domestically and internationally. Internationally, frameworks like the Wasp use Domain-Specific Languages (DSLs) to describe application structures and automatically generate full-stack code; the OutSystems low-code platform lowers the development threshold through visual drag-and-drop; and the AI programming tool Sourcegraph Ampcode utilizes large models to generate code snippets. Domestically, Alibaba's LowCodeEngine low-code platform combines DSLs with template engines; Huawei Cloud's AppCube low-code platform provides multi-technology stack support; and Baidu's Comate AI IDE development environment enables one-click conversion of design drafts into code. Currently, mainstream code generation technologies include template engine-based tools, low-code platforms, AI-assisted code generation, and collaborative generation using multiple template types. However, existing code generation technologies still have the following shortcomings:
[0003] 1. Lack of dynamic template configuration: Traditional code generators typically use predefined fixed templates, preventing users from dynamically adjusting the project structure or code logic according to project needs. For example, when a company changes its front-end framework (such as upgrading from Vue2 to Vue3), it needs to redevelop the entire template system, resulting in extremely high maintenance costs.
[0004] 2. Insufficient visualization: Most existing tools rely on text configuration files (such as JSON / YAML) to define the view structure, requiring developers to have strong technical skills.
[0005] 3. Low code reusability: The code generated by traditional tools is often strongly coupled with specific business scenarios, making it difficult to reuse in different projects.
[0006] 4. Difficulty in front-end and back-end collaboration: Existing solutions can usually only generate a single type of code (front-end or back-end) and lack a unified template management mechanism.
[0007] In summary, current code generation technology is evolving from static templates to dynamic configurations, from single-type to multi-template collaboration, and from technology-driven to business-driven approaches. There is an urgent need for a more flexible code generation tool to address the shortcomings of traditional code generators, such as insufficient flexibility, poor scalability, and high maintenance costs, providing an efficient and flexible solution for enterprise digital transformation. Summary of the Invention
[0008] The technical problem this invention aims to solve is that, in the software development process, traditional code generators generally suffer from problems such as rigid code generation logic, low code reusability, insufficient visualization, and difficulties in front-end and back-end collaboration. Their fixed code generation logic makes it difficult to adapt to changes in different technology stacks and business needs. When faced with diverse project requirements, developers need to repeatedly modify the underlying code. At the same time, the lack of standardized template management and visual configuration methods makes the code generation process inefficient, and the generated code is difficult to reuse in different projects. When integrating front-end and back-end code, problems such as inconsistent styles and inconsistent data models are also prone to occur.
[0009] To address the aforementioned technical issues, this invention provides a method and system for rapid code generation based on template configuration and visualization. Through dynamically configured code generation logic, it supports online association and switching of project templates across different technology stacks, enabling flexible adaptation to different technology stacks. Utilizing a standardized template management system, including project templates, code templates, view templates, and layout templates, it abstracts common code snippets into reusable modules, improving code reusability. The visual configuration interface and template separation design lower the technical barrier for developers and improve view configuration efficiency. A four-layer template architecture design ensures consistent and compatible front-end and back-end code styles, thereby achieving efficient, flexible, and standardized rapid code generation to meet diverse software development needs.
[0010] To achieve the above objectives, the present invention adopts the following technical solution:
[0011] In a first aspect, the present invention provides a method for rapid generation of visual code based on template configuration, comprising the following steps:
[0012] Step 1: Organize code standards and build a standardized code asset library that conforms to code specifications; the standardized code asset library includes standardized code for front-end projects, standardized code for back-end projects, standardized code for components, and standardized code for basic functions;
[0013] Step 2: Based on the standardized code asset library, construct dynamic templates; the dynamic templates include project templates, code templates, view templates, and layout templates;
[0014] Step 3: Based on the dynamic template, provide the user with a visual configuration interface;
[0015] Step 4: Obtain the user's configuration information on the visual configuration interface, and generate entity code based on the configuration information and the dynamic template.
[0016] Secondly, the present invention provides a template-configured visual code rapid generation system, comprising:
[0017] The standardized code asset library construction module is used to organize code standards and build a standardized code asset library that conforms to code specifications; the standardized code asset library includes standardized code for front-end engineering, standardized code for back-end engineering, standardized code for components, and standardized code for basic functions;
[0018] A dynamic template building module is used to build dynamic templates based on the standardized code asset library; the dynamic templates include project templates, code templates, view templates, and layout templates.
[0019] A visual configuration module is used to provide a visual configuration interface for users based on the dynamic template;
[0020] The code generation module is used to obtain the configuration information of the user in the visual configuration interface, and generate entity code based on the configuration information and the dynamic template.
[0021] The beneficial effects of this invention are as follows:
[0022] The present invention stems from the need to overcome the limitations of traditional code generation tools. Traditional code generators, due to their fixed code generation logic, require frequent modifications to the underlying code when facing diverse technology stacks and personalized business scenarios, resulting in low development efficiency and poor adaptability. Furthermore, the lack of standardized template management and visual configuration capabilities leads to inconsistent code quality and high team collaboration costs. To address these issues, this invention, based on dynamic configuration and template-based principles, constructs a flexible, adaptable, and highly collaborative code generation system.
[0023] First, this invention significantly improves development efficiency. Developers no longer need to write complex scripts; they can configure the display style and field attributes of business modules simply through a web-based configuration interface. Combined with four pre-defined templates, code is quickly generated, drastically reducing project initialization and coding time. Second, this invention enhances the flexibility and adaptability of code generation. Existing tools often rely on fixed templates, making it difficult to adapt to diverse technology stacks and business scenarios. The project templates designed in this invention support multiple technology stacks, including front-end Vue3 and back-end Springboot, and can be dynamically adjusted through initial template variable settings and online association. The categorized management and custom extension mechanism of code templates, view templates, and layout templates can meet complex layouts such as single tables, master-child tables, and trees, as well as personalized business needs, completely breaking free from the rigid limitations of traditional tools. Third, by organizing sample projects and general templates that conform to coding standards, and combining standardized four-type template configurations, this invention ensures that the generated scaffolding projects and front-end and back-end code follow unified development standards, reducing inconsistencies in style and logical errors caused by manual coding, and improving team collaboration efficiency. Attached Figure Description
[0024] Figure 1This is a flowchart of the template-based visual code rapid generation method of the present invention.
[0025] Figure 2 This is a flowchart illustrating the usage of the template-based visual code rapid generation system of the present invention. Detailed Implementation
[0026] The present invention will be further described below with reference to the accompanying drawings and embodiments.
[0027] The term “exemplary” as used herein means “serving as an example, embodiment, or illustration.” Any embodiment illustrated herein as “exemplary” is not necessarily to be construed as superior to or better than other embodiments.
[0028] The terms “first”, “second”, etc., are used to distinguish similar objects, not to describe or indicate a specific order or sequence.
[0029] The term "comprising" or any other similar term is intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus / device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent in such process, method, article, or apparatus / device.
[0030] Furthermore, to better illustrate the present invention, numerous specific details are provided in the following detailed embodiments. Those skilled in the art should understand that the present invention can be practiced without certain specific details. In some instances, methods, means, elements, and circuits well known to those skilled in the art have not been described in detail in order to highlight the spirit of the invention.
[0031] Figure 1 A flowchart illustrating the template-configured visual code rapid generation method of the present invention is shown, such as... Figure 1 As shown, the method includes the following steps:
[0032] Step 1: Organize code standards and build a standardized code asset library; the standardized code asset library includes standardized code for front-end engineering, standardized code for back-end engineering, standardized code for components, and standardized code for basic functions.
[0033] We will organize and analyze front-end and back-end example projects and general code templates for software development, and construct a standard structure that conforms to coding standards. Specifically, we will analyze common business scenarios in daily development, extract the common scaffolding project structure for both front-end and back-end, and code snippets with common functions such as CRUD operations (add, delete, update, query), import, and export. We will then standardize the scaffolding project structure and code snippets to conform to the coding standards recognized by the company or industry, forming example projects and general code templates as the basic resources for subsequent code generation.
[0034] The core objective of Step 1 is to accumulate general, standardized, and reusable code assets, providing a foundation for subsequent template configuration. This involves systematically organizing and reviewing code by technology layer to build a standardized code asset library, specifically including:
[0035] Front-end project code organization: Extract standardized project structures (such as routing, state management, and fixed patterns for request encapsulation) of technology stacks such as Vue3, common components (macro controls such as tables, forms, and pop-ups), and basic functions (permission interception and environment configuration), and output front-end project template code that conforms to team specifications (i.e., standardized front-end project code).
[0036] Backend project code streamlining: Based on frameworks such as Spring Boot, organize the common structure of REST interfaces, Service logic, and DAO layer operations (such as unified return format for CRUD operations and exception handling), as well as basic configurations such as database connection and transaction management, to form standardized backend project code.
[0037] Component code review: Covering front-end user interface (UI) components (such as button groups and drop-down selections) and back-end utility components (such as encryption, decryption, upload, download, and date processing), clarifying component input parameters, logic, and output specifications to ensure cross-project reusability.
[0038] Basic function code review: Focus on high-frequency business requirements (such as CRUD operations, uniqueness checks, import / export, and batch operations), extract common logic, and unify code style and naming conventions through review to avoid redundant development.
[0039] This invention transforms scattered coding experience into actionable code assets through standardized organization. These assets can be directly reused in subsequent template configurations, ensuring code quality and development efficiency from the source.
[0040] Step 2: Dynamic template configuration. Design a flexible and scalable template system. Based on well-organized standardized code (i.e., standardized code asset library), construct four types of dynamic templates: project templates, code templates, view templates, and layout templates to achieve visual configuration.
[0041] For example, step 2 specifically includes: splitting the standardized code into front-end and back-end scaffolding project structure parts, code parts, layout parts, and view parts; converting each of the split parts into template formats and maintaining them in project templates, code templates, layout templates, and view templates respectively.
[0042] Project Templates: Define standardized front-end or back-end basic project structures according to the foundation development specifications. The project structure includes basic components such as project directory architecture, configuration files, and dependency packages. It supports setting initial variables for customizing specific parameters during project initialization. It provides an initialization import function to import preset basic code or configurations. It also has an online template association function to establish connections with other related templates.
[0043] The project template, through standardized definition and dynamic configuration mechanisms, enables rapid initialization and flexible customization of the project's basic structure. First, a standardized front-end or back-end basic project structure is constructed based on code development standards, forming standardized template resources such as front-end Vue3 templates and back-end Spring Boot templates. These templates cover the core attribute configurations required throughout the project lifecycle, including the project template name, front-end / back-end project type, development language (Vue, Java, etc.), packaging method, build method, architecture type, and update version, ensuring that the templates comply with enterprise or industry code standard requirements. At the dynamic code generation mechanism level, initial variable settings and variable set management functions are designed for the template. Users (i.e., developers) can predefine variable parameters in the template, such as project name, package name, and author information. When generating code based on the template, this invention automatically replaces the actual business data in the variable set with the corresponding positions in the template according to business needs, achieving dynamic code generation. For example, when generating a back-end Spring Boot project, key parameters such as project dependency version numbers and database connection addresses can be automatically filled in based on the variable set information, avoiding the inefficiency and configuration errors caused by manual coding. For the construction of engineering scaffolding, this invention provides a visual scaffolding configuration function, using a tree structure to achieve hierarchical management of templates. Users can flexibly configure resources such as folders, text files, binary files, code templates, and module paths. Taking the construction of a front-end Vue3 project as an example, developers can quickly add component folders and route configuration files in the visual interface, and import common form validation code templates through template association, efficiently building the project skeleton. In addition, the project templates support the convenient import of third-party components. Through the component dependency management module, developers can add various component libraries according to project needs. This invention automatically parses component dependencies and integrates component configuration information and code snippets into the corresponding template files when generating the project, ensuring the integrity of the project environment. At the same time, the project templates have the ability to initialize import and online template association. The former supports the quick import of preset project configurations or code snippets, while the latter enables resource sharing and collaboration between different templates. For example, a common log processing code template can be associated with multiple backend project templates, further improving development efficiency and ultimately forming a dynamically configurable, highly reusable standardized project template system.
[0044] Code templates: Code templates are categorized and managed according to function and type (i.e., business scenario). They include built-in general front-end macro controls, base front-end Vue views, back-end REST / Service / Dao code templates, and layout templates such as single table, master-child table, and tree. Corresponding parameters and rules can be set for each type of code template to adapt to the code generation needs of different business scenarios.
[0045] Code templates categorize and manage code snippets according to business scenarios, such as "single table CRUD operations", "master-child table association operations", and "import-export utility classes". The well-organized common code is encapsulated into templates, which support dynamic variables and adapt to different business table structures.
[0046] Layout Templates: View templates are categorized by layout. Each layout template contains a set of view templates, layout parameters, and views. The layout parameters are used to define the style, size, arrangement, and other attributes of the layout. By setting the layout templates, the definitions of specific layouts and functions can be initialized and generated.
[0047] The layout template focuses on view layout logic, defining layout rules for typical pages such as "single table", "master-child table", and "tree structure", including layout parameters and view relationships, providing a "layout framework" for view template generation.
[0048] View Templates: Used to generate the schema (JSON description) for the visual view designer; quickly generate the corresponding view schema based on the layout template definition and initialization parameters, combined with business requirements; support custom extensions to meet the view design needs of special business scenarios.
[0049] The view template outputs a schema (JSON description) for the visual view designer, configuring the specific interactions of page components based on layout template rules. Developers can define the view structure via JSON or adjust it based on the visual interface to achieve a WYSIWYG view configuration.
[0050] The four types of templates in this invention work together: the engineering template provides project scaffolding, the code template fills in business logic, the layout template defines page structure, and the view template refines interaction details. Through dynamic configuration of variables and association reuse, the templates can be adapted to different business scenarios.
[0051] Step 3: Visual configuration. Based on dynamic templates, a visual configuration interface is provided to users, reducing the development threshold and making the configuration "what you see is what you get".
[0052] Specifically, it provides users with a visual configuration function on the web. Through this configuration interface, developers can configure the display style of business modules according to business needs, including visual elements such as colors, fonts, and icons; set the attributes of fields, such as field name, data type, length, and whether they are required; and generate a visual view based on the above configuration information, combined with view templates and layout templates.
[0053] Step 3, relying on four types of templates, provides developers with a wizard-driven initialization and web-based visual form design interface, fundamentally addressing the issues of "complex template configuration and high development barriers." The system guides users through pop-ups / step bars, directing them to configure basic parameters according to template type: selecting front-end / back-end projects, setting project name, package name, initial version, and other variables; users select reusable business templates, and the system automatically associates corresponding code snippets; users visually select predefined layout templates based on business needs and preview the page structure; based on the layout, a view schema is dynamically generated through drag-and-drop and field configuration, directly mapping to the front-end visual designer; for complex business scenarios, a "what you see is what you get" form designer supports dragging components to the canvas, real-time adjustment of layout and style, association with back-end interfaces, automatic binding of table data sources, and configuration of interactive logic. The final generated configuration information is linked with the template system, providing accurate input for code generation.
[0054] Step 4: Entity code generation, dynamic template splicing, and output of directly runnable code.
[0055] Specifically, it involves: obtaining the user's configuration information in the visual configuration interface, as well as the defined project templates and code templates; and, based on the configuration information and template rules, combining the code snippets in the general code template (i.e., the standardized code asset library) with the business-specific configuration information to instantiate and customize the project template, thereby quickly generating scaffolding projects and front-end and back-end code that adapt to business needs.
[0056] Based on the standardized templates and visual configurations of the first three steps, this invention automatically generates directly usable code assets through dynamic template splicing, variable replacement, and dependency integration.
[0057] This invention addresses the lack of dynamic template configuration in existing code generation tools by enabling online association and switching of project templates across different technology stacks through a dynamic template configuration mechanism. It achieves a fully visual interface design through the separation of view and layout templates, allowing developers to generate compliant front-end view schemas simply by dragging and dropping configurations, thus resolving the insufficient visualization capabilities of existing tools. Furthermore, it abstracts basic functions such as CRUD operations into independent modules using standardized code snippet extraction technology and enables cross-project reuse through parameterized configuration, addressing the low code reusability issue of traditional tools. Finally, its four-layer template architecture design (project template, code template, view template, and layout template) achieves end-to-end collaboration from project initialization to view rendering, ensuring consistent and compatible front-end and back-end code styles, thus solving the problem of difficult front-end and back-end collaboration in existing code generation technologies.
[0058] This invention also proposes a template-configurable visual code rapid generation system to implement the aforementioned template-configurable visual code rapid generation method. The system includes:
[0059] The standardized code asset library construction module is used to organize code standards and build a standardized code asset library that conforms to code specifications; the standardized code asset library includes standardized code for front-end engineering, standardized code for back-end engineering, standardized code for components, and standardized code for basic functions;
[0060] A dynamic template building module is used to build dynamic templates based on the standardized code asset library; the dynamic templates include project templates, code templates, view templates, and layout templates.
[0061] A visual configuration module is used to provide a visual configuration interface for users based on the dynamic template;
[0062] The code generation module is used to obtain the configuration information of the user in the visual configuration interface, and generate entity code based on the configuration information and the dynamic template.
[0063] The usage process of the template-configured visual code rapid generation system of the present invention will be described in detail below with reference to the accompanying drawings and embodiments.
[0064] Figure 2 This diagram illustrates the usage flowchart of the template-configured visual code rapid generation system of the present invention, such as... Figure 2 As shown, it includes the following steps:
[0065] Step 1: Select Business Objects: When developers carry out business code generation, they first need to select business objects and clarify the specific business modules to be developed, such as user management modules, order management modules, etc.
[0066] Developers define specific business modules or functional scenarios based on actual development needs, which serve as the core objective of code generation. This anchors the business direction for subsequent operations, ensuring that the generated code is built around specific business requirements. It transforms abstract business requirements into concrete objects that can be implemented and developed, making code generation more targeted.
[0067] Step 2: Select a layout template: Based on the interaction requirements of the business objects, select a suitable layout template from the layout template library, such as a single table layout or a master-child table layout, to quickly reuse a standardized page structure and save the trouble of manually building a page framework.
[0068] After selecting a business object, a page layout structure suitable for the display and interaction requirements of that business is chosen from a pre-built layout template library. The layout templates are standardized page frameworks extracted from common business scenarios (such as single table, master-child table relationships, tree structures, etc.). By reusing layout templates, developers do not need to manually build the basic page structure, which can improve development efficiency while ensuring the standardization and consistency of page layout.
[0069] Step 3: Personalized Business Attribute Settings: Based on the layout template, customize exclusive business fields, logic, and interaction rules, such as defining display fields, setting required fields, and business rules and interaction logic, transforming the general layout into a personalized template that fits the business.
[0070] Based on the selected layout template, customized configurations are made for business-specific fields, logic rules, and interactive behaviors. Developers need to define the specific fields and field attributes displayed on the page. This step adapts the general layout template to a personalized template that fits the specific business, providing precise business parameters for subsequent visual design and code generation, ensuring that the generated code accurately responds to business requirements.
[0071] Step 4, Web Visual Design: With the help of a visual interface, you can achieve WYSIWYG interactive design by dragging and dropping components, adjusting layout and style, and associating with configured business parameters to quickly verify business requirements.
[0072] Leveraging a web-based visual design interface, developers can perform WYSIWYG design and adjustments to page details through drag-and-drop and configuration interactions. On the visual canvas, developers can freely drag and drop components to suitable positions, adjust component styles and layouts, and preview page interactions in real time. This process is linked to fields and logic defined in "Business Attribute Personalization Settings," ensuring that the visual design's interactive effects are closely integrated with business requirements. This eliminates the need for complex coding, lowers the development threshold, and allows for rapid verification of whether the presentation of business requirements meets expectations.
[0073] Step 5: Select a code generation template as needed (i.e., code generation template): After completing the interaction design, select a code generation template as needed. Choose the corresponding front-end (such as Vue3) or back-end (such as SpringBoot) code generation template from the code template library to ensure that the code complies with technical specifications.
[0074] Based on the technology stack involved in the business object, the corresponding front-end and back-end code generation templates can be selected from the code template library as needed to ensure that the generated code meets the requirements and can be directly integrated into the project, realizing collaborative generation of front-end and back-end code and improving the relevance and usability of code generation.
[0075] Step 6, Entity Code Generation (i.e., Code Output): Based on the configuration of each step, the system automatically splices and replaces variables to dynamically generate a complete front-end and back-end code package that can be directly imported into the Integrated Development Environment (IDE) for execution. This achieves efficient transformation from business requirements to usable code, helping developers to quickly carry out project iteration and deployment.
[0076] Based on the information from the previous steps, the system automatically performs template splicing, variable replacement, and other operations to generate ready-to-run front-end and back-end code. The front-end transforms the visually designed page structure, configured business fields, and logic into Vue component code containing HyperText Markup Language (HTML) structure, TypeScript (TS) interaction logic, and Cascading Style Sheets (CSS) styles, while automatically handling component registration, route configuration, and dependency import. The back-end, based on business attributes and logic, generates code for REST interfaces, Service business logic processing, and Mapper database operations under the Spring Boot framework, completing dependency injection, exception handling, and other configurations. Finally, a complete code package is output, which developers can directly import into development tools for deployment, debugging, and iteration without manually writing basic code.
[0077] The contents not described in detail in this specification are existing technologies known to those skilled in the art.
[0078] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the present invention. The above descriptions are exemplary and not exhaustive. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for rapid generation of visual code based on template configuration, characterized in that, Includes the following steps: Step 1: Organize code standards and build a standardized code asset library that conforms to code specifications; the standardized code asset library includes standardized code for front-end projects, standardized code for back-end projects, standardized code for components, and standardized code for basic functions; Step 2: Based on the standardized code asset library, construct a dynamic template; The dynamic templates include project templates, code templates, view templates, and layout templates; Step 3: Based on the dynamic template, provide the user with a visual configuration interface; Step 4: Obtain the user's configuration information on the visual configuration interface, and generate entity code based on the configuration information and the dynamic template.
2. The method according to claim 1, characterized in that, Step 1 specifically includes: This study analyzes common business scenarios encountered during daily development, extracts a common scaffolding project structure for both front-end and back-end development, and code snippets with common functionalities, including adding, deleting, updating, querying, importing, and exporting. The scaffolding structure and the code snippets are standardized to conform to code specifications, forming a standardized code asset library that serves as the foundation for subsequent code generation.
3. The method according to claim 1, characterized in that, The project template is used to define a standardized front-end or back-end basic project structure according to the foundation development specifications; the project structure includes the project directory structure, configuration files, and dependency packages; The project template supports setting initial variables for customizing specific parameters during project initialization; it provides an initialization import function to import preset basic code or configurations; and it has an online template association function to establish connections with other related templates.
4. The method according to claim 1, characterized in that, The code templates are used to classify and manage code snippets according to business scenarios; The code template includes a built-in general-purpose front-end macro control, a base front-end Vue view, a back-end Rest / Service / Dao code template, and various layout templates; The various layout templates include single table, master-child table, and tree; Each type of code template has corresponding parameters and rules to adapt to the code generation needs of different business scenarios.
5. The method according to claim 1, characterized in that, The layout template is used to classify the layout of the view template; Each layout template contains a set of view templates, layout parameters, and views; the layout parameters are used to define layout attributes; the layout attributes include the layout style, size, and arrangement; by setting the layout template, the definition of a specific layout and function can be initialized and generated.
6. The method according to claim 1, characterized in that, The view template is used to generate a schema for the visual view designer based on the definition and initialization parameters of the layout template and in combination with business requirements. The view template supports custom extensions to meet the view design needs of specific business scenarios.
7. The method according to claim 1, characterized in that, Step 2 specifically includes: The standardized code in the standardized code asset library is divided into front-end and back-end scaffolding engineering structure, code, layout, and view parts; The resulting parts are converted into template formats and maintained in project templates, code templates, layout templates, and view templates, respectively.
8. The method according to claim 1, characterized in that, Step 3 specifically includes: Based on the dynamic template, a visual configuration interface is provided to users on the web. Through the visual configuration interface, users can configure the display style of business modules and set field attributes according to business needs. The display style includes color, font, and icon. The field attributes include field name, data type, length, and whether it is required. Based on the user's configuration information, a visual view is generated by combining the view template and the layout template.
9. The method according to claim 1, characterized in that, Step 4 specifically includes: Obtain the configuration information, as well as the constructed project template and code template; Based on the configuration information and the template rules of the project template and the code template, the code snippets in the standardized code asset library are combined with the business-specific configuration information to instantiate and customize the project template, generating a scaffolding project and front-end and back-end code adapted to business needs.
10. A template-configurable visual code rapid generation system, characterized in that, include: The standardized code asset library construction module is used to organize code standards and build a standardized code asset library that conforms to code specifications; the standardized code asset library includes standardized code for front-end engineering, standardized code for back-end engineering, standardized code for components, and standardized code for basic functions; A dynamic template building module is used to build dynamic templates based on the standardized code asset library; The dynamic templates include project templates, code templates, view templates, and layout templates; A visual configuration module is used to provide a visual configuration interface for users based on the dynamic template; The code generation module is used to obtain the configuration information of the user in the visual configuration interface, and generate entity code based on the configuration information and the dynamic template.
Citation Information
Patent Citations
System construction method for generating front-end and back-end codes based on dragging mode
CN113918140A
Method and system for automatically generating front-end list componentized codes based on visual configuration
CN120631353A
Template-based application development system
US20030221184A1
Data caching, dynamic code generation, and data visualization technology
US20200341903A1
Page project development method, apparatus, device, medium and product
WO2024066825A1