diff --git a/.gitmodules b/.gitmodules index dce47f2..ac2c362 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,3 +4,6 @@ [submodule "MySQLWrapper"] path = MySQLWrapper url = http://kiritow.com:3000/HCTECH/MySQLWrapper.git +[submodule "WinUtil"] + path = WinUtil + url = http://kiritow.com:3000/Kiritow/WinUtil diff --git a/HTTPWrapper b/HTTPWrapper index c4392bb..efbdcd7 160000 --- a/HTTPWrapper +++ b/HTTPWrapper @@ -1 +1 @@ -Subproject commit c4392bbb9577687737114f237b0c3af641d75208 +Subproject commit efbdcd7554942a0999a4f29fc95d79e7c9d3c1f8 diff --git a/addbook.cpp b/addbook.cpp new file mode 100644 index 0000000..e69de29 diff --git a/addbooktype.cpp b/addbooktype.cpp new file mode 100644 index 0000000..e69de29 diff --git a/editbook.cpp b/editbook.cpp new file mode 100644 index 0000000..e69de29 diff --git a/editbooktype.cpp b/editbooktype.cpp new file mode 100644 index 0000000..e69de29 diff --git a/explore.cpp b/explore.cpp new file mode 100644 index 0000000..e69de29 diff --git a/installer.cpp b/installer.cpp index d496a4d..949043e 100644 --- a/installer.cpp +++ b/installer.cpp @@ -74,32 +74,6 @@ static vector splitMultiSQL(const string& multisql) return vec; } -template -void _do_make_str(ostringstream& ostr,T&& x) -{ - ostr< -void _do_make_str(ostringstream& ostr,T&& x,Args&&... args) -{ - ostr< -string make_str(Args&&... args) -{ - ostringstream ostr; - _do_make_str(ostr,args...); - return ostr.str(); -} - int main() { Request req; @@ -119,13 +93,11 @@ int main() !req.post["dbuser"].empty() && !req.post["dbpass"].empty() && !req.post["dbname"].empty() && - !req.post["tbprefix"].empty() && !req.post["supass"].empty()) { string s=getFileContent("setup.sql"); - replaceFlag(s,"{prefix}",req.post["tbprefix"]); vector vec=splitMultiSQL(s); - vec.push_back(make_str("insert into ",req.post["tbprefix"],"_user values ('root','",req.post["supass"],"','SuperUser',0,3) ")); + vec.push_back(make_str("insert into bs_user values ('root','",req.post["supass"],"','SuperUser',0,3) ")); int ecode; string emsg; int ret=doInstall(req.post["dbaddr"],req.post["dbuser"],req.post["dbpass"],req.post["dbname"],ParseInt(req.post["dbport"]),vec, @@ -140,6 +112,7 @@ int main() else { j["success"]=1; + WriteDBConfig(req.post["dbaddr"],req.post["dbuser"],req.post["dbpass"],req.post["dbname"],ParseInt(req.post["dbport"])); } } else @@ -149,6 +122,12 @@ int main() j["errmsg"]=make_str("Failed to parse parameters. Please retry."); } } + else + { + j["success"]=0; + j["errcode"]=3; + j["errmsg"]=make_str("Unknown request method."); + } res.content.append(j.dump()); res.show(); diff --git a/login.cpp b/login.cpp new file mode 100644 index 0000000..e69de29 diff --git a/register.cpp b/register.cpp new file mode 100644 index 0000000..e69de29 diff --git a/removebook.cpp b/removebook.cpp new file mode 100644 index 0000000..e69de29 diff --git a/removebooktype.cpp b/removebooktype.cpp new file mode 100644 index 0000000..e69de29 diff --git a/search.cpp b/search.cpp new file mode 100644 index 0000000..e69de29