From 3cbeb23b77dccce40322d076b04579dd62be3c3a Mon Sep 17 00:00:00 2001 From: hzq Date: Sat, 24 Dec 2022 23:21:06 +0800 Subject: [PATCH] . --- orm/cms/Article.sql | 2 +- orm/cms/include/articlebase.h | 30 ++++----- orm/cms/include/userbase.h | 10 +-- vendor/httpcli/modelfun.hpp | 85 ++++++++++++++++++++++-- vendor/httpserver/include/mysqlmodel.hpp | 43 ++++++------ 5 files changed, 121 insertions(+), 49 deletions(-) diff --git a/orm/cms/Article.sql b/orm/cms/Article.sql index 721549d3..816ec9e9 100644 --- a/orm/cms/Article.sql +++ b/orm/cms/Article.sql @@ -20,4 +20,4 @@ CREATE TABLE `article` ( `summary` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '文章摘要', `editauthor` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '文章编辑', PRIMARY KEY (`aid`) -) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci \ No newline at end of file +) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci \ No newline at end of file diff --git a/orm/cms/include/articlebase.h b/orm/cms/include/articlebase.h index 8d5cfbcf..8a1f6c18 100644 --- a/orm/cms/include/articlebase.h +++ b/orm/cms/include/articlebase.h @@ -2,7 +2,7 @@ #define ORM_CMS_ARTICLEBASEMATA_H /* *This file is auto create from cli -*本文件为自动生成 Fri, 23 Dec 2022 16:21:15 GMT +*本文件为自动生成 Sat, 24 Dec 2022 15:17:41 GMT ***/ #include #include @@ -530,14 +530,14 @@ tempsql<<"null"; tempsql< #include @@ -238,14 +238,14 @@ tempsql<<"null"; tempsql<<",'"< conn = http::get_mysqlselectexecute(dbhash); MYSQL_RES *resultone = nullptr; mysql_ping(conn.get()); - int readnum = mysql_query(conn.get(), &countsql[0]); + long long readnum = mysql_real_query(conn.get(), &sqlstring[0],sqlstring.size()); if (readnum != 0) { @@ -164,9 +164,9 @@ namespace orm try { - std::unique_ptr conn = http::get_mysqlselectexecute(dbhash); + std::unique_ptr conn = http::get_mysqleditexecute(dbhash); mysql_ping(conn.get()); - long long readnum = mysql_query(conn.get(), &countsql[0]); + long long readnum = mysql_real_query(conn.get(), &sqlstring[0],sqlstring.size()); readnum = mysql_affected_rows(conn.get()); try { @@ -1285,7 +1285,7 @@ namespace orm std::unique_ptr conn = http::get_mysqlselectexecute(dbhash); MYSQL_RES *resultall = nullptr; mysql_ping(conn.get()); - int readnum = mysql_query(conn.get(), &sqlstring[0]); + long long readnum = mysql_real_query(conn.get(), &sqlstring[0],sqlstring.size()); if (readnum != 0) { @@ -1390,7 +1390,7 @@ namespace orm std::unique_ptr conn = http::get_mysqlselectexecute(dbhash); MYSQL_RES *resultall = nullptr; mysql_ping(conn.get()); - int readnum = mysql_query(conn.get(), &sqlstring[0]); + long long readnum = mysql_real_query(conn.get(), &sqlstring[0],sqlstring.size()); if (readnum != 0) { @@ -1506,7 +1506,7 @@ namespace orm std::unique_ptr conn = http::get_mysqlselectexecute(dbhash); MYSQL_RES *resultall = nullptr; mysql_ping(conn.get()); - int readnum = mysql_query(conn.get(), &sqlstring[0]); + long long readnum = mysql_real_query(conn.get(), &sqlstring[0],sqlstring.size()); if (readnum != 0) { @@ -1642,7 +1642,7 @@ namespace orm std::unique_ptr conn = http::get_mysqlselectexecute(dbhash); MYSQL_RES *resultall = nullptr; mysql_ping(conn.get()); - int readnum = mysql_query(conn.get(), &sqlstring[0]); + long long readnum = mysql_real_query(conn.get(), &sqlstring[0],sqlstring.size()); if (readnum != 0) { @@ -1721,7 +1721,7 @@ namespace orm std::unique_ptr conn = http::get_mysqlselectexecute(dbhash); MYSQL_RES *resultone = nullptr; mysql_ping(conn.get()); - int readnum = mysql_query(conn.get(), &sqlstring[0]); + long long readnum = mysql_real_query(conn.get(), &sqlstring[0],sqlstring.size()); if (readnum != 0) { @@ -1806,9 +1806,9 @@ namespace orm } try { - std::unique_ptr conn = http::get_mysqlselectexecute(dbhash); + std::unique_ptr conn = http::get_mysqleditexecute(dbhash); mysql_ping(conn.get()); - long long readnum = mysql_query(conn.get(), &sqlstring[0]); + long long readnum = mysql_real_query(conn.get(), &sqlstring[0],sqlstring.size()); readnum = mysql_affected_rows(conn.get()); try { @@ -1856,9 +1856,9 @@ namespace orm } try { - std::unique_ptr conn = http::get_mysqlselectexecute(dbhash); + std::unique_ptr conn = http::get_mysqleditexecute(dbhash); mysql_ping(conn.get()); - long long readnum = mysql_query(conn.get(), &sqlstring[0]); + long long readnum = mysql_real_query(conn.get(), &sqlstring[0],sqlstring.size()); readnum = mysql_affected_rows(conn.get()); try { @@ -1904,9 +1904,9 @@ namespace orm } try { - std::unique_ptr conn = http::get_mysqlselectexecute(dbhash); + std::unique_ptr conn = http::get_mysqleditexecute(dbhash); mysql_ping(conn.get()); - long long readnum = mysql_query(conn.get(), &sqlstring[0]); + long long readnum = mysql_real_query(conn.get(), &sqlstring[0],sqlstring.size()); readnum = mysql_affected_rows(conn.get()); try { @@ -1937,9 +1937,9 @@ namespace orm try { - std::unique_ptr conn = http::get_mysqlselectexecute(dbhash); + std::unique_ptr conn = http::get_mysqleditexecute(dbhash); mysql_ping(conn.get()); - long long readnum = mysql_query(conn.get(), &sqlstring[0]); + long long readnum = mysql_real_query(conn.get(), &sqlstring[0],sqlstring.size()); readnum = mysql_affected_rows(conn.get()); try { @@ -1991,10 +1991,9 @@ namespace orm try { - std::unique_ptr conn = http::get_mysqlselectexecute(dbhash); + std::unique_ptr conn = http::get_mysqleditexecute(dbhash); mysql_ping(conn.get()); - long long readnum = mysql_query(conn.get(), &sqlstring[0]); - + long long readnum = mysql_real_query(conn.get(), &sqlstring[0],sqlstring.size()); if (readnum != 0) { error_msg = std::string(mysql_error(conn.get())); @@ -2029,10 +2028,10 @@ namespace orm try { - std::unique_ptr conn = http::get_mysqlselectexecute(dbhash); + sqlstring = base::_makeinsertsql(); + std::unique_ptr conn = http::get_mysqleditexecute(dbhash); mysql_ping(conn.get()); - long long readnum = mysql_query(conn.get(), &sqlstring[0]); - + long long readnum = mysql_real_query(conn.get(), &sqlstring[0],sqlstring.size()); if (readnum != 0) { error_msg = std::string(mysql_error(conn.get()));