diff --git a/build.sh b/build.sh index 5de0a431..c6b4923f 100755 --- a/build.sh +++ b/build.sh @@ -14,7 +14,7 @@ echo $arch if [ ${systype} = "UnionTech" ] then system="uos" -elif [ ${systype} = "kylin" ] +elif [ ${systype} = "Kylin" ] then system="kylin" fi diff --git a/sdk/webservice/Manager.h b/sdk/webservice/Manager.h index 04564c5d..1974dea0 100644 --- a/sdk/webservice/Manager.h +++ b/sdk/webservice/Manager.h @@ -1,7 +1,5 @@ #pragma once -#include "base/HGDef.h" -#include "base/HGInc.h" #include "base/HGMsgPump.h" class Manager diff --git a/sdk/webservice/ManagerV1.h b/sdk/webservice/ManagerV1.h index 9289a6d0..05a7c18e 100644 --- a/sdk/webservice/ManagerV1.h +++ b/sdk/webservice/ManagerV1.h @@ -10,6 +10,7 @@ #include "Manager.h" #include "Msg.h" #include +#include namespace ver_1 { diff --git a/sdk/webservice/ManagerV2.cpp b/sdk/webservice/ManagerV2.cpp index 9955177f..4cdab754 100644 --- a/sdk/webservice/ManagerV2.cpp +++ b/sdk/webservice/ManagerV2.cpp @@ -89,6 +89,10 @@ namespace ver_2 if (0 == imgType) return -1; + int ret = LoadBase64(Utf8ToStdString(imagePath), imgBase64); + if (0 != ret) + return ret; + std::string prefix = "data:image/jpeg;base64,"; if (HGIMGFMT_TYPE_BMP == imgType) prefix = "data:image/bmp;base64,"; @@ -100,11 +104,6 @@ namespace ver_2 prefix = "data:image/pdf;base64,"; else if (HGIMGFMT_TYPE_OFD == imgType) prefix = "data:image/ofd;base64,"; - - int ret = GetBase64(Utf8ToStdString(imagePath), imgBase64); - if (0 != ret) - return ret; - imgBase64.insert(0, prefix); return 0; } @@ -132,10 +131,12 @@ namespace ver_2 suffix = "ofd"; std::string imagePath2 = GetFilePath(suffix); - int ret = SaveBase64(imagePath2, imagePath.c_str() + pos + 1); - if (0 == ret) - imagePath = StdStringToUtf8(imagePath2); - return ret; + int ret = SaveBase64(imgBase64.c_str() + pos + 1, imagePath2); + if (0 != ret) + return ret; + + imagePath = StdStringToUtf8(imagePath2); + return 0; } int ManagerV2::DeleteLocalFile(const std::string& filePath) @@ -143,6 +144,44 @@ namespace ver_2 return 0; } + int ManagerV2::ClearGlobalFileSavePath() + { + return 0; + } + + int ManagerV2::MergeLocalImage(const std::vector& imagePathList, const std::string& mode, + const std::string& align, int interval, std::string& outImagePath) + { + return 0; + } + + int ManagerV2::LocalMakeMultiImage(const std::vector& imagePathList, const std::string& format, + const std::string& tiffCompression, int tiffJpegQuality, std::string& outImagePath) + { + return 0; + } + + int ManagerV2::SplitLocalImage(const std::string& imagePath, const std::string& mode, int location, + std::vector& outImagePathList) + { + return 0; + } + + int ManagerV2::LocalMakeZipFile(const std::vector& filePathList, std::string& outZipPath) + { + return 0; + } + + int ManagerV2::LocalImageDeskew(const std::string& imagePath, std::string& outImagePath) + { + return 0; + } + + int ManagerV2::UploadLocalFile(const std::string& filePath, const std::string& mode, const std::string& remoteFilePath) + { + return 0; + } + std::string ManagerV2::GetCfgStringValue(const std::string& app, const std::string& key, const std::string& def) { HGChar cfgPath[256]; @@ -206,7 +245,7 @@ namespace ver_2 return (HGBASE_ERR_OK == HGBase_SetProfileInt(cfgPath, app.c_str(), key.c_str(), (HGInt)val)); } - int ManagerV2::GetBase64(const std::string& fileName, std::string& base64) + int ManagerV2::LoadBase64(const std::string& fileName, std::string& base64) { base64.clear(); @@ -243,7 +282,7 @@ namespace ver_2 return ret; } - int ManagerV2::SaveBase64(const std::string& fileName, const std::string& base64) + int ManagerV2::SaveBase64(const std::string& base64, const std::string& fileName) { if (base64.empty()) return -1; diff --git a/sdk/webservice/ManagerV2.h b/sdk/webservice/ManagerV2.h index e7804a46..780fcf04 100644 --- a/sdk/webservice/ManagerV2.h +++ b/sdk/webservice/ManagerV2.h @@ -10,6 +10,7 @@ #include "Manager.h" #include "Msg.h" #include +#include namespace ver_2 { @@ -53,18 +54,35 @@ namespace ver_2 int SaveLocalImage(const std::string& imgBase64, std::string& imagePath); // ɾ³ý±¾µØÎļþ int DeleteLocalFile(const std::string& filePath); + // ÇåÀíÈ«¾ÖÎļþ±£´æĿ¼ + int ClearGlobalFileSavePath(); + // ºÏ³É±¾µØͼÏñ + int MergeLocalImage(const std::vector& imagePathList, const std::string& mode, + const std::string& align, int interval, std::string& outImagePath); + // ±¾µØºÏ³É¶àÕÅͼÏñ + int LocalMakeMultiImage(const std::vector& imagePathList, const std::string& format, + const std::string& tiffCompression, int tiffJpegQuality, std::string& outImagePath); + // ²ð·Ö±¾µØͼÏñ + int SplitLocalImage(const std::string& imagePath, const std::string& mode, int location, + std::vector& outImagePathList); + // ±¾µØÉú³ÉѹËõÎļþ + int LocalMakeZipFile(const std::vector& filePathList, std::string& outZipPath); + // ±¾µØͼÏñ¾ÀÆ« + int LocalImageDeskew(const std::string& imagePath, std::string& outImagePath); + // ÉÏ´«Îļþ + int UploadLocalFile(const std::string& filePath, const std::string& mode, const std::string& remoteFilePath); private: - std::string GetCfgStringValue(const std::string& app, const std::string& key, const std::string& def); - int GetCfgIntValue(const std::string& app, const std::string& key, int def); - bool GetCfgBoolValue(const std::string& app, const std::string& key, bool def); - bool SetCfgStringValue(const std::string& app, const std::string& key, const std::string& val); - bool SetCfgIntValue(const std::string& app, const std::string& key, int val); - bool SetCfgBoolValue(const std::string& app, const std::string& key, bool val); - static int GetBase64(const std::string& fileName, std::string& base64); - static int SaveBase64(const std::string& fileName, const std::string& base64); - std::string GetFilePath(const std::string& suffix); - std::string GetImagePath(); + static std::string GetCfgStringValue(const std::string& app, const std::string& key, const std::string& def); + static int GetCfgIntValue(const std::string& app, const std::string& key, int def); + static bool GetCfgBoolValue(const std::string& app, const std::string& key, bool def); + static bool SetCfgStringValue(const std::string& app, const std::string& key, const std::string& val); + static bool SetCfgIntValue(const std::string& app, const std::string& key, int val); + static bool SetCfgBoolValue(const std::string& app, const std::string& key, bool val); + static int LoadBase64(const std::string& fileName, std::string& base64); + static int SaveBase64(const std::string& base64, const std::string& fileName); + static std::string GetFilePath(const std::string& suffix); + static std::string GetImagePath(); private: