mod_download.cpp 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. #include "mod_download.h"
  2. void DownloadSession::Handle_DownloadFile(SpReqAnsContext<DownloadService_DownloadFile_Req, DownloadService_DownloadFile_Ans>::Pointer ctx)
  3. {
  4. ErrorCodeEnum returnCode = ((CDownloadEntity*)m_pEntity)->DownloadFile(ctx);
  5. ctx->Answer(returnCode);
  6. }
  7. void DownloadSession::Handle_IsDownloading(SpReqAnsContext<DownloadService_IsDownloading_Req, DownloadService_IsDownloading_Ans>::Pointer ctx)
  8. {
  9. auto rc = ((CDownloadEntity*)m_pEntity)->IsDownloading(ctx->Ans.bDownloading);
  10. ctx->Answer(rc);
  11. }
  12. void DownloadSession::Handle_CancelDownloadFile(SpReqAnsContext<DownloadService_CancelDownloadFile_Req, DownloadService_CancelDownloadFile_Ans>::Pointer ctx)
  13. {
  14. ErrorCodeEnum returnCode = ((CDownloadEntity*)m_pEntity)->CancelDownloadFile(ctx);
  15. ctx->Answer(returnCode);
  16. }
  17. void DownloadSession::Handle_QueryDownloadState(SpReqAnsContext<DownloadService_QueryDownloadState_Req, DownloadService_QueryDownloadState_Ans>::Pointer ctx)
  18. {
  19. auto rc = ((CDownloadEntity*)m_pEntity)->QueryDownloadState(ctx);
  20. ctx->Answer(rc);
  21. }
  22. SP_BEGIN_ENTITY_MAP()
  23. SP_ENTITY(CDownloadEntity)
  24. SP_END_ENTITY_MAP()