CN117111957A - Code generation method, device, computer equipment and storage medium - Google Patents

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

Info

Publication number
CN117111957A
CN117111957A CN202311134915.7A CN202311134915A CN117111957A CN 117111957 A CN117111957 A CN 117111957A CN 202311134915 A CN202311134915 A CN 202311134915A CN 117111957 A CN117111957 A CN 117111957A
Authority
CN
China
Prior art keywords
code
idea
software
generating
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311134915.7A
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.)
Ping An Health Insurance Company of China Ltd
Original Assignee
Ping An Health Insurance Company of China 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 Ping An Health Insurance Company of China Ltd filed Critical Ping An Health Insurance Company of China Ltd
Priority to CN202311134915.7A priority Critical patent/CN117111957A/en
Publication of CN117111957A publication Critical patent/CN117111957A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/44Encoding
    • G06F8/447Target code generation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/36Software reuse
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • G06F9/44526Plug-ins; Add-ons
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The application belongs to the technical field of data processing, and relates to a code generation method, which comprises the steps of obtaining an easy code plug-in, and installing the easy code plug-in IDEA software; when receiving a selection instruction of a database, acquiring a connection configuration of a target database according to the selection instruction, and connecting the target database with the IDEA software according to the connection configuration; acquiring a service table to be processed in the target database; and generating a code file corresponding to the service table to be processed based on the easy code plug-in and the code generation template in the IDEA software. The application also provides a code generation device, computer equipment and a storage medium. The application simplifies the code generation flow by integrating the easy code plug-in the IDEA software and combining the database service table, thereby improving the development efficiency and reducing the maintenance cost and difficulty of the code.

Description

Code generation method, device, computer equipment and storage medium
Technical Field
The present application relates to the field of data processing technologies, and in particular, to a code generating method, a code generating device, a computer device, and a storage medium.
Background
Currently, there are some code generation tools and frameworks in the industry, such as: myBatis Generator, spring Roo, hibernate, etc. tools that are capable of generating corresponding Java classes and database opcodes from database table structures. However, these tools suffer from a number of drawbacks or shortcomings, such as: the codes generated by the tools lack flexibility, are not easy to meet various medical service requirements, insurance service requirements or financial service requirements and the like, and often contain redundant codes and repeated logic, so that the maintenance cost and difficulty of the codes are increased.
Disclosure of Invention
The embodiment of the application aims to provide a code generation method, a device, computer equipment and a storage medium, which are used for solving the problems that the code generated by the existing tool lacks flexibility and the maintenance cost and difficulty of the code are increased.
In order to solve the above technical problems, the embodiment of the present application provides a code generation method, which adopts the following technical scheme:
acquiring an easy code plug-in, and installing the easy code plug-in to the IDEA software;
when a selection instruction of a database is received, acquiring a connection configuration of a target database according to the selection instruction, and connecting the target database with the IDEA software according to the connection configuration;
acquiring a service table to be processed in the target database; and
and generating a code file corresponding to the service table to be processed based on the easy code plug-in and the code generation template in the IDEA software.
Further, the step of generating the code file corresponding to the service table to be processed based on the easy code plug-in and the code generation template in the IDEA software includes:
creating an object code generation template;
responding to the trigger importing operation of the target code generating template, and importing the target code generating template into the IDEA software through a template importing interface of the IDEA software;
and generating a code file corresponding to the service table to be processed based on the easy code plug-in and the target code generation template.
Further, the step of generating the code file corresponding to the service table to be processed based on the easy code plug-in and the object code generation template specifically includes:
responding to a code generation request of a user, calling a code generator in the easy code plug-in and acquiring a preset code generation configuration interface;
and acquiring the target code generation template from the code generation configuration interface, and generating a code file corresponding to the service table to be processed according to the target code generation template and the code generator.
Further, the step of generating the code file corresponding to the service table to be processed further includes:
analyzing the service table to be processed to obtain analysis data;
and generating a code file corresponding to the analysis data based on the code generator and the target code generation template.
Further, after the step of generating the code file corresponding to the parsing data, the method further includes:
responding to the code adjustment operation of a user, acquiring an adjustment code in the code file and acquiring an object code input by the user;
and replacing the adjusting code by the target code to obtain a target code file.
Further, the step of replacing the adjustment code with the target code further includes, after the step of obtaining;
judging whether the target code file meets the service requirement of the service table to be processed;
if not, acquiring a preset code generation template in the IDEA software;
and generating a code file corresponding to the service table to be processed based on the easy code plug-in and the preset code generation template.
Further, the step of receiving a selection instruction of the database, obtaining a connection configuration of the target database according to the selection instruction, and connecting the target database and the IDEA software according to the connection configuration includes:
receiving a selection instruction of a database and opening a connection interface of the IDEA software;
acquiring the target database and the connection configuration corresponding to the target database according to the selection instruction;
and correspondingly inputting the connection configuration into the connection interface to realize the connection between the target database and the IDEA software.
In order to solve the above technical problem, an embodiment of the present application further provides a code generating device, including:
the installation module is used for acquiring an easy code plug-in and installing the easy code plug-in to the IDEA software;
the receiving module is used for acquiring the connection configuration of the target database according to the selection instruction when the selection instruction of the database is received, and connecting the target database with the IDEA software according to the connection configuration;
the acquisition module is used for acquiring a service table to be processed in the target database; and
and the generating module is used for generating a code file corresponding to the service table to be processed based on the easy code plug-in and the code generating template in the IDEA software.
To solve the above technical problem, embodiments of the present application further provide a computer device, where the computer device includes a memory and a processor, where the memory stores computer readable instructions, and the processor executes the computer readable instructions to implement the steps of the code generation method as described above.
To solve the above technical problem, embodiments of the present application also provide a computer-readable storage medium having stored thereon computer-readable instructions that, when executed by a processor, implement the steps of the code generation method as described above.
Compared with the prior art, the embodiment of the application has the following main beneficial effects:
the method comprises the steps of obtaining an easy code plug-in and installing the easy code plug-in IDEA software; when receiving a selection instruction of a database, acquiring a connection configuration of a target database according to the selection instruction, and connecting the target database with the IDEA software according to the connection configuration; acquiring a service table to be processed in the target database; and generating a code file corresponding to the service table to be processed based on the easy code plug-in and the code generation template in the IDEA software. The application realizes one-key generation of the full-link code by integrating the easy code plug-in the IDEA software and combining the database service table, simplifies the code generation flow, does not need to use complicated command line operation, reduces the workload of developers and repeated code writing work, thereby improving the development efficiency and reducing the maintenance cost and difficulty of the code.
Drawings
In order to more clearly illustrate the solution of the present application, a brief description will be given below of the drawings required for the description of the embodiments of the present application, it being apparent that the drawings in the following description are some embodiments of the present application, and that other drawings may be obtained from these drawings without the exercise of inventive effort for a person of ordinary skill in the art.
FIG. 1 is an exemplary system architecture diagram in which the present application may be applied;
FIG. 2 is a flow chart of one embodiment of a code generation method according to the present application;
FIG. 3 is a schematic diagram of the structure of one embodiment of a code generating apparatus according to the present application;
FIG. 4 is a schematic structural diagram of one embodiment of a computer device in accordance with the present application.
Detailed Description
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs; the terminology used in the description of the applications herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application; the terms "comprising" and "having" and any variations thereof in the description of the application and the claims and the description of the drawings above are intended to cover a non-exclusive inclusion. The terms first, second and the like in the description and in the claims or in the above-described figures, are used for distinguishing between different objects and not necessarily for describing a sequential or chronological order.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the application. The appearances of such phrases in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. Those of skill in the art will explicitly and implicitly appreciate that the embodiments described herein may be combined with other embodiments.
In order to make the person skilled in the art better understand the solution of the present application, the technical solution of the embodiment of the present application will be clearly and completely described below with reference to the accompanying drawings.
As shown in fig. 1, a system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 is used as a medium to provide communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
The user may interact with the server 105 via the network 104 using the terminal devices 101, 102, 103 to receive or send messages or the like. Various communication client applications, such as a web browser application, a shopping class application, a search class application, an instant messaging tool, a mailbox client, social platform software, etc., may be installed on the terminal devices 101, 102, 103.
The terminal devices 101, 102, 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smartphones, tablet computers, electronic book readers, MP3 players (Moving Picture Experts Group Audio Layer III, dynamic video expert compression standard audio plane 3), MP4 (Moving Picture Experts Group Audio Layer IV, dynamic video expert compression standard audio plane 4) players, laptop and desktop computers, and the like.
The server 105 may be a server providing various services, such as a background server providing support for pages displayed on the terminal devices 101, 102, 103.
It should be noted that, the code generating method provided by the embodiment of the present application is generally executed by the terminal device, and accordingly, the code generating device is generally disposed in the terminal device.
It should be understood that the number of terminal devices, networks and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
With continued reference to FIG. 2, a flow chart of one embodiment of a code generation method according to the present application is shown. The code generation method comprises the following steps:
step S201, an easy code plug-in is obtained and installed in the IDEA software.
In this embodiment, an electronic device (for example, a terminal device shown in fig. 1) on which the code generating method operates may be connected by a wired connection manner or a wireless connection manner. It should be noted that the wireless connection may include, but is not limited to, 3G/4G/5G connection, wiFi connection, bluetooth connection, wiMAX connection, zigbee connection, UWB (ultra wideband) connection, and other now known or later developed wireless connection.
In the step, the IDEA software is Java integrated development environment tool software, and the IDEA advocates intelligent coding and has the functions of intelligent selection, coding assistance, flexible typesetting, dynamic grammar detection, code checking, complete support for JSP, preset templates, perfect support for version control, intelligent codes and the like. The code generating method integrates the easy code plug-in into the IDEA software to simplify the code generating process, and does not need to use complicated command line operation, thereby improving the working efficiency and coding experience of developers.
The easy code plug-in is a plug-in of IDEA software, can generate entity, controller, service, dao, mapper and other various template files for the data table in a graphical mode, does not need any coding, and has powerful functions and simple operation.
In this embodiment, an easy code plug-in is obtained and installed in the IDEA software. Specifically, the easy code plug-in may be obtained by opening a configuration interface of the IDEA software and obtaining the easy code plug-in from a plug-in market of the configuration interface, and then installing the easy code plug-in to the IDEA software.
Step S202, when receiving a selection instruction of a database, obtaining a connection configuration of a target database according to the selection instruction, and connecting the target database with the IDEA software according to the connection configuration.
In this embodiment, when the easy code plug-in is installed in the IDEA software and the terminal device receives a selection instruction of the database, the connection configuration of the target database is obtained according to the selection instruction, and the target database and the IDEA software are connected according to the connection configuration. It should be noted that, the target database stores a service requirement table of medical service requirements, insurance service requirements, financial service requirements, or the like, for example, for the medical service requirements, the target database stores a health management platform user prescription table, which is not limited herein.
Specifically, the step of receiving a selection instruction of a database, obtaining a connection configuration of a target database according to the selection instruction, and connecting the target database and the IDEA software according to the connection configuration includes:
receiving a selection instruction of a database and opening a connection interface of the IDEA software;
acquiring the target database and the connection configuration corresponding to the target database according to the selection instruction;
and correspondingly inputting the connection configuration into the connection interface to realize the connection between the target database and the IDEA software.
In this embodiment, taking the target Database as the mysql Database as an example, a connection interface of the IDEA software is opened, that is, a Database module of the IDEA software is opened, then the mysql Database is selected as the target Database in the drop-down list, and after the target Database is selected as the mysql Database, the connection configuration of the mysql Database is configured in the IDEA software, that is, the address, the port, the user name, the password and the like of the mysql Database are input in the connection interface of the IDEA software, thereby realizing the connection between the target Database and the IDEA software.
Step S203, a service table to be processed in the target database is obtained.
In this embodiment, after the target database is connected to the IDEA software, all the service requirement tables in the target database may be obtained. Here, taking the health management platform user prescription form of the medical service requirement as an example, the health management platform user prescription form is selected as the service form to be processed.
And step S204, generating a code file corresponding to the service table to be processed based on the easy code plug-in and the code generation template in the IDEA software.
After the to-be-processed service table is selected, a code file corresponding to the to-be-processed service table is generated based on the easy code plug-in and the code generation template in the IDEA software, so that the development of specific service logic is completed. In this embodiment, after the code file and the project are deployed, the front end may directly call the user prescription inquiring list, the individual user prescription inquiring, the prescription adding, the prescription deleting, the prescription disabling interface, etc. from the health management platform, so that the generated code file can meet the medical service requirement, and unnecessary code modification and maintenance costs are reduced.
The method comprises the steps of obtaining an easy code plug-in and installing the easy code plug-in IDEA software; when receiving a selection instruction of a database, acquiring a connection configuration of a target database according to the selection instruction, and connecting the target database with the IDEA software according to the connection configuration; acquiring a service table to be processed in the target database; and generating a code file corresponding to the service table to be processed based on the easy code plug-in and the code generation template in the IDEA software. The application realizes one-key generation of the full-link code by integrating the easy code plug-in the IDEA software and combining the database service table, simplifies the code generation flow, does not need to use complicated command line operation, reduces the workload of developers and repeated code writing work, thereby improving the development efficiency and reducing the maintenance cost and difficulty of the code. For example, the development of the basic interface, the development amount of which is estimated to be about 2 hours, can be shortened to about 10 minutes, so that the development efficiency is greatly improved.
Further, the step of generating the code file corresponding to the pending service table based on the easy code plug-in and the code generation template in the IDEA software includes:
creating an object code generation template;
responding to the trigger importing operation of the target code generating template, and importing the target code generating template into the IDEA software through a template importing interface of the IDEA software;
and generating a code file corresponding to the service table to be processed based on the easy code plug-in and the target code generation template.
Specifically, because the IDEA software is internally provided with a plurality of code generation templates, in two cases, one is that the code generation template in the IDEA software meets the requirement of a health management platform user prescription form, the step of generating a code file corresponding to the service form to be processed based on the easy code plug-in and the code generation template in the IDEA software is executed; in addition, the code generating template in the IDEA software does not meet the actual development requirement, so that the target code generating template needs to be customized according to the user prescription form of the health management platform, namely, the target code generating template is created in advance, then the template importing interface of the IDEA software is opened in response to the triggering importing operation of the target code generating template, finally the target code generating template is imported into the IDEA software through the template importing interface of the IDEA software, and the code file corresponding to the service form to be processed is generated based on the easy code plug-in and the target code generating template. Therefore, in the embodiment, the code file meeting the medical service requirement can be generated by customizing the target code generation template, so that unnecessary code modification and maintenance cost are reduced. Of course, if the code generation template in the IDEA software meets the requirement of the health management platform user prescription form, the step of generating the code file corresponding to the service table to be processed based on the easy code plug-in and the code generation template in the IDEA software can be directly executed without introducing a new code generation template.
In this embodiment, a plurality of target code generating templates may be imported, so that a code file generated according to different medical service requirements, insurance service requirements or financial service requirements may be customized, and flexibility and maintainability of the code file are improved.
Further, the step of generating the code file corresponding to the service table to be processed based on the easy code plug-in and the object code generation template specifically includes:
responding to a code generation request of a user, calling a code generator in the easy code plug-in and acquiring a preset code generation configuration interface;
and acquiring the target code generation template from the code generation configuration interface, and generating a code file corresponding to the service table to be processed according to the target code generation template.
Specifically, after the to-be-processed service table is selected, a user can click an easy Code plug-in the IDEA software and select a Code generation control, and the mobile terminal calls a Code generator (such as a generator Code generator) in the easy Code plug-in and acquires a preset Code generation configuration interface in response to a Code generation request of the user, acquires the target Code generation template from the Code generation configuration interface, and automatically generates a Code file corresponding to the to-be-processed service table according to the target Code generation template and the Code generator. Of course, in this embodiment, when generating the code file, it is necessary to parse the service table to be processed to obtain parsed data, where the parsed data is data that can be identified by the easy code plug-in, and then generate a template based on the code generator and the object code, to generate the code file corresponding to the parsed data. For example, after the service table to be processed is parsed, the obtained parsed data is text string data, so that a code file is generated by adopting a mode of a code generator and an object code generation template, and the code of the programming language of the code generator is also text string, so that the code generator can directly identify the text string data and generate a final code file according to the format of the object code generation template.
After the code file is generated, all generated codes can be checked by one key, including: java code, basic SQL statements, etc. In order to enable the generated codes to better meet the actual medical service requirement scene, the code files are also required to be adjusted to generate target code files, and the target code files are the code files corresponding to the prescription form of the final health management platform user.
Specifically, in order to facilitate the adjustment of the codes in the code file, when the code file is generated, part of the TODO tags need to be adjusted in the code file, and highlighting or displaying with different colors is performed, so that a developer can conveniently and properly fine-tune the codes in the code file according to the actual medical service requirements, wherein the fine-tuning can be directly accomplished the development of basic service interfaces based on the addition, deletion, modification, inspection and the like of the prescription form of the health management platform user. In this embodiment, when a user modifies a code corresponding to a TODO tag in a code file, a mobile terminal obtains an adjustment code in the code file and obtains a target code input by the user in response to a code adjustment operation of the user, where the taizong adjustment code is a code corresponding to the TODO tag and may be a query condition code, a judgment condition code, or the like, and the target code may be a new query condition code, a judgment condition code, or the like. After the adjustment codes and the target codes are obtained, the adjustment codes are replaced by the target codes, and a final target code file is obtained.
It should be noted that, if the step of adjusting the code file to generate the target code file further includes;
judging whether the target code file meets the service requirement of the service table to be processed;
if not, acquiring a preset code generation template in the IDEA software;
and generating a code file corresponding to the service table to be processed based on the easy code plug-in and the preset code generation template.
Specifically, when a pre-customized target code generating template is adopted, and the obtained target code file still does not meet the service requirement of the to-be-processed service table, the target code generating template can be changed into a preset code generating template in IDEA software, then a code file corresponding to the to-be-processed service table is generated based on an easy code plug-in and the preset code generating template, and whether the code file meets the service requirement of the to-be-processed service table is judged. It should be noted that, when the target code file obtained by using all the preset code generating templates in the IDEA software still does not meet the service requirement of the service table to be processed, the target code generating templates meeting the service requirement of the service table to be processed need to be customized again and reintroduced into the IDEA software.
It should be noted that, when determining whether the object code file meets the service requirement of the service table to be processed, the execution result obtained after executing the object code file may be used to determine whether the service requirement of the service table to be processed is met. For example, taking a user health management platform prescription form as an example, if the execution result is the user prescription form, the target code file meets the service requirement of the service form to be processed; if the execution result is an over-the-counter table, the target code file does not meet the service requirement of the service table to be processed.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by computer readable instructions stored in a computer readable storage medium that, when executed, may comprise the steps of the embodiments of the methods described above. The storage medium may be a nonvolatile storage medium such as a magnetic disk, an optical disk, a Read-Only Memory (ROM), or a random access Memory (Random Access Memory, RAM).
It should be understood that, although the steps in the flowcharts of the figures are shown in order as indicated by the arrows, these steps are not necessarily performed in order as indicated by the arrows. The steps are not strictly limited in order and may be performed in other orders, unless explicitly stated herein. Moreover, at least some of the steps in the flowcharts of the figures may include a plurality of sub-steps or stages that are not necessarily performed at the same time, but may be performed at different times, the order of their execution not necessarily being sequential, but may be performed in turn or alternately with other steps or at least a portion of the other steps or stages.
With further reference to fig. 3, as an implementation of the method shown in fig. 2 described above, the present application provides an embodiment of a code generating apparatus, which corresponds to the method embodiment shown in fig. 2, and which is particularly applicable to various electronic devices.
As shown in fig. 3, the code generating apparatus 300 according to the present embodiment includes: an installation module 301, a receiving module 302, an obtaining module 303, and a generating module 304, wherein:
an obtaining module 301, configured to obtain an easy code plug-in, and install the easy code plug-in the IDEA software;
the receiving module 302 is configured to obtain a connection configuration of a target database according to a selection instruction when receiving the selection instruction of the database, and connect the target database with the IDEA software according to the connection configuration;
an obtaining module 303, configured to obtain a service table to be processed in the target database; and
and the generating module 304 is configured to generate a code file corresponding to the service table to be processed based on the easy code plug-in and a code generating template in the IDEA software.
The application obtains an easy code plug-in and installs the easy code plug-in to the IDEA software through an installation module 301; when receiving a selection instruction of a database, a receiving module 302 obtains a connection configuration of a target database according to the selection instruction, and connects the target database with the IDEA software according to the connection configuration; acquiring a service table to be processed in the target database through an acquisition module 303; and generating a code file corresponding to the service table to be processed through a generating module 304 based on the easy code plug-in and the code generating template in the IDEA software. The application realizes one-key generation of the full-link code by integrating the easy code plug-in the IDEA software and combining the database service table, simplifies the code generation flow, does not need to use complicated command line operation, reduces the workload of developers and repeated code writing work, thereby improving the development efficiency and reducing the maintenance cost and difficulty of the code.
In order to solve the technical problems, the embodiment of the application also provides computer equipment. Referring specifically to fig. 4, fig. 4 is a basic structural block diagram of a computer device according to the present embodiment.
The computer device 4 comprises a memory 41, a processor 42, a network interface 43 communicatively connected to each other via a system bus. It should be noted that only computer device 4 having components 41-43 is shown in the figures, but it should be understood that not all of the illustrated components are required to be implemented and that more or fewer components may be implemented instead. It will be appreciated by those skilled in the art that the computer device herein is a device capable of automatically performing numerical calculations and/or information processing in accordance with predetermined or stored instructions, the hardware of which includes, but is not limited to, microprocessors, application specific integrated circuits (Application Specific Integrated Circuit, ASICs), programmable gate arrays (fields-Programmable Gate Array, FPGAs), digital processors (Digital Signal Processor, DSPs), embedded devices, etc.
The computer equipment can be a desktop computer, a notebook computer, a palm computer, a cloud server and other computing equipment. The computer equipment can perform man-machine interaction with a user through a keyboard, a mouse, a remote controller, a touch pad or voice control equipment and the like.
The memory 41 includes at least one type of readable storage medium including flash memory, hard disk, multimedia card, card memory (e.g., SD or DX memory, etc.), random Access Memory (RAM), static Random Access Memory (SRAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), programmable Read Only Memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the storage 41 may be an internal storage unit of the computer device 4, such as a hard disk or a memory of the computer device 4. In other embodiments, the memory 41 may also be an external storage device of the computer device 4, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash Card (Flash Card) or the like, which are provided on the computer device 4. Of course, the memory 41 may also comprise both an internal memory unit of the computer device 4 and an external memory device. In this embodiment, the memory 41 is typically used to store an operating system and various types of application software installed on the computer device 4, such as computer readable instructions of a code generation method. Further, the memory 41 may be used to temporarily store various types of data that have been output or are to be output.
The processor 42 may be a central processing unit (Central Processing Unit, CPU), controller, microcontroller, microprocessor, or other data processing chip in some embodiments. The processor 42 is typically used to control the overall operation of the computer device 4. In this embodiment, the processor 42 is configured to execute computer readable instructions stored in the memory 41 or process data, such as computer readable instructions for executing the code generating method.
The network interface 43 may comprise a wireless network interface or a wired network interface, which network interface 43 is typically used for establishing a communication connection between the computer device 4 and other electronic devices.
The computer device provided in the present embodiment may execute the above-described code generation method. The code generation method here may be the code generation method of each of the above embodiments.
The method comprises the steps of obtaining an easy code plug-in and installing the easy code plug-in IDEA software; when receiving a selection instruction of a database, acquiring a connection configuration of a target database according to the selection instruction, and connecting the target database with the IDEA software according to the connection configuration; acquiring a service table to be processed in the target database; and generating a code file corresponding to the service table to be processed based on the easy code plug-in and the code generation template in the IDEA software. The application realizes one-key generation of the full-link code by integrating the easy code plug-in the IDEA software and combining the database service table, simplifies the code generation flow, does not need to use complicated command line operation, reduces the workload of developers and repeated code writing work, thereby improving the development efficiency and reducing the maintenance cost and difficulty of the code.
The present application also provides another embodiment, namely, a computer-readable storage medium storing computer-readable instructions executable by at least one processor to cause the at least one processor to perform the steps of the code generation method as described above.
The method comprises the steps of obtaining an easy code plug-in and installing the easy code plug-in IDEA software; when receiving a selection instruction of a database, acquiring a connection configuration of a target database according to the selection instruction, and connecting the target database with the IDEA software according to the connection configuration; acquiring a service table to be processed in the target database; and generating a code file corresponding to the service table to be processed based on the easy code plug-in and the code generation template in the IDEA software. The application realizes one-key generation of the full-link code by integrating the easy code plug-in the IDEA software and combining the database service table, simplifies the code generation flow, does not need to use complicated command line operation, reduces the workload of developers and repeated code writing work, thereby improving the development efficiency and reducing the maintenance cost and difficulty of the code.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) comprising instructions for causing a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the method according to the embodiments of the present application.
It is apparent that the above-described embodiments are only some embodiments of the present application, but not all embodiments, and the preferred embodiments of the present application are shown in the drawings, which do not limit the scope of the patent claims. This application may be embodied in many different forms, but rather, embodiments are provided in order to provide a thorough and complete understanding of the present disclosure. Although the application has been described in detail with reference to the foregoing embodiments, it will be apparent to those skilled in the art that modifications may be made to the embodiments described in the foregoing description, or equivalents may be substituted for elements thereof. All equivalent structures made by the content of the specification and the drawings of the application are directly or indirectly applied to other related technical fields, and are also within the scope of the application.

Claims (10)

1. A code generation method, comprising the steps of:
acquiring an easy code plug-in, and installing the easy code plug-in IDEA software;
when a selection instruction of a database is received, acquiring a connection configuration of a target database according to the selection instruction, and connecting the target database with the IDEA software according to the connection configuration;
acquiring a service table to be processed in the target database; and
and generating a code file corresponding to the service table to be processed based on the easy code plug-in and the code generation template in the IDEA software.
2. The code generation method according to claim 1, wherein the step of generating the code file corresponding to the pending service table based on the easy code plug-in and the code generation template in the IDEA software includes:
creating an object code generation template;
responding to the trigger importing operation of the target code generating template, and importing the target code generating template into the IDEA software through a template importing interface of the IDEA software;
and generating a code file corresponding to the service table to be processed based on the easy code plug-in and the target code generation template.
3. The code generating method according to claim 2, wherein the step of generating the code file corresponding to the pending service table based on the easy code plug-in and the object code generating template specifically includes:
responding to a code generation request of a user, calling a code generator in the easy code plug-in and acquiring a preset code generation configuration interface;
and acquiring the target code generation template from the code generation configuration interface, and generating a code file corresponding to the service table to be processed according to the target code generation template and the code generator.
4. The code generation method according to claim 3, wherein the step of generating the code file corresponding to the pending service table further comprises:
analyzing the service table to be processed to obtain analysis data;
and generating a code file corresponding to the analysis data based on the code generator and the target code generation template.
5. The code generation method according to claim 4, wherein after the step of generating the code file corresponding to the parsed data, further comprises:
responding to the code adjustment operation of a user, acquiring an adjustment code in the code file and acquiring an object code input by the user;
and replacing the adjusting code by the target code to obtain a target code file.
6. The code generation method according to claim 5, wherein after the step of replacing the adjustment code with the target code to obtain a target code file, further comprising;
judging whether the target code file meets the service requirement of the service table to be processed;
if not, acquiring a preset code generation template in the IDEA software;
and generating a code file corresponding to the service table to be processed based on the easy code plug-in and the preset code generation template.
7. The code generating method according to claim 1, wherein the step of receiving a selection instruction of a database, acquiring a connection configuration of a target database according to the selection instruction, and connecting the target database and the IDEA software according to the connection configuration, comprises:
receiving a selection instruction of a database and opening a connection interface of the IDEA software;
acquiring the target database and the connection configuration corresponding to the target database according to the selection instruction;
and correspondingly inputting the connection configuration into the connection interface to realize the connection between the target database and the IDEA software.
8. A code generating apparatus, comprising:
the installation module is used for acquiring an easy code plug-in and installing the easy code plug-in to the IDEA software;
the receiving module is used for acquiring the connection configuration of the target database according to the selection instruction when the selection instruction of the database is received, and connecting the target database with the IDEA software according to the connection configuration;
the acquisition module is used for acquiring a service table to be processed in the target database; and
and the generating module is used for generating a code file corresponding to the service table to be processed based on the easy code plug-in and the code generating template in the IDEA software.
9. A computer device comprising a memory having stored therein computer readable instructions which when executed by a processor implement the steps of the code generation method of any of claims 1 to 7.
10. A computer readable storage medium having stored thereon computer readable instructions which when executed by a processor implement the steps of the code generation method of any of claims 1 to 7.
CN202311134915.7A 2023-09-04 2023-09-04 Code generation method, device, computer equipment and storage medium Pending CN117111957A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311134915.7A CN117111957A (en) 2023-09-04 2023-09-04 Code generation method, device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311134915.7A CN117111957A (en) 2023-09-04 2023-09-04 Code generation method, device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117111957A true CN117111957A (en) 2023-11-24

Family

ID=88808972

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311134915.7A Pending CN117111957A (en) 2023-09-04 2023-09-04 Code generation method, device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117111957A (en)

Similar Documents

Publication Publication Date Title
CN111782304B (en) Paging loading data logic control method, device, computer equipment and medium
CN115794437A (en) Calling method and device of microservice, computer equipment and storage medium
CN112860662B (en) Automatic production data blood relationship establishment method, device, computer equipment and storage medium
CN116661936A (en) Page data processing method and device, computer equipment and storage medium
CN116974927A (en) Performance automatic test method, system, computer equipment and storage medium
CN117251228A (en) Function management method, device, computer equipment and storage medium
CN116450723A (en) Data extraction method, device, computer equipment and storage medium
CN116383787A (en) Page creation method, page creation device, computer equipment and storage medium
CN116112457A (en) Method, device, computer equipment and storage medium for notifying message
CN114626352B (en) Report automatic generation method, device, computer equipment and storage medium
CN110765610B (en) PDM integration method, PDM integration device, computer equipment and storage medium
CN117111957A (en) Code generation method, device, computer equipment and storage medium
CN116628282A (en) Data scanning method, device, computer equipment and storage medium
CN116795882A (en) Data acquisition method, device, computer equipment and storage medium
CN117278623A (en) Method and device for processing request data, computer equipment and storage medium
CN116932486A (en) File generation method, device, computer equipment and storage medium
CN116467145A (en) Page performance data acquisition method and device, computer equipment and storage medium
CN115526731A (en) Task batch processing method and device, computer equipment and storage medium
CN117395309A (en) Data reporting method, device, computer equipment and storage medium
CN115080045A (en) Link generation method and device, computer equipment and storage medium
CN104750821A (en) Service message processing method and device
CN117785181A (en) Code execution method, device, equipment and storage medium thereof
CN117112665A (en) Link data processing method and device, computer equipment and storage medium
CN116932090A (en) Tool pack loading method, device, computer equipment and storage medium
CN116541417A (en) Batch data processing method, device, computer 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