CN112328917A - SQL (structured query language) writing oriented method for generating http interface service and data display page - Google Patents
SQL (structured query language) writing oriented method for generating http interface service and data display page Download PDFInfo
- Publication number
- CN112328917A CN112328917A CN202011214605.2A CN202011214605A CN112328917A CN 112328917 A CN112328917 A CN 112328917A CN 202011214605 A CN202011214605 A CN 202011214605A CN 112328917 A CN112328917 A CN 112328917A
- Authority
- CN
- China
- Prior art keywords
- page
- sql
- layer
- data
- interface
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 40
- 238000011161 development Methods 0.000 claims abstract description 17
- 238000012827 research and development Methods 0.000 claims description 9
- 230000006870 function Effects 0.000 claims description 4
- 238000001914 filtration Methods 0.000 claims description 3
- 230000000977 initiatory effect Effects 0.000 claims description 3
- 238000000926 separation method Methods 0.000 claims description 3
- 238000012423 maintenance Methods 0.000 abstract description 3
- 238000004806 packaging method and process Methods 0.000 abstract description 2
- 238000010586 diagram Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/953—Querying, e.g. by the use of web search engines
- G06F16/9538—Presentation of query results
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/242—Query formulation
- G06F16/2433—Query languages
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/20—Software design
- G06F8/24—Object-oriented
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Databases & Information Systems (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Software Systems (AREA)
- Mathematical Physics (AREA)
- Computational Linguistics (AREA)
- User Interface Of Digital Computer (AREA)
Abstract
The invention discloses a method for generating an http interface service and a data display page oriented to SQL writing, and relates to the technical field of computers. Aiming at the problem that the existing objects, classes and methods are required to be repeatedly modified to cause difficult maintenance when the SSM framework in the existing JAVA development faces various changeable and complex requirements for providing data services, the technical scheme is adopted: the method comprises the steps of utilizing java background service to create, edit and delete SQL statements and HTML display pages used by an application program, sending HTML required by a browser during display, then requesting execution results of corresponding resource SQL statements in the HTML through js, and uniformly packaging the results to the browser for data template replacement. In the execution process, based on the UI layer, the application layer and the data layer, the application layer comprises an http external interface layer and a service layer, and an http interface service is called to complete the data display page. The invention can automatically generate the data display page and the required interface by compiling SQL, thereby greatly reducing repeated codes and saving manpower.
Description
Technical Field
The invention relates to the technical field of computers, in particular to a method for generating an http interface service and a data display page oriented to SQL writing.
Background
In software development in the field of government affairs, various data sharing, statistics and display of data are always faced. In the conventional JAVA development, when the SSM framework meets various changeable and complex requirements for providing data services, existing objects, classes and methods are often repeatedly modified, so that codes become too bulky and difficult to maintain, and the SSM framework is often subjected to complex processes of recoding, compiling, redeploying and restarting programs only by requiring an interface to return one more parameter. This greatly increases the workload and product of developers and implementers, increases the difficulty of maintaining the project, and also results in a large amount of repeated coding in the case that the page logic of the data presentation is substantially the same.
Disclosure of Invention
Aiming at the requirements and the defects of the prior art development, the invention provides a method for generating http interface service and data display pages by writing SQL.
The invention discloses a method for generating http interface service and data display page oriented to SQL writing, which adopts the following technical scheme for solving the technical problems:
a method for generating an http interface service and a data display page oriented to SQL writing utilizes java background service to create, edit and delete SQL sentences and HTML display pages used by an application program, HTML required by a browser is sent during display, then execution results of SQL sentences of corresponding resources are requested in the HTML through js, and the results are uniformly packaged to the browser for data template replacement.
Optionally, the implementation of the method for generating the http interface service and the data display PAGE by writing towards SQL depends on developers, namely writers of SQL and PAGE, development managers, namely workers performing resource management, and product managers, namely workers performing document writing and product publishing;
the method has the following functions based on the following roles:
the developer generates an external interface/page facing the SQL development interface/page,
the research and development manager configures the authority of the generated external interface/page, provides the external interface/page,
the product administrator writes external interface documents according to the interface management list and provides the external interface documents for external callers, the external callers can call external interface/pages configured by the research and development administrator, and the product administrator can export configuration results and send the configuration results to all project updates.
Further optionally, the involved developers generate external interfaces/pages facing the SQL development interfaces/pages, and in this process,
firstly, according to a springMVC framework, a developer designs a database according to service requirements and compiles SQL sentences meeting service logic;
the developer then writes a template page with the set rules.
Further optionally, when the research and development administrator configures the authority of the generated external interface/page, the configuration content includes, but is not limited to, naming, external path, and call restriction.
Optionally, a method for generating an http interface service and a data display page by writing towards SQL is provided, where an implementation framework is based on a UI layer, an application layer, and a data layer, where the application layer includes an http external interface layer and a service layer;
the related UI layer adopts a front-back separation structure of HTML5+ JS;
the related http external interface layer generates an interface development mode based on SQL, and provides http service by using springMVC, but no data is returned to the UI layer, only encapsulated result data in a uniform JSON format is returned, and only when the UI layer requests a page, the http external interface layer returns a corresponding template page;
the related service layer firstly initiates a request to the data layer, the data layer returns data, and the service layer then carries out formatting assembly on the returned data according to internal deployment;
the related data layer is used as the lowest layer, SQL is customized and analyzed according to the transmitted customized parameters, required fields are returned, and meanwhile, some safety check operations are carried out on the data layer.
Further optionally, the related http external interface layer allows interface calling in an encryption mode, and meanwhile, extended interception check services of permission analysis, call log storage and call filtering are carried out, so that the calling safety is ensured.
Further optionally, the related data layer has two optional development modes of forwarding and calling and self-defining service;
the forwarding call is to call a native third-party interface;
the custom service is a conventional encapsulated class after JAVA coding, and the specified service class is transmitted and called through the feature code to return final data.
Further optionally, when the user initiates a request through the client, the specific process of returning data to the page is as follows:
(1) a user initiates a request through a client,
(2) upon a user request, a res _ id is passed in,
(3) judging whether the request is an interface request according to the transmitted res _ id, if so, executing (4), if not, executing (5),
(4) reading specified SQL through a database, then participating in and interpreting the SQL as a condition query, using a select return field as a return parameter, and displaying a returned result on a page;
(5) further judging whether the request is a page request according to the transmitted res _ id, if so, executing (6), if not, executing (7),
(6) reading the page template path through the database, then returning to the template page, initiating the request again, corresponding to SQL query, finally assembling the page according to the data,
(7) the request is a request type other than an interface request and a page request.
Compared with the prior art, the method for generating the http interface service and the data display page by writing towards SQL has the beneficial effects that:
according to the invention, through compiling SQL, the data display page is automatically generated, and the required interface is generated, so that the coding amount and the implementation amount are greatly reduced, repeated codes are reduced, the labor is saved, and the maintenance is convenient; in addition, SQL is a popular structured query language, is easy to learn, has great flexibility, and can further reduce the threshold of code maintenance.
Drawings
FIG. 1 is a schematic diagram of the present invention for performing related functions based on related roles;
FIG. 2 is a diagram of a method implementation architecture of the present invention;
fig. 3 is a flow chart of the application of the present invention.
Detailed Description
In order to make the technical scheme, the technical problems to be solved and the technical effects of the present invention more clearly apparent, the following technical scheme of the present invention is clearly and completely described with reference to the specific embodiments.
The first embodiment is as follows:
the embodiment provides a method for generating an http interface service and a data display page by writing SQL, which comprises the steps of creating, editing and deleting SQL sentences and HTML display pages used by an application program by using java background service, sending HTML required by a browser during display, then requesting execution results of the corresponding resource SQL sentences through js in the HTML, and uniformly packaging the results to the browser for data template replacement.
With reference to fig. 1, the implementation of the method of this embodiment depends on developers, i.e., writers of SQL and PAGE, development managers, i.e., workers performing resource management, and product managers, i.e., workers performing document writing and product publishing;
the method has the following functions based on the following roles:
(A) developers face SQL development interfaces/pages to generate external interfaces/pages. In the process, a developer firstly designs a database according to business requirements according to a springMVC framework, compiles an SQL statement meeting business logic, and then compiles a template page by setting rules, wherein the set rules can specifically be as follows:
(B) and the research and development manager carries out authority configuration on the generated external interface/page, the configuration content comprises and is not limited to naming, external path and calling limitation, and the external interface/page is provided.
(C) The product administrator writes external interface documents according to the interface management list and provides the external interface documents for external callers, the external callers can call external interface/pages configured by the research and development administrator, and the product administrator can export configuration results and send the configuration results to all project updates.
With reference to fig. 2, the implementation framework of the method of this embodiment is based on a UI layer, an application layer, and a data layer, where the application layer includes an http external interface layer and a service layer.
The UI layer employs a front-back separation structure of HTML5+ JS.
The http external interface layer generates an interface development mode based on SQL, uses springMVC to provide http service, but does not return data to the UI layer, only returns encapsulated result data in a unified JSON format, and only when the UI layer requests a page, the http external interface layer returns a corresponding template page. The http external interface layer allows interface calling in an encryption mode, and simultaneously performs permission analysis, call log storage and call filtering expansion interception check service to ensure the calling safety.
The service layer firstly initiates a request to the data layer, the data layer returns data, and the service layer then formats and assembles the returned data according to internal deployment.
The data layer is used as the lowest layer, SQL self-defining analysis can be carried out according to the transmitted self-defining parameters, required fields are returned, and meanwhile, the data layer is also used for carrying out some safety check operations. The data layer also has two optional development modes of forwarding and calling and self-defining service, wherein the forwarding calling is used for calling a native third-party interface, the self-defining service is a conventional encapsulated class after JAVA coding, and the specified service class is transmitted and called through the feature code to return final data.
With reference to fig. 3, based on the method for generating an http interface service and a data presentation page written for SQL according to this embodiment, when a user initiates a request through a client, a specific process of returning data to a page is as follows:
(1) a user initiates a request through a client,
(2) upon a user request, a res _ id is passed in,
(3) judging whether the request is an interface request according to the transmitted res _ id, if so, executing (4), if not, executing (5),
(4) reading specified SQL through a database, then participating in and interpreting the SQL as a condition query, using a select return field as a return parameter, and displaying a returned result on a page;
(5) further judging whether the request is a page request according to the transmitted res _ id, if so, executing (6), if not, executing (7),
(6) reading the page template path through the database, then returning to the template page, initiating the request again, corresponding to SQL query, finally assembling the page according to the data,
(7) the request is a request type other than an interface request and a page request.
In summary, the method for generating the http interface service and the data display page by writing SQL is adopted, the data display page and the required interface can be automatically generated by writing SQL, repeated codes are greatly reduced, and manpower is saved.
The principles and embodiments of the present invention have been described in detail using specific examples, which are provided only to aid in understanding the core technical content of the present invention. Based on the above embodiments of the present invention, those skilled in the art should make any improvements and modifications to the present invention without departing from the principle of the present invention, and therefore, the present invention should fall into the protection scope of the present invention.
Claims (8)
1. A method for generating an http interface service and a data display page oriented to SQL writing is characterized in that a java background service is used for creating, editing and deleting SQL sentences and HTML display pages used by an application program, HTML required by a browser is sent during display, then execution results of the SQL sentences serving as corresponding resources are requested in the HTML through js, and the results are uniformly packaged to the browser for data template replacement.
2. The method for generating the http interface service and the data display PAGE oriented to SQL writing according to claim 1, wherein the method is implemented by developers, research and development managers and product managers, wherein the developers are SQL and PAGE writers, the research and development managers are resource management workers, and the product managers are document writing and product publishing workers;
the method has the following functions based on the following roles:
the developer generates an external interface/page facing the SQL development interface/page,
the research and development manager configures the authority of the generated external interface/page, provides the external interface/page,
the product administrator writes external interface documents according to the interface management list and provides the external interface documents for external callers, the external callers can call external interface/pages configured by the research and development administrator, and the product administrator can export configuration results and send the configuration results to all project updates.
3. The method for generating http interface service and data presentation page oriented to SQL writing according to claim 2, wherein developers are oriented to SQL development interface/page to generate external interface/page, in the process,
firstly, according to a springMVC framework, a developer designs a database according to service requirements and compiles SQL sentences meeting service logic;
the developer then writes a template page with the set rules.
4. The method for generating http interface service and data presentation page oriented to SQL writing of claim 2, wherein when a development administrator performs permission configuration on the generated external interface/page, configuration contents include but are not limited to naming, external path, and call restriction.
5. The SQL-oriented compiling and generating method of the http interface service and the data display page as recited in claim 1, wherein an implementation framework of the method is based on a UI layer, an application layer and a data layer, and the application layer comprises an http external interface layer and a service layer;
the UI layer adopts a front-back separation structure of HTML5+ JS;
the http external interface layer is based on an SQL (structured query language) generation interface development mode, uses springMVC to provide http service, but does not return data to the UI (user interface) layer, only returns encapsulated result data in a uniform JSON (Java Server pages) format, and only when the UI layer requests a page, the http external interface layer returns a corresponding template page;
the service layer firstly initiates a request to the data layer, the data layer returns data, and the service layer then carries out formatting assembly on the returned data according to internal deployment;
the data layer is used as the lowest layer, SQL self-defining analysis can be carried out according to the transmitted self-defining parameters, required fields are returned, and meanwhile, the data layer is also used for carrying out some safety check operations.
6. The method for generating the http interface service and the data display page written and generated facing SQL according to claim 5, wherein the http external interface layer allows interface calling in an encryption mode, and simultaneously performs extended interception check service of permission analysis, call log storage and call filtering to ensure the security of calling.
7. The SQL-oriented compiling and generating method of the http interface service and the data display page as claimed in claim 5, wherein the data layer further has two selectable development modes of forwarding call and custom service;
the forwarding call is to call a native third-party interface;
the custom service is a conventional encapsulated class after JAVA coding, and the specified service class is transmitted and called through the feature code to return final data.
8. The SQL-oriented compiling and generating method of the http interface service and the data display page as claimed in claim 5, wherein when a user initiates a request through a client, a specific process of returning data to a page is as follows:
(1) a user initiates a request through a client,
(2) upon a user request, a res _ id is passed in,
(3) judging whether the request is an interface request according to the transmitted res _ id, if so, executing (4), if not, executing (5),
(4) reading specified SQL through a database, then participating in and interpreting the SQL as a condition query, using a select return field as a return parameter, and displaying a returned result on a page;
(5) further judging whether the request is a page request according to the transmitted res _ id, if so, executing (6), if not, executing (7),
(6) reading the page template path through the database, then returning to the template page, initiating the request again, corresponding to SQL query, finally assembling the page according to the data,
(7) the request is a request type other than an interface request and a page request.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011214605.2A CN112328917A (en) | 2020-11-04 | 2020-11-04 | SQL (structured query language) writing oriented method for generating http interface service and data display page |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011214605.2A CN112328917A (en) | 2020-11-04 | 2020-11-04 | SQL (structured query language) writing oriented method for generating http interface service and data display page |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112328917A true CN112328917A (en) | 2021-02-05 |
Family
ID=74323553
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011214605.2A Pending CN112328917A (en) | 2020-11-04 | 2020-11-04 | SQL (structured query language) writing oriented method for generating http interface service and data display page |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112328917A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113821557A (en) * | 2021-09-24 | 2021-12-21 | 四川新网银行股份有限公司 | Method for data interaction between Web page and back end |
CN114416197A (en) * | 2021-12-28 | 2022-04-29 | 成都易达数安科技有限公司 | Development-free scripted configuration method of APP background interface based on xml |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106354481A (en) * | 2015-07-13 | 2017-01-25 | 阿里巴巴集团控股有限公司 | Method and equipment for uniform mapping of HTTP requests |
CN109753532A (en) * | 2018-12-26 | 2019-05-14 | 苏州宏软信息技术有限公司 | Interface service system and its implementation method for browser end access database |
CN110392068A (en) * | 2018-04-17 | 2019-10-29 | 阿里巴巴集团控股有限公司 | A kind of data transmission method, device and its equipment |
CN110825388A (en) * | 2019-11-15 | 2020-02-21 | 中科院计算技术研究所大数据研究院 | Method for directly converting SQL statement into corresponding REST interface |
-
2020
- 2020-11-04 CN CN202011214605.2A patent/CN112328917A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106354481A (en) * | 2015-07-13 | 2017-01-25 | 阿里巴巴集团控股有限公司 | Method and equipment for uniform mapping of HTTP requests |
CN110392068A (en) * | 2018-04-17 | 2019-10-29 | 阿里巴巴集团控股有限公司 | A kind of data transmission method, device and its equipment |
CN109753532A (en) * | 2018-12-26 | 2019-05-14 | 苏州宏软信息技术有限公司 | Interface service system and its implementation method for browser end access database |
CN110825388A (en) * | 2019-11-15 | 2020-02-21 | 中科院计算技术研究所大数据研究院 | Method for directly converting SQL statement into corresponding REST interface |
Non-Patent Citations (1)
Title |
---|
向春会: "基于SpringMVC的web工程通用模板设计", 《中国优秀硕士学位论文全文数据库信息科技辑(月刊)》 * |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113821557A (en) * | 2021-09-24 | 2021-12-21 | 四川新网银行股份有限公司 | Method for data interaction between Web page and back end |
CN113821557B (en) * | 2021-09-24 | 2023-06-13 | 四川新网银行股份有限公司 | Method for carrying out data interaction between Web page and back end |
CN114416197A (en) * | 2021-12-28 | 2022-04-29 | 成都易达数安科技有限公司 | Development-free scripted configuration method of APP background interface based on xml |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11099823B2 (en) | Systems and methods for transformation of reporting schema | |
CN110325961B (en) | Spreadsheet-based software application development | |
US20200301917A1 (en) | Data protection method and device and storage medium | |
US9904522B2 (en) | Web development system | |
Xia et al. | Leveraging single-user applications for multi-user collaboration: the coword approach | |
US9959098B1 (en) | Data processing systems and methods | |
WO2018126964A1 (en) | Task execution method and apparatus and server | |
US7882203B2 (en) | Remote authoring for dynamic web pages | |
CN111078555B (en) | Test file generation method, system, server and storage medium | |
CN110489310B (en) | Method and device for recording user operation, storage medium and computer equipment | |
TW202105336A (en) | Development method, system and computer equipment for course package and storage medium thereof | |
CN112328917A (en) | SQL (structured query language) writing oriented method for generating http interface service and data display page | |
CN116860223A (en) | Cloud-protogenesis-based low-code development and delivery method | |
WO2023035563A1 (en) | Applet cross-application migration method, device, terminal, system and storage medium | |
CN110716720A (en) | Method and device for realizing application hot deployment | |
CN110990011A (en) | Data request method of automation interface | |
US8725750B1 (en) | Framework for generating programs to process beacons | |
CN111176660A (en) | Distributed architecture-oriented micro-service contract management method and device, computer equipment and readable storage medium | |
CN113238739A (en) | Plug-in development and data acquisition method, device, electronic equipment and medium | |
US9304983B2 (en) | Method and system for Xform generation and processing application integration framework | |
Gao et al. | Achieving Transparent and Real-time Collaboration in Co-AutoCAD Application. | |
LEHRHUBER | Pdf support for qualitative research in the cloud | |
CN117354114B (en) | Data service release method and system based on cloud native architecture | |
Haibing et al. | EMF Based Validation Methods of the Static Semantics of Models | |
Patel | Spring 5.0 Projects: Build Seven Web Development Projects with Spring MVC, Angular 6, JHipster, WebFlux, and Spring Boot 2 |
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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20210205 |