CN111813394A - Zeus framework development method based on Springboot and Zeus framework - Google Patents

Zeus framework development method based on Springboot and Zeus framework Download PDF

Info

Publication number
CN111813394A
CN111813394A CN202010446038.7A CN202010446038A CN111813394A CN 111813394 A CN111813394 A CN 111813394A CN 202010446038 A CN202010446038 A CN 202010446038A CN 111813394 A CN111813394 A CN 111813394A
Authority
CN
China
Prior art keywords
zeus
framework
file
springboot
return
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Withdrawn
Application number
CN202010446038.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.)
Guangzhou Pacific Computer Information Consulting Co ltd
Original Assignee
Guangzhou Pacific Computer Information Consulting Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Pacific Computer Information Consulting Co ltd filed Critical Guangzhou Pacific Computer Information Consulting Co ltd
Priority to CN202010446038.7A priority Critical patent/CN111813394A/en
Publication of CN111813394A publication Critical patent/CN111813394A/en
Withdrawn legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/31Programming languages or programming paradigms
    • G06F8/315Object-oriented languages

Landscapes

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

Abstract

The invention discloses a Zeus framework development method based on SpringBoot and the Zeus framework, wherein the method comprises the following steps: creating an original file of the project based on the SpringBoot framework through start. Introducing Pom files of a Zeus framework deployed on a Maven warehouse server into the original files to obtain Zeus dependency management; modifying the original file of Zeus dependency management to obtain a new Zeus framework file; and respectively generating code files corresponding to the database table under the src directory of the java file in the new Zeus framework file, wherein the code files are logic and interfaces for adding, deleting, modifying and checking the database table operation, and obtaining the Zeus framework based on the SpringBoot. According to the Zeus framework development method based on SpringBoot and the Zeus framework, the front end and the rear end are separated, so that service development can be rapidly carried out; meanwhile, an engineer can perform programming work under a preset framework, so that the phenomenon that the styles of programs are not uniform is avoided, and the efficiency of modification and maintenance is improved.

Description

Zeus framework development method based on Springboot and Zeus framework
Technical Field
The invention relates to the technical field of Web application development under microservice, in particular to a Zeus framework development method based on SpringBoot and a Zeus framework.
Background
At present, many developers use start. Firstly, in an engineering skeleton generated by start.spring.io, only component coordinate information exists, a corresponding use method and Demo codes are lacked, and a developer needs to search related use courses or code samples when using the engineering, so that the development efficiency is low; secondly, the method has more dependent package versions and complex dependent relationship, and the manual processing of the dependent complex dependent relationship easily causes unnecessary technical Bug and also causes the time multiplication of troubleshooting errors; thirdly, when the interface has abnormal service or system abnormality, the front end cannot judge whether the service data is normal through the data returned by the interface because the formats of the data returned by the interface are not uniform; meanwhile, the abnormal condition is often directly displayed on the user side, so that the user experience is poor.
Disclosure of Invention
The invention aims to provide a Zeus framework development method based on SpringBoot and the Zeus framework, wherein the Zeus framework and the method are used for carrying out global exception handling and response format unified handling by providing module dependence and component integration of the development framework, so that the occurrence rate of Bug complicated dependence is reduced, and the exception handling efficiency and the development efficiency are improved.
In order to overcome the defects in the prior art, the invention provides a Zeus framework development method based on SpringBoot, which comprises the following steps:
creating an original file of the project based on the SpringBoot framework through start.
Introducing Pom files of a Zeus framework deployed on a Maven warehouse server into the original files to obtain Zeus dependency management;
modifying the original file of Zeus dependency management to obtain a new Zeus framework file; the method comprises the following steps: adding main configuration ComponentScan and MapperScan annotation class information in an application.java file, and adding dependency information of Zeus-core and Zeus-common in an Pom file; replace the original application properties file with the application.
Respectively generating front and back end codes corresponding to the database table under the src directory of the java file in the new Zeus framework file to obtain a Zeus framework based on SpringBoot; the code is logic and interface code for the incremental, destructive, and change checking of database table operations.
Further, the configuring of the uniform response result format and the global exception handling specifically include:
when the service request is normal, packaging is carried out on the basis of the original returned service data, and information such as state codes, information, data and the like is packaged; when the abnormal service occurs, the abnormal service is packaged in a uniform response format, and then the generated return code is returned to the calling party; wherein the package is an @ controlleraddrice global package response format, and the unified response format is a Return response format and a Return code format; the return codes are Return response and Return code or custom return codes.
Further, the configuring the unified response result format includes:
creating a processing class ResponseHandler with unified response, realizing ResponseBodyAdvice, and realizing an enhancement function for a responder;
adding an annotation on the ResponseHandler class, and intercepting a request method of the RestController class;
the heavy-load beforebedewrite method uniformly uses a return response class package response result.
Further, the performing global exception handling sequentially includes:
and performing global exception handling configuration, realizing exception handling in the java class of the background, acquiring a front-end returned result, establishing a project based on a Zeus framework according to a development environment and a development tool, adding dependence of the Zeus framework in a pom file of the established project, and realizing encapsulation of a unified exception handling function.
Further, the Zeus-dependent parameter configuration includes:
configuring basic interface parameters for the Zeus framework creating process;
selecting all dependencies of the items to configure the Zeus framework;
and the configuration of the database table is carried out by inputting IP, ports, the database, user names and password import.
Further, the basic interface parameters include: group name, type, module, project name, project description, package name, packaging method, and Java version.
The invention also provides a Zeus framework based on SpringBoot, which comprises:
an original file creating unit, configured to create, by start.
A Zeus dependency obtaining unit, configured to introduce Pom files of a Zeus framework deployed in a Maven warehouse server into the original file, so as to obtain Zeus dependency management;
a file modification unit, configured to modify the original file subjected to Zeus dependency management to obtain a new Zeus framework file; the method comprises the following steps: adding main configuration ComponentScan and MapperScan annotation class information in an application.java file, and adding dependency information of Zeus-core and Zeus-common in an Pom file; replace the original application properties file with the application.
A database code generation unit: the front end code and the back end code corresponding to the database table are respectively generated under the src directory of the java file in the new Zeus framework file, and a Zeus framework based on SpringBoot is obtained; the code is logic and interface code for the incremental, destructive, and change checking of database table operations.
Further, the Zeus framework based on the SpringBoot also comprises a unified response result format configuration and a global exception handling unit; when the service request is normal, the method packages the original returned service data and packages information such as state codes, information and data; when the abnormal service occurs, the abnormal service is packaged in a uniform response format, and then the generated return code is returned to the calling party; wherein the package is an @ controlleraddrice global package response format, and the unified response format is a Return response format and a Return code format; the return codes are Return response and Return code or custom return codes.
An embodiment of the present invention further provides a computer terminal device, including:
one or more processors;
a memory coupled to the processor for storing one or more programs;
when the one or more programs are executed by the one or more processors, the one or more processors are enabled to implement the method for developing the Zeus framework based on SpringBoot as described in any one of the embodiments above.
The embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the method for developing a Zeus framework based on SpringBoot as described in any one of the above embodiments.
Compared with the prior art, the embodiment of the invention has at least the following beneficial effects:
(1) the method has the advantages that module dependence and component integration of a development framework are provided, service interfaces are provided rapidly, a series of well-defined interfaces are provided through interface management of a powerful Swagger UI, front and back ends are separated to rapidly develop services, and development efficiency is improved.
(2) The method and the system enable engineers to perform programming work under a preset architecture, avoid non-uniform program styles and improve the efficiency of modification and maintenance.
Drawings
Fig. 1 is a schematic flowchart of a Zeus framework development method based on SpringBoot according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a Zeus framework based on SpringBoot according to an embodiment of the present invention;
fig. 3 is a module connection diagram of a Zeus framework based on SpringBoot according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be understood that the step numbers used herein are for convenience of description only and are not intended as limitations on the order in which the steps are performed.
It is to be understood that the terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in the specification of the present invention and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
The terms "comprises" and "comprising" indicate the presence of the described features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
The term "and/or" refers to and includes any and all possible combinations of one or more of the associated listed items.
Referring to fig. 1, an embodiment of the present invention provides a method for developing a Zeus framework based on SpringBoot, including:
s10, creating an original file of the project based on the SpringBoot framework through start.
Integrating RabbitMQ, Kafka, ActiveMQ, MySQL, Druid, Redis and Shiro in Spring, and writing a pile of x.xml configuration files; the development procedure is very complicated; engineers are seeking simpler development methods that are not supported by JDK and java ee because these are platforms and provide only the most primitive technical support. When the Spring boot appears, the dilemma of all Java development is changed, and the design purpose of the Spring boot is to simplify the initial building and development process of a new Spring application. The framework is configured in a specific manner, so that developers do not need to define a templated configuration, the development of the Spring-based application is simplified, and an independent and product-level Spring application can be created through a small amount of code.
In this step, an original file of the project based on the SpringBoot framework is created by starting.
S20, introducing a Pom file of a Zeus framework deployed on a Maven warehouse server into the original file to obtain Zeus dependency management;
it should be noted that one core feature of the Maven server is dependency management. When we deal with multi-module projects (containing hundreds of modules or sub-projects), the dependency relationships between modules become very complex and management becomes difficult. Given this, Maven provides a highly controlled approach that can avoid the need to search all the required libraries. Maven finds the dependencies between their items by reading the item file (pom. xml). All we need to do is to define a direct dependency in the pom file of each item and then look up the dependency directly by Maven. By transitive dependence, the graphics of all the contained libraries can grow rapidly. The situation that may arise when there are duplicate banks continues to rise, where Maven provides some functionality to control the degree of dependency that can be passed.
In this step, Pom files of the Zeus framework deployed in the Maven warehouse server are introduced into the previously established original files, so as to obtain dependency management of the Zeus framework, wherein one Pom file code introduced is as follows:
<parent>
<groupId>cn.com.pcauto.zeus</groupId>
<artifactId>zeus-all</artifactId>
<version>1.0.3</version>
<relativePath/><!--lookup parent from repository-->
</parent>
by introducing Pom files, after the Zeus dependency package is completed, development can be performed through Zeus dependency management, developers do not need to care about the version and use of components, and business development can be performed through simple configuration; meanwhile, the version of the dependency package is simplified, and the problem that unnecessary technical BUG is easily caused by manually processing the dependency complex in the traditional mode and further the troubleshooting error time is multiplied is solved during development. Yml component configuration and database configuration can be completed by a developer, and then a service developer can quickly construct a web application with mainstream component ecology according to a case component using mode in a Zeus-web module of a Zeus framework, so that the cost of performing various component model selection research and version iterative difference learning by the developer is saved.
S30, modifying the original file of Zeus dependency management to obtain a new Zeus framework file; the method comprises the following steps: adding main configuration ComponentScan and MapperScan annotation class information in an application.java file, and adding dependency information of Zeus-core and Zeus-common in an Pom file; replace the original application properties file with the application.
In this step, mainly the file of the Zeus framework obtained in step S02 is modified, so as to overcome the problem that the original development mode needs to find out the relevant application course or code sample to program, because it will make the developer spend a lot of time on the iterative difference of the model selection research and learning versions of various components, resulting in waste of time. Adding annotation information of main configuration ComponentScan and MapperScan into an application.java file, directly reading annotations during development to understand and then programming, and adding dependency information of Zeus-core and Zeus-common into an Pom file, so that management of complex dependency relationships can be facilitated, and follow-up identification and searching of dependency relationships of Maven can be facilitated; then deleting the original application. Yml files are written instead at this location, again simplifying the process.
S40, respectively generating front and back end codes corresponding to the database table under the src directory of the java file in the new Zeus framework file to obtain a Zeus framework based on SpringBoot; the code is logic and interface code for the incremental, destructive, and change checking of database table operations.
The essence of the step is an integration process of the database component, and the code interface classes of the data layer and the data service interface of the application can be automatically generated by integrally modifying the database module of the Zeus framework, including the back-end logic of the complete database table for addition, deletion, modification and check. By introducing the Mybatis-plus component, small modification is performed on the basis of the Mybatis-plus component, such as adding a paging control, secondary cache interception, caching a data object and the like. The data layer and the data service interface class are automatically generated, the logical processing of the adding, deleting, modifying and checking of the database can be quickly performed to generate complete MyBatis through a code generation tool, and the code class corresponds to the entry, mapper, service and controller of the MyBatis.
In this embodiment, further, a method for configuring a unified response result format and performing global exception handling is provided, which specifically includes:
when the service request is normal, packaging is carried out on the basis of the original returned service data, and information such as state codes, information, data and the like is packaged; when the abnormal service occurs, the abnormal service is packaged in a uniform response format, and then the generated return code is returned to the calling party; wherein the package is an @ controlleraddrice global package response format, and the unified response format is a Return response format and a Return code format; the return codes are Return response and Return code or custom return codes.
It should be noted that, in the development of a project, a format returned by a front end to a data interface may have a uniform requirement, and generally includes three parts, namely, a status code, information, and data. Assume that the specification requires that the structure of the data return be as follows:
{ "data" [ { "id":5, "userId":5, "name": test1"," articleCount ":0} ]," message ": request success", "code": 200"}
Wherein the data field stores actual return data; the message represents the description information of the request; code represents a request status code; the status of successful request is generally indicated by a status code, such as 200; and a specific exception status code may be stored when an exception occurs.
To return such data, the most direct way is to process the data in each Controller, and the returned data itself contains fields such as processing code, data, and exception information when an exception occurs. However, this has the problem that each Controller exposed method creates a returned object to encapsulate the process and trap and handle the exception when it occurs. It is therefore desirable to be able to handle such transitions uniformly so that the application developer only needs to be concerned about what he otherwise needs to do: returning the data when the service request is normal; and when the service request is abnormal, throwing out proper abnormality and returning corresponding state codes and information.
Therefore, in the unified response result and global exception handling in this embodiment, when the service request is normal, a layer is encapsulated on the basis of the original returned data, and information such as the state code, information, and data is encapsulated; and when the abnormal service occurs, packaging the abnormal service in a uniform response format, and then returning the abnormal service to the calling party.
The Zeus framework uses the @ ControlLerAdvice global encapsulation response format and content, provides a Return response and Return code unified response format and a return code, and can also customize the return response code. If a problem occurs in the service logic processing process, the content format of the service error is uniformly responded after the business exception is thrown through the throw new BussinessException.
In this implementation, further, the configuring the format of the unified response result includes:
creating a processing class ResponseHandler with unified response, realizing ResponseBodyAdvice, and performing an enhancement function on a response body;
adding an annotation on the ResponseHandler class, and intercepting a request method of the RestController class;
the heavy-load beforebedewrite method uniformly uses a return response class package response result.
It is to be understood that this step is a specific step of configuring a format of the unified response result, and is specifically as follows:
1) firstly, creating a processing class ResponseHandler with unified response, realizing ResponseBodyAdvice, and performing an enhancement function on a response body;
2) adding an annotation @ controlleraddress (association) to a ResponseHandler class, and intercepting various request methods of a RestController;
3) the heavy-load beforebedewrite method uniformly uses a return response class package response result. The data structure of Return response is { "code": integral >, "message": String >, "data", < Object > }, sample code is as follows: 200 { "code", "message", "success in commit", "data", { }.
In this implementation, further, the performing global exception handling sequentially includes:
and performing global exception handling configuration, implementing exception handling in the background java class, obtaining a front-end return result, establishing a project based on a Zeus framework according to a development environment and a development tool, adding the dependence of the Zeus framework in a pom file of the established project, and implementing encapsulation of a unified exception handling function.
1) Configuration of global exception handling. The invention provides a package class cn.com.pcauto.zeus.core.exceptings.businessence exception for various service exceptions and a package class cn.com.pcauto.zeus.core.exceptings.unauthorizedException for user authentication exceptions, which process corresponding exception contents. Meanwhile, global exception capture can be realized by means of the @ controlleraddress and the @ exception handler mechanism of SprinMVC, exception types and exception information are packaged into a unified response result Return response class in a GlobalExceptionhandler class, and when a service request is abnormal, the type of response is returned to a data structure format of the front end by the class of response.
2) And (5) realizing exception handling in the background java class.
Unified exception handling provides a method for background exception handling. When the class is used in a program, only the object of the class needs to be defined and thrown out. The code is as follows: throw new businessessexception ("embodiment interface error"); the class has three overloading methods and supports parameter passing. Different abnormal information can be obtained according to different parameter types.
3) And the front end returns a result to obtain.
After the front end calls the interface request, the back end can uniformly respond to the data structure of the Return response class, and the class can package the interface result data object into json data and return the json data. And judging whether the service request is successful or not at the front end through response.
Sample codes are as follows: 500 { "code", "message", "presentation interface error", "data", null }
4) And selecting a development environment and a development tool, and establishing a project based on a Zeus framework.
5) Zeus dependence is added to the pom file of the created project, and encapsulation of a unified exception handling function is achieved.
Through the configuration, all configuration work of unified exception handling is completed.
In this implementation, further, the Zeus-dependent parameter configuration includes:
configuring basic interface parameters for the Zeus framework creating process;
selecting all dependencies of the items to configure the Zeus framework;
and the configuration of the database table is carried out by inputting IP, ports, the database, user names and password import.
It should be noted that item dependencies include, but are not limited to, Web, Mybatis, Mysql, Redis, and the like.
Further, the basic interface parameters include: group name, type, module, project name, project description, package name, packaging method, and Java version.
It should be noted that the basic interface parameters include: group Name, Type (optional Maven project and Gradle project), Artifact (module Name), Name (project Name), Description (project Description), Package Name (Package Name), Packaging (jar), Java Version.
Referring to fig. 2, in order to help understand the solution of the present invention, a schematic structural diagram of a Zeus framework based on SpringBoot according to an embodiment of the present invention is mainly used to develop an online automobile transaction platform;
in this embodiment, the modules of the online automobile transaction platform include: the core framework of Zeus based on SpringBoot of the invention introduces Pom files of Zeus framework deployed in a Maven warehouse server, and is controlled by version Pom, namely the platform building of the automobile forum can be rapidly carried out, and when the automobile lottery system is developed, optional components are applied, including: by introducing POM dependent management of Zeus deployed in a Maven warehouse server, information such as versions of internal components is not concerned, component configuration and database configuration of application.
Referring to fig. 3, an embodiment of the present invention provides a module connection diagram of a Zeus framework based on SpringBoot, including:
an original file creating unit, configured to create, by start.
A Zeus dependency obtaining unit, configured to introduce Pom files of a Zeus framework deployed in a Maven warehouse server into the original file, so as to obtain Zeus dependency management;
a file modification unit, configured to modify the original file subjected to Zeus dependency management to obtain a new Zeus framework file; the method comprises the following steps: adding main configuration ComponentScan and MapperScan annotation class information in an application.java file, and adding dependency information of Zeus-core and Zeus-common in an Pom file; replace the original application properties file with the application.
A database code generation unit: the front end code and the back end code corresponding to the database table are respectively generated under the src directory of the java file in the new Zeus framework file, and a Zeus framework based on SpringBoot is obtained; the code is logic and interface code for the incremental, destructive, and change checking of database table operations.
Further, the Zeus framework based on the SpringBoot also comprises a unified response result format configuration and a global exception handling unit; when the service request is normal, the method packages the original returned service data and packages information such as state codes, information and data; when the abnormal service occurs, the abnormal service is packaged in a uniform response format, and then the generated return code is returned to the calling party; wherein the package is an @ controlleraddrice global package response format, and the unified response format is a Return response format and a Return code format; the return codes are Return response and Return code or custom return codes.
An embodiment of the present invention further provides a computer terminal device, including:
one or more processors;
a memory coupled to the processor for storing one or more programs;
when the one or more programs are executed by the one or more processors, the one or more processors are enabled to implement the method for developing the Zeus framework based on SpringBoot as described in any one of the embodiments above.
An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the method for developing a Zeus framework based on SpringBoot as described in any one of the above embodiments.
The processor is used for controlling the overall operation of the computer terminal equipment so as to complete all or part of the steps of the fully-automatic power consumption prediction method. The memory is used to store various types of data to support the operation at the computer terminal device, such as instructions for any application or method operating on the computer terminal device, and application-related data. The Memory may be implemented by any type of volatile or non-volatile Memory device or combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic Memory, flash Memory, magnetic disk, or optical disk.
In an exemplary embodiment, the computer terminal Device may be implemented by one or more Application Specific 1 integrated circuits (AS 1C), a Digital Signal Processor (DSP), a Digital Signal Processing Device (DSPD), a Programmable Logic Device (PLD), a Field Programmable Gate Array (FPGA), a controller, a microcontroller, a microprocessor or other electronic components, and is configured to perform the above-mentioned developing method of the spark book-based Zeus framework and achieve technical effects consistent with the above-mentioned method.
In another exemplary embodiment, a computer readable storage medium is also provided, which includes program instructions, which when executed by a processor, implement the steps of the above-described method for developing a SpringBoot-based Zeus framework. For example, the computer-readable storage medium may be the above-mentioned memory including program instructions, which are executable by a processor of a computer terminal device to implement the above-mentioned method for developing a SpringBoot-based Zeus framework, and achieve technical effects consistent with the above-mentioned method.
While the foregoing is directed to the preferred embodiment of the present invention, it will be understood by those skilled in the art that various changes and modifications may be made without departing from the spirit and scope of the invention.

Claims (10)

1. A Zeus framework development method based on SpringBoot is characterized by comprising the following steps:
creating an original file of the project based on the SpringBoot framework through start.
Introducing Pom files of a Zeus framework deployed on a Maven warehouse server into the original files to obtain Zeus dependency management;
modifying the original file of Zeus dependency management to obtain a new Zeus framework file; the method comprises the following steps: adding main configuration ComponentScan and MapperScan annotation class information in an application.java file, and adding dependency information of Zeus-core and Zeus-common in an Pom file; replace the original application properties file with the application.
Respectively generating front and back end codes corresponding to the database table under the src directory of the java file in the new Zeus framework file to obtain a Zeus framework based on SpringBoot; the code is logic and interface code for the incremental, destructive, and change checking of database table operations.
2. The method for developing a Zeus framework based on SpringBoot according to claim 1, further comprising configuring a uniform response result format and performing global exception handling, specifically:
when the service request is normal, packaging is carried out on the basis of the original returned service data, and information such as state codes, information, data and the like is packaged; when the abnormal service occurs, the abnormal service is packaged in a uniform response format, and then the generated return code is returned to the calling party; wherein the package is an @ controlleraddrice global package response format, and the unified response format is a Return response format and a Return code format; the return codes are Return response and Return code or custom return codes.
3. A method for a SpringBoot-based Zeus development framework according to claim 2, wherein said configuring a unified response result format comprises:
creating a processing class ResponseHandler with unified response, realizing ResponseBodyAdvice, and realizing an enhancement function for a responder;
adding an annotation on the ResponseHandler class, and intercepting a request method of the RestController class;
the heavy-load beforebedewrite method uniformly uses a return response class package response result.
4. A method for a SpringBoot-based Zeus development framework according to claim 2, wherein said performing global exception handling comprises, in order:
and performing global exception handling configuration, realizing exception handling in the java class of the background, acquiring a front-end returned result, establishing a project based on a Zeus framework according to a development environment and a development tool, adding dependence of the Zeus framework in a pom file of the established project, and realizing encapsulation of a unified exception handling function.
5. A method for a SpringBoot-based Zeus development framework according to claim 1, wherein said Zeus-dependent parameter configuration comprises:
configuring basic interface parameters for the Zeus framework creating process;
selecting all dependencies of the items to configure the Zeus framework;
and the configuration of the database table is carried out by inputting IP, ports, the database, user names and password import.
6. A method for a SpringBoot-based Zeus development framework according to claim 5, wherein said basic interface parameters include: group name, type, module, project name, project description, package name, packaging method, and Java version.
7. A Zeus framework based on SpringBoot, comprising:
an original file creating unit, configured to create, by start.
A Zeus dependency obtaining unit, configured to introduce Pom files of a Zeus framework deployed in a Maven warehouse server into the original file, so as to obtain Zeus dependency management;
a file modification unit, configured to modify the original file subjected to Zeus dependency management to obtain a new Zeus framework file; the method comprises the following steps: adding main configuration ComponentScan and MapperScan annotation class information in an application.java file, and adding dependency information of Zeus-core and Zeus-common in an Pom file; replace the original application properties file with the application.
A database code generation unit: the front end code and the back end code corresponding to the database table are respectively generated under the src directory of the java file in the new Zeus framework file, and a Zeus framework based on SpringBoot is obtained; the code is logic and interface code for the incremental, destructive, and change checking of database table operations.
8. A SpringBoot-based Zeus framework according to claim 7, further comprising a unified response result format configuration and global exception handling unit; when the service request is normal, the method packages the original returned service data and packages information such as state codes, information and data; when the abnormal service occurs, the abnormal service is packaged in a uniform response format, and then the generated return code is returned to the calling party; wherein the package is an @ controlleraddrice global package response format, and the unified response format is a Return response format and a Return code format; the return codes are Return response and Return code or custom return codes.
9. A computer terminal device, comprising:
one or more processors;
a memory coupled to the processor for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement a method for developing a SpringBoot-based Zeus framework as claimed in any one of claims 1 to 6.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, implements a method for developing a SpringBoot-based Zeus framework as claimed in any one of claims 1 to 6.
CN202010446038.7A 2020-05-22 2020-05-22 Zeus framework development method based on Springboot and Zeus framework Withdrawn CN111813394A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010446038.7A CN111813394A (en) 2020-05-22 2020-05-22 Zeus framework development method based on Springboot and Zeus framework

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010446038.7A CN111813394A (en) 2020-05-22 2020-05-22 Zeus framework development method based on Springboot and Zeus framework

Publications (1)

Publication Number Publication Date
CN111813394A true CN111813394A (en) 2020-10-23

Family

ID=72848123

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010446038.7A Withdrawn CN111813394A (en) 2020-05-22 2020-05-22 Zeus framework development method based on Springboot and Zeus framework

Country Status (1)

Country Link
CN (1) CN111813394A (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112527271A (en) * 2020-12-24 2021-03-19 广东广宇科技发展有限公司 Software development implementation method and software development engine
CN112748908A (en) * 2020-12-31 2021-05-04 广东广宇科技发展有限公司 Restful service development method and device based on SSM framework
CN112817564A (en) * 2021-01-07 2021-05-18 湖北智泽云创科技有限公司 Mala back-end rapid development framework system and method
CN113419772A (en) * 2021-06-30 2021-09-21 平安国际智慧城市科技股份有限公司 Response data packing and unpacking method, response data packing device, response data unpacking device and response data unpacking medium
CN113641700A (en) * 2021-08-30 2021-11-12 北京沃东天骏信息技术有限公司 Data processing method and device based on Spring boot frame
CN113835707A (en) * 2021-09-30 2021-12-24 唯品会(广州)软件有限公司 Number making method, device, equipment and readable storage medium
CN114356427A (en) * 2022-01-06 2022-04-15 成都新希望金融信息有限公司 Scanning filtering method and device, electronic equipment and storage medium
CN117289914A (en) * 2023-11-22 2023-12-26 南京飓风引擎信息技术有限公司 Data conversion system and method based on SpringBoot framework

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112527271A (en) * 2020-12-24 2021-03-19 广东广宇科技发展有限公司 Software development implementation method and software development engine
CN112527271B (en) * 2020-12-24 2024-03-29 广东广宇科技发展有限公司 Software development implementation method and software development engine
CN112748908A (en) * 2020-12-31 2021-05-04 广东广宇科技发展有限公司 Restful service development method and device based on SSM framework
CN112748908B (en) * 2020-12-31 2024-02-27 广东广宇科技发展有限公司 Method and device for developing Restful service based on SSM framework
CN112817564A (en) * 2021-01-07 2021-05-18 湖北智泽云创科技有限公司 Mala back-end rapid development framework system and method
CN113419772A (en) * 2021-06-30 2021-09-21 平安国际智慧城市科技股份有限公司 Response data packing and unpacking method, response data packing device, response data unpacking device and response data unpacking medium
CN113641700A (en) * 2021-08-30 2021-11-12 北京沃东天骏信息技术有限公司 Data processing method and device based on Spring boot frame
CN113835707A (en) * 2021-09-30 2021-12-24 唯品会(广州)软件有限公司 Number making method, device, equipment and readable storage medium
CN113835707B (en) * 2021-09-30 2024-01-19 唯品会(广州)软件有限公司 Counting method, counting device, counting equipment and readable storage medium
CN114356427A (en) * 2022-01-06 2022-04-15 成都新希望金融信息有限公司 Scanning filtering method and device, electronic equipment and storage medium
CN117289914A (en) * 2023-11-22 2023-12-26 南京飓风引擎信息技术有限公司 Data conversion system and method based on SpringBoot framework
CN117289914B (en) * 2023-11-22 2024-02-02 南京飓风引擎信息技术有限公司 Data conversion system and method based on SpringBoot framework

Similar Documents

Publication Publication Date Title
CN111813394A (en) Zeus framework development method based on Springboot and Zeus framework
CN109408373B (en) Test method of intelligent contract, computer readable storage medium and test terminal
Mirzaei et al. Sig-droid: Automated system input generation for android applications
US11010283B2 (en) Mock-based unit test(s) for an end-to-end test of a code snippet
Deng et al. Towards mutation analysis of android apps
KR101036679B1 (en) Test case inheritance controlled via attributes
US20030149799A1 (en) System supporting unified event handling in ECMAScript
Shahriar et al. Testing of memory leak in android applications
EP2431869A1 (en) Dry-run design time environment
US20080052690A1 (en) Testing software with a build engine
Franke et al. Testing conformance of life cycle dependent properties of mobile applications
CN111752844A (en) Interface testing method and device, computing equipment and storage medium
Farooq et al. Runtimedroid: Restarting-free runtime change handling for android apps
US7340725B1 (en) Smart test attributes and test case scenario in object oriented programming environment
CN111752841A (en) Single test simulation method, device, equipment and computer readable storage medium
CN113434131A (en) Programming method and device, computer equipment and storage medium
US7577541B1 (en) Test services provider
Chen et al. Fragdroid: Automated user interface interaction with activity and fragment analysis in android applications
Ali et al. Model transformations as a strategy to automate model-based testing-A tool and industrial case studies
Huang et al. Surrogate: A simulation apparatus for continuous integration testing in service oriented architecture
CN117149209A (en) Code increment compiling method and device, computer equipment and storage medium
US20090094583A1 (en) System and method for testing computer programs
Huang et al. A novel approach to regression test selection for j2ee applications
US7082376B1 (en) State full test method executor
Mota et al. Spring Framework for Testing

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WW01 Invention patent application withdrawn after publication
WW01 Invention patent application withdrawn after publication

Application publication date: 20201023