#pragma once #include "WebUser.h" #include "Msg.h" #include "cJSON.h" namespace ver_2 { class WSUser : public WebUser { public: #if defined(HG_CMP_MSC) WSUser(WebServer* server, HGUInt id, const std::string& ip, uint16_t port, SOCKET sockConn); #else WSUser(WebServer* server, HGUInt id, const std::string& ip, uint16_t port, int sockConn); #endif virtual ~WSUser(); ManagerV2* GetManager(); void HandleCmd(const WSCmdParam* param); void HandleEvent(const WSEvtParam* param); protected: void PostCmdMsg(const HGByte* data, HGUInt dataSize); void PostEventMsg(const HGByte* data, HGUInt dataSize); virtual void ThreadFunc(); public: static void SaneEvent(int code, const char* str, bool err, void* param); static void SaneImageCallback(const char* path, bool blank, void* param); private: bool ShakeHand(const std::string& head); void Pong(); bool SendResponse(const HGByte* data, HGUInt size, HGBool text); void SetGlobalConfig(cJSON* json); void GetGlobalConfig(cJSON* json); void LoadLocalImage(cJSON* json); void SaveLocalImage(cJSON* json); void DeleteLocalFile(cJSON* json); void ClearGlobalFileSavePath(cJSON* json); void UploadFile(cJSON* json, const std::string& func); void MergeImage(cJSON* json, const std::string& func); void MakeMultiImage(cJSON* json, const std::string& func); void SplitImage(cJSON* json, const std::string& func); void MakeZipFile(cJSON* json, const std::string& func); void ImageDeskew(cJSON* json, const std::string& func); void ImageAddWatermark(cJSON* json, const std::string& func); void ImageDecontamination(cJSON* json, const std::string& func); void ImageDirectionCorrect(cJSON* json, const std::string& func); void ImageClip(cJSON* json, const std::string& func); void InitDevice(cJSON* json); void DeinitDevice(cJSON* json); void IsDeviceInit(cJSON* json); void GetDeviceNameList(cJSON* json); void OpenDevice(cJSON* json); void CloseDevice(cJSON* json); void GetDeviceSN(cJSON* json); void SetDeviceParam(cJSON* json); void GetDeviceParam(cJSON* json); void ResetDeviceParam(cJSON* json); void GetCurrDeviceName(cJSON* json); void StartScan(cJSON* json); void StopScan(cJSON* json); void IsDeviceScanning(cJSON* json); void GetBatchIdList(cJSON* json); void OpenBatch(cJSON* json); void DeleteBatch(cJSON* json); void NewBatch(cJSON* json); void GetCurrBatchId(cJSON* json); void ModifyBatchId(cJSON* json); void BindFolder(cJSON* json); void StopBindFolder(cJSON* json); void GetImageThumbnailList(cJSON* json); void GetImageCount(cJSON* json); void LoadImage(cJSON* json); void SaveImage(cJSON* json); void InsertLocalImage(cJSON* json); void InsertImage(cJSON* json); void ModifyImageTag(cJSON* json); void DeleteImage(cJSON* json); void ClearImageList(cJSON* json); void ModifyImage(cJSON* json); void ModifyImageByLocal(cJSON* json); void MoveImage(cJSON* json); void ExchangeImage(cJSON* json); void ImageBookSort(cJSON* json); private: std::string m_initDeviceIden; bool m_initDeviceHaveIden; std::string m_startScanIden; bool m_startScanHaveIden; bool m_startScanBlankCheck; bool m_startScanIsLocalSave; bool m_startScanIsGetBase64; }; }