CBasicDataDownloader.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #pragma once
  2. #include "DataBaseHolder.h"
  3. #include "scan_common.h"
  4. class CBasicDataDownloader:public CDataBaseHolder,private IService
  5. {
  6. public:
  7. //数据状态
  8. enum DATA_STATE{
  9. //未工作
  10. DS_UNWORKING,
  11. //加载中
  12. DS_LOADING,
  13. //加载出错
  14. DS_ERROR,
  15. //加载完成
  16. DS_COMPLETE
  17. };
  18. //BasicDataDownloader错误代码
  19. enum BDD_ERROR_CODE{
  20. //正常
  21. BDD_ERROR_CODE_NORMAL,
  22. //请求失败
  23. BDD_ERROR_CODE_REQUEST_FAILTURE,
  24. //服务器发生错误
  25. BDD_ERROR_CODE_SERVER_ERROR,
  26. //试卷状态不正确
  27. BDD_ERROR_CODE_PAPER_STATE_ERROR,
  28. };
  29. public:
  30. CBasicDataDownloader(void);
  31. ~CBasicDataDownloader(void);
  32. //下载题型数据
  33. int download_question_std(CString examId,CString examCourseId);
  34. DATA_STATE GetDataState(){return m_data_state;}
  35. std::string GetExamName();
  36. std::string GetCourseCode();
  37. int GetErrorCode();
  38. std::string GetErrorMsg();
  39. protected:
  40. virtual ServiceState OnRunning(void);
  41. private:
  42. int download_question_std0( CString examId,CString examCourseId );
  43. DATA_STATE m_data_state;//数据状态
  44. enum TaskType{
  45. DOWNLOAD_QUESTION_STD,
  46. DOWNLOAD_SAME_CLASS_STUDENT
  47. } m_task_type;
  48. CString m_examId;
  49. CString m_exam_number;
  50. CString m_examCourseId;
  51. std::string m_exam_name;
  52. std::string m_course_code;
  53. BDD_ERROR_CODE m_error_code;
  54. std::string m_message;
  55. };