优化MYSQL模块

This commit is contained in:
xx
2024-05-26 23:54:21 +08:00
parent c8a74fc3c4
commit f4bad7d69c
6 changed files with 37 additions and 22 deletions

View File

@@ -17,7 +17,7 @@ namespace ylib
struct interceptor_info {
std::regex express;
std::string express_string;
std::function<bool(network::http::reqpack* rp)> callback;
std::function<bool(network::http::reqpack* rp, const std::string& express)> callback;
};
/******************************************************
* class拦截器
@@ -26,9 +26,8 @@ namespace ylib
{
public:
interceptor();
~interceptor();
size_t add(const std::string& regex_express, std::function<bool(network::http::reqpack* rp)> callback);
void remove(size_t index);
~interceptor();
size_t add(const std::string& regex_express, std::function<bool(network::http::reqpack* rp,const std::string& express)> callback);
bool trigger(const std::string& url, network::http::reqpack* rp);
private:
ylib::nolock_array<interceptor_info*> m_array;