diff --git a/ENG/ENG-01-Overview.md b/ENG/ENG-01-Overview.md index 9c920c1..32ed056 100644 --- a/ENG/ENG-01-Overview.md +++ b/ENG/ENG-01-Overview.md @@ -1,4 +1,4 @@ -##### Other languages: [简体中文](/CHN//CHN//CHN/CHN-01-概述) +##### Other languages: [简体中文](/CHN/CHN-01-概述) **Drogon** is a C++17/20-based HTTP application framework. Drogon can be used to easily build various types of web application server programs using C++. @@ -31,4 +31,4 @@ Its main features are as follows: * Support plugins which can be installed by the configuration file at load time; * Support AOP with build-in joinpoints. -# Next: [Install drogon](/ENG//ENG//ENG/ENG-02-Installation) +# Next: [Install drogon](/ENG/ENG-02-Installation) diff --git a/ENG/ENG-02-Installation.md b/ENG/ENG-02-Installation.md index 96afd0a..09c725c 100644 --- a/ENG/ENG-02-Installation.md +++ b/ENG/ENG-02-Installation.md @@ -1,4 +1,4 @@ -##### Other languages: [简体中文](/CHN//CHN//CHN/CHN-02-安装) +##### Other languages: [简体中文](/CHN/CHN-02-安装) This section takes Ubuntu 18.04, CentOS 7.5, MacOS 12.2 as an example to introduce the installation process. Other systems are similar; @@ -481,4 +481,4 @@ Assuming that the above environment and library dependencies are all ready, the target_link_libraries(${PROJECT_NAME} PRIVATE drogon) ``` -# Next: [Quick Start](/ENG//ENG//ENG/ENG-03-Quick-Start) +# Next: [Quick Start](/ENG/ENG-03-Quick-Start) diff --git a/ENG/ENG-03-Quick-Start.md b/ENG/ENG-03-Quick-Start.md index 9cd9ca2..a90261e 100644 --- a/ENG/ENG-03-Quick-Start.md +++ b/ENG/ENG-03-Quick-Start.md @@ -1,4 +1,4 @@ -##### Other languages: [简体中文](/CHN//CHN//CHN/CHN-03-快速开始) +##### Other languages: [简体中文](/CHN/CHN-03-快速开始) ## Static Site @@ -194,4 +194,4 @@ We see that adding a controller to an application is very simple. You only need > **Note: Drogon has no restrictions on the location of the controller source files. You could also save them in "./" (the project root directory), or you could even define a new directory in `CMakeLists.txt`. It is recommended to use the controllers directory for the convenience of management.** -# Next: [drogon_ctl Command](/ENG//ENG/ENG-04-0-Controller-Introduction) +# Next: [drogon_ctl Command](/ENG/ENG-04-0-Controller-Introduction) diff --git a/ENG/ENG-04-0-Controller-Introduction.md b/ENG/ENG-04-0-Controller-Introduction.md index 01462fc..208cb78 100644 --- a/ENG/ENG-04-0-Controller-Introduction.md +++ b/ENG/ENG-04-0-Controller-Introduction.md @@ -1,4 +1,4 @@ -##### Other languages: [简体中文](/CHN//CHN/CHN-04-控制器-简介) +##### Other languages: [简体中文](/CHN/CHN-04-0-控制器-简介) The controller is very important in web application development. This is where we will define our URLs, which HTTP methods are allowed, which [filters](/ENG//ENG/ENG-06-Middleware-and-Filter) will be applied and how requests will be processed and responded to. The drogon framework has helped us to handle the network transmission, Http protocol analysis and so on. We only need to pay attention to the logic of the controller; each controller object can have one or more processing functions (generally called handlers), and the interface of the function is generally defined as follows: @@ -33,4 +33,4 @@ public: A controller registered to a drogon framework will have at most only one instance and will not be destroyed during the entire application run, so users can declare and use member variables in the controller class. Note that when the handler of the controller is called, it is in a multi-threaded environment (when the number of IO threads of the framework is configured to be greater than 1), if you need to access non-temporary variables, please do the concurrent protection work. -# Next: [HttpSimpleController](/ENG//ENG/ENG-04-1-Controller-HttpSimpleController) +# Next: [HttpSimpleController](/ENG/ENG-04-1-Controller-HttpSimpleController) diff --git a/ENG/ENG-04-1-Controller-HttpSimpleController.md b/ENG/ENG-04-1-Controller-HttpSimpleController.md index f206169..d537b25 100644 --- a/ENG/ENG-04-1-Controller-HttpSimpleController.md +++ b/ENG/ENG-04-1-Controller-HttpSimpleController.md @@ -1,4 +1,4 @@ -##### Other languages: [简体中文](/CHN//CHN/CHN-04-1-控制器-HttpSimpleController) +##### Other languages: [简体中文](/CHN/CHN-04-1-控制器-HttpSimpleController) You could use the `drogon_ctl` command line tool to quickly generate custom controller class source files based on `HttpSimpleController`. The command format is as bellow: @@ -64,4 +64,4 @@ You could define an HttpResponse class variable, and then use the callback() to > **The mapping from the above path to the handler is done at compile time. In fact, the drogon framework also provides an interface for runtime completion mapping. The runtime mapping allows the user to map or modify the mapping through configuration files or other user interfaces without recompiling this program (For performance reasons, it is forbidden to add any controller mapping after running the app().run() method).** -# Next: [HttpController](/ENG//ENG/ENG-04-2-Controller-HttpController) +# Next: [HttpController](/ENG/ENG-04-2-Controller-HttpController) diff --git a/ENG/ENG-04-2-Controller-HttpController.md b/ENG/ENG-04-2-Controller-HttpController.md index 65f96b6..c5b9177 100644 --- a/ENG/ENG-04-2-Controller-HttpController.md +++ b/ENG/ENG-04-2-Controller-HttpController.md @@ -1,4 +1,4 @@ -##### Other languages: [简体中文](/CHN//CHN/CHN-04-2-控制器-HttpController) +##### Other languages: [简体中文](/CHN/CHN-04-2-控制器-HttpController) ### Generation @@ -279,4 +279,4 @@ Each `HttpController` class can define many Http request handlers. Since the num > **It should be noted that when using regular expressions, you should pay attention to matching conflicts (multiple different handlers are matched). When conflicts happen in the same controller, drogon will only execute the first handler (the one registered in the framework first). When conflicts happen between different controllers, it is uncertain which handler will be executed. Therefore, users need to avoid these conflicts.** -# Next: [WebSocketController](/ENG//ENG/ENG-04-3-Controller-WebSocketController) +# Next: [WebSocketController](/ENG/ENG-04-3-Controller-WebSocketController) diff --git a/ENG/ENG-04-3-Controller-WebSocketController.md b/ENG/ENG-04-3-Controller-WebSocketController.md index ff86940..2bc9187 100644 --- a/ENG/ENG-04-3-Controller-WebSocketController.md +++ b/ENG/ENG-04-3-Controller-WebSocketController.md @@ -1,4 +1,4 @@ -##### Other languages: [简体中文](/CHN//CHN/CHN-04-3-控制器-WebSocketController) +##### Other languages: [简体中文](/CHN/CHN-04-3-控制器-WebSocketController) As the name implies, `WebSocketController` is used to process websocket logic. Websocket is a persistent HTTP-based connection scheme. At the beginning of the websocket, there is an HTTP format request and response exchange. After the websocket connection is established, all messages are transmitted on the websocket. The message is wrapped in a fixed format. There is no limit to the message content and the order in which messages are transmitted. @@ -150,4 +150,4 @@ void EchoWebsock::handleConnectionClosed(const WebSocketConnectionPtr &wsConnPtr any *getMutableContext(); ``` -# Next: [Middleware and Filter](/ENG//ENG/ENG-05-Middleware-and-Filter) +# Next: [Middleware and Filter](/ENG/ENG-05-Middleware-and-Filter) diff --git a/ENG/ENG-05-Middleware-and-Filter.md b/ENG/ENG-05-Middleware-and-Filter.md index 4173cd8..cc68ee4 100644 --- a/ENG/ENG-05-Middleware-and-Filter.md +++ b/ENG/ENG-05-Middleware-and-Filter.md @@ -1,4 +1,4 @@ -##### Other languages: [简体中文](/CHN//CHN/CHN-05-中间件和过滤器) +##### Other languages: [简体中文](/CHN/CHN-05-中间件和过滤器) In HttpController's [example](/ENG//ENG/ENG-04-2-Controller-HttpController), the getInfo method should check whether the user is logged in before returning the user's information. We can write this logic in the getInfo method, but obviously, checking the user's login membership is general logic which will be used by many interfaces, it should be extracted separately and configured before calling handler, which is what filters do. @@ -100,4 +100,4 @@ Drogon contains the following common filters: > **Note: If the middleware/filter is defined in the namespace, you must write the namespace completely when you register it.** -# Next: [View](/ENG//ENG/ENG-06-View) +# Next: [View](/ENG/ENG-06-View) diff --git a/ENG/ENG-06-View.md b/ENG/ENG-06-View.md index da77524..628de19 100644 --- a/ENG/ENG-06-View.md +++ b/ENG/ENG-06-View.md @@ -1,4 +1,4 @@ -##### Other languages: [简体中文](/CHN//CHN/CHN-06-视图) +##### Other languages: [简体中文](/CHN/CHN-06-视图) ### Views Introduction @@ -151,4 +151,4 @@ Obviously, this function depends on the development environment. If both drogon > **Note: If a `symbol not found` error occurs while loading a dynamic view, please use the `cmake .. -DCMAKE_ENABLE_EXPORTS=on` to configure your project, or uncomment the last line (`set_property(TARGET ${PROJECT_NAME} PROPERTY ENABLE_EXPORTS ON)`) in your project's CMakeLists.txt, and then rebuild the project** -# Next: [Session](/ENG//ENG/ENG-07-Session) +# Next: [Session](/ENG/ENG-07-Session) diff --git a/ENG/ENG-07-Session.md b/ENG/ENG-07-Session.md index 89b0e58..8eee5ab 100644 --- a/ENG/ENG-07-Session.md +++ b/ENG/ENG-07-Session.md @@ -1,4 +1,4 @@ -##### Other languages: [简体中文](/CHN//CHN/CHN-07-会话) +##### Other languages: [简体中文](/CHN/CHN-07-会话) `Session` is an important concept of the web application. It is used to save the state of the client on the server. Generally, it cooperates with the browser's `cookie`, and drogon provides support for the session. Drogon **close** the session selection by default, you can also close or open it through the following interface: @@ -96,4 +96,4 @@ drogon::HttpAppFramework::instance().enableSession(1200); Recompile the entire project with CMake, run the target program webapp, and you can see the effect through the browser. -# Next: [Database](/ENG//ENG/ENG-08-0-Database-General) +# Next: [Database](/ENG/ENG-08-0-Database-General) diff --git a/ENG/ENG-08-0-Database-General.md b/ENG/ENG-08-0-Database-General.md index 924e3b2..6c7ec19 100644 --- a/ENG/ENG-08-0-Database-General.md +++ b/ENG/ENG-08-0-Database-General.md @@ -1,4 +1,4 @@ -##### Other languages: [简体中文](/CHN//CHN/CHN-08-0-数据库-概述) +##### Other languages: [简体中文](/CHN/CHN-08-0-数据库-概述) ### General @@ -24,4 +24,4 @@ The transaction object can be generated by `DbClient` to support transaction ope Drogon also provides support for **ORM**. Users can use the drogon_ctl command to read the tables in the database and generate the corresponding model source code. Then, execute the database operations of these models through the `Mapper` class template. Mapper provides simple and convenient interfaces for standard database operations, allowing users to make the additions, deletions, and changes to the table without writing sql statements. For **ORM**, please refer to [ORM](/ENG//ENG/ENG-08-3-Database-ORM) -# Next: [DbClient](/ENG//ENG/ENG-08-1-Database-DbClient) +# Next: [DbClient](/ENG/ENG-08-1-Database-DbClient) diff --git a/ENG/ENG-08-1-Database-DbClient.md b/ENG/ENG-08-1-Database-DbClient.md index ff68808..b223698 100644 --- a/ENG/ENG-08-1-Database-DbClient.md +++ b/ENG/ENG-08-1-Database-DbClient.md @@ -1,4 +1,4 @@ -##### Other languages: [简体中文](/CHN//CHN/CHN-08-1-数据库-DbClient) +##### Other languages: [简体中文](/CHN/CHN-08-1-数据库-DbClient) ### DbClient Object Construction @@ -253,4 +253,4 @@ Each DbClient object has one or multiple its own EventLoop threads controlling t Blocking interfaces of DbClient only block the caller thread, as long as the caller thread is not the EventLoop thread, it will not affect the normal operation of the EventLoop thread. When the callback function is called, the program inside the callback is run on the EventLoop thread. Therefore, do not perform any blocking operations within the callback, otherwise it will affect the concurrency performance of database read and write. Anyone familiar with non-blocking I/O programming should understand this constraint. -# Next: [Transaction](/ENG//ENG/ENG-08-2-Database-Transaction) +# Next: [Transaction](/ENG/ENG-08-2-Database-Transaction) diff --git a/ENG/ENG-08-2-Database-Transaction.md b/ENG/ENG-08-2-Database-Transaction.md index fa54aac..6112d6a 100644 --- a/ENG/ENG-08-2-Database-Transaction.md +++ b/ENG/ENG-08-2-Database-Transaction.md @@ -1,4 +1,4 @@ -##### Other languages: [简体中文](/CHN//CHN/CHN-08-2-数据库-事务) +##### Other languages: [简体中文](/CHN/CHN-08-2-数据库-事务) > **Transactions** are an important feature of relational databases, and Drogon provides transaction support with the `Transaction` class. @@ -83,4 +83,4 @@ For the simplest example, suppose there is a task table from which the user sele In this case, select for update is used to avoid concurrent modifications. The update statement is completed in the result callback of the select statement. The outermost braces are used to limit the scope of the transPtr so that it can be destroyed in time after the execution of sql to end the transaction. -# Next: [ORM](/ENG//ENG/ENG-08-3-Database-ORM) +# Next: [ORM](/ENG/ENG-08-3-Database-ORM) diff --git a/ENG/ENG-08-3-Database-ORM.md b/ENG/ENG-08-3-Database-ORM.md index 0add918..d299a1b 100644 --- a/ENG/ENG-08-3-Database-ORM.md +++ b/ENG/ENG-08-3-Database-ORM.md @@ -1,4 +1,4 @@ -##### Other languages: [简体中文](/CHN//CHN/CHN-08-3-数据库-ORM) +##### Other languages: [简体中文](/CHN/CHN-08-3-数据库-ORM) ### Model @@ -286,4 +286,4 @@ drogon_ctl can also generate restful-style controllers for each model (or table) It should be noted that the controller of each table is designed to be composed of a base class and a subclass. Among them, the base class and the table are closely related, and the subclass is used to implement special business logic or modify the interface format. The advantage of this design is that when the table structure changes, users can update only the base class without overwriting the subclass(by setting the `generate_base_only` option to `true`). -# Next: [FastDbClient](/ENG//ENG/ENG-08-4-Database-FastDbClient) +# Next: [FastDbClient](/ENG/ENG-08-4-Database-FastDbClient) diff --git a/ENG/ENG-08-4-Database-FastDbClient.md b/ENG/ENG-08-4-Database-FastDbClient.md index 07922ac..85265a0 100644 --- a/ENG/ENG-08-4-Database-FastDbClient.md +++ b/ENG/ENG-08-4-Database-FastDbClient.md @@ -1,4 +1,4 @@ -##### Other languages: [简体中文](/CHN//CHN/CHN-08-4-数据库-FastDbClient) +##### Other languages: [简体中文](/CHN/CHN-08-4-数据库-FastDbClient) As the name implies, FastDbClient will provide higher performance than the normal DbClient. Unlike DbClient has own event loop, it shares the event loop with network IO threads and the main thread of the web application, which makes the internal implementation of FastDbClient available in a lock-free mode and more efficient. @@ -30,4 +30,4 @@ The use of FastDbClient is almost identical to that of the normal DbClient, exce - Synchronous transaction creation interfaces are likely to block (when all connections are busy), so FastDbClient's synchronous transaction creation interface returns null pointers directly. If you want to use transactions on FastDbClient, please use the asynchronous transaction creation interface. - After using the FastDbClient to create an Orm Mapper object, you should also use only asynchronous non-blocking interfaces of the mapper object. -# Next: [Automatic batch mode](/ENG//ENG/ENG-08-5-Database-auto_batch) +# Next: [Automatic batch mode](/ENG/ENG-08-5-Database-auto_batch) diff --git a/ENG/ENG-08-5-Database-auto_batch.md b/ENG/ENG-08-5-Database-auto_batch.md index 9405996..8060ccf 100644 --- a/ENG/ENG-08-5-Database-auto_batch.md +++ b/ENG/ENG-08-5-Database-auto_batch.md @@ -1,4 +1,4 @@ -##### Other languages: [简体中文](/CHN//CHN/CHN-08-5-数据库-自动批处理) +##### Other languages: [简体中文](/CHN/CHN-08-5-数据库-自动批处理) The automatic batch mode is only valid for the client library of postgresql 14+ version, and will be ignored in other cases. Before talking about automatic batch processing, let's understand the pipeline mode first. @@ -33,4 +33,4 @@ Therefore, automatic batch mode is helpful to improve performance, but it is not When using the newPgClient interface to create a client, set the third parameter to true to enable automatic batch mode; When using a configuration file to create a client, set the auto_batch option to true to enable automatic batch mode for the client; -# Next: [Request References](/ENG//ENG/ENG-09-0-References-request) +# Next: [Request References](/ENG/ENG-09-0-References-request) diff --git a/ENG/ENG-09-0-References-request.md b/ENG/ENG-09-0-References-request.md index 7896981..c7c8ac1 100644 --- a/ENG/ENG-09-0-References-request.md +++ b/ENG/ENG-09-0-References-request.md @@ -267,4 +267,4 @@ void mycontroller::postfile(const HttpRequestPtr &req, std::function