12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- #ifndef _SMS_HANDLE_HEADER_
- #define _SMS_HANDLE_HEADER_
- #include "CritSection.h"
- #include "CurlClient.h"
- typedef struct _SEND_RESPONEINFO_
- {
- CString strSendStatus; //发送状态
- CString strSendCount; //
- CString strBalance; //
- CString strErPhone;
- CString strSid;
- }ResponebySend, *pResponebySend;
- typedef struct _QUERYACCOUNTINFO_
- {
- CString strSendStatus;
- CString strAccount;
- CString strBalance;
- CString strSMSCharacterCount;
- CString strSignatures;
- CString strOwnedOperators; //平台服务器商
- }QuerAccountInfo, *pQuerAccountInfo;
- // 记录表sendreg
- typedef struct _SSendReg
- {
- CString account;
- CString phones;
- CString content;
- CString timestamp;
- CString msgcount;
- CString log;
- CString status;
- CString Sid;
- CString autoid;
- }SSendReg, *pSSendReg;
- #pragma once
- class CSMSHandle
- {
- public:
- CSMSHandle();
- ~CSMSHandle();
- INT AnalyzeSendStatus(LPBYTE lpRespone, ResponebySend &lRespone);
- //获取帐户信息
- int GetSMSBlance(const TCHAR* pSMSServer, const DWORD& dwPort, CString& strAccount, CString& strPwd, QuerAccountInfo& tAccountInfo);
- //发送短信
- int SendSMToSever(const TCHAR* pSMSServer, const DWORD& dwPort, const CString& strAccount, const CString& strPwd, const CString& strPhones, const CString& strContent, const CString& strStampTime, const CString& strAutoID);
- //获取短信状态
- int GetSMState(const TCHAR* pSMSServer, const DWORD& dwPort, const CString& strAccount, const CString& strPwd, const SSendReg* pSR);
- void UrlUTF8Decode(LPBYTE lpRespone, CString& strRespone);
- void UTF8ToWideChar(LPBYTE lpRespone, CString& strRespone);
- private:
- ThreadSection *ReturnSection(){return &s_critSection;}
- int UpdateSMLog(const int nRet, const ResponebySend* lRespone, const CString& strAutoID);
- private:
- ThreadSection s_critSection;
- utilitySdk::CCurlClient m_url;
- };
- #endif
|