mod_FingerPrint.cpp 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. // mod_FingerPrint.cpp : 定义 DLL 应用程序的导出函数。
  2. //
  3. #include "stdafx.h"
  4. #include "mod_FingerPrint.h"
  5. void FingerPrintServerSession::Handle_GetDevInfo(SpReqAnsContext<FingerPrintService_GetDevInfo_Req, FingerPrintService_GetDevInfo_Ans>::Pointer ctx)
  6. {
  7. LOG_FUNCTION();
  8. DbgToBeidou(ctx->link, __FUNCTION__)();
  9. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke GetDevInfo");
  10. m_pEntity->GetDevInfo(ctx);
  11. }
  12. void FingerPrintServerSession::Handle_GetDevStatus(SpReqAnsContext<FingerPrintService_GetDevStatus_Req, FingerPrintService_GetDevStatus_Ans>::Pointer ctx)
  13. {
  14. LOG_FUNCTION();
  15. DbgToBeidou(ctx->link, __FUNCTION__)();
  16. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke GetDevStatus");
  17. m_pEntity->GetDevStatus(ctx);
  18. }
  19. void FingerPrintServerSession::Handle_GetImageAndFeature(SpReqAnsContext<FingerPrintService_GetImageAndFeature_Req, FingerPrintService_GetImageAndFeature_Ans>::Pointer ctx)
  20. {
  21. LOG_FUNCTION();
  22. DbgToBeidou(ctx->link, __FUNCTION__)();
  23. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke GetImageAndFeature");
  24. m_pEntity->GetImageAndFeature(ctx);
  25. }
  26. void FingerPrintServerSession::Handle_GetImageAndFeatureEx(SpReqAnsContext<FingerPrintService_GetImageAndFeatureEx_Req, FingerPrintService_GetImageAndFeatureEx_Ans>::Pointer ctx)
  27. {
  28. LOG_FUNCTION();
  29. DbgToBeidou(ctx->link, __FUNCTION__)();
  30. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke GetImageAndFeatureEx");
  31. m_pEntity->GetImageAndFeatureEx(ctx);
  32. }
  33. //有用接口:加入交易记录日志扫描动作
  34. void FingerPrintServerSession::Handle_GetFingerPrint(SpReqAnsContext<FingerPrintService_GetFingerPrint_Req, FingerPrintService_GetFingerPrint_Ans>::Pointer ctx)
  35. {
  36. LOG_FUNCTION();
  37. DbgToBeidou(ctx->link, __FUNCTION__)();
  38. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke GetFingerPrint , ctx->Req.times = %d", ctx->Req.times);
  39. m_pEntity->GetFingerPrint(ctx);
  40. }
  41. //有用接口:加入交易记录日志生成指纹模板
  42. void FingerPrintServerSession::Handle_GenerateTemplate(SpReqAnsContext<FingerPrintService_GenerateTemplate_Req, FingerPrintService_GenerateTemplate_Ans>::Pointer ctx)
  43. {
  44. LOG_FUNCTION();
  45. DbgToBeidou(ctx->link, __FUNCTION__)();
  46. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke GenerateTemplate");
  47. m_pEntity->GenerateTemplate(ctx);
  48. }
  49. void FingerPrintServerSession::Handle_CancelRegister(SpOnewayCallContext<FingerPrintService_CancelRegister_Info>::Pointer ctx)
  50. {
  51. LOG_FUNCTION();
  52. DbgToBeidou(ctx->link, __FUNCTION__)();
  53. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke CancelRegister");
  54. m_pEntity->CancelRegister(ctx);
  55. }
  56. void FingerPrintServerSession::Handle_CancelMatch(SpOnewayCallContext<FingerPrintService_CancelMatch_Info>::Pointer ctx)
  57. {
  58. LOG_FUNCTION();
  59. DbgToBeidou(ctx->link, __FUNCTION__)();
  60. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke CancelMatch");
  61. m_pEntity->CancelMatch(ctx);
  62. }
  63. void FingerPrintServerSession::Handle_Match(SpReqAnsContext<FingerPrintService_Match_Req, FingerPrintService_Match_Ans>::Pointer ctx)
  64. {
  65. LOG_FUNCTION();
  66. DbgToBeidou(ctx->link, __FUNCTION__)();
  67. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke CheckAndMatch");
  68. m_pEntity->CheckAndMatch(ctx);
  69. }
  70. void FingerPrintServerSession::Handle_Exit(SpOnewayCallContext<FingerPrintService_Exit_Info>::Pointer ctx)
  71. {
  72. LOG_FUNCTION();
  73. DbgToBeidou(ctx->link, __FUNCTION__)();
  74. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke Exit");
  75. m_pEntity->Exit(ctx);
  76. }
  77. #pragma region JS接口实现
  78. void FingerPrintServerSession::Handle_GetFingerPrintJS(SpReqAnsContext<FingerPrintService_GetFingerPrintJS_Req, FingerPrintService_GetFingerPrintJS_Ans>::Pointer ctx)
  79. {
  80. LOG_FUNCTION();
  81. DbgToBeidou(ctx->link, __FUNCTION__)();
  82. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke GetFingerPrintJS , fingerSN = %d, scanTimeOut = %d", ctx->Req.fingerSN,ctx->Req.scanTimeOut);
  83. m_pEntity->GetFingerPrintJS(ctx);
  84. }
  85. void FingerPrintServerSession::Handle_GenerateTemplateJS(SpReqAnsContext<FingerPrintService_GenerateTemplateJS_Req, FingerPrintService_GenerateTemplateJS_Ans>::Pointer ctx)
  86. {
  87. LOG_FUNCTION();
  88. DbgToBeidou(ctx->link, __FUNCTION__)();
  89. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke GenerateTemplateJS");
  90. m_pEntity->GenerateTemplateJS(ctx);
  91. }
  92. void FingerPrintServerSession::Handle_CancelScanJS(SpReqAnsContext<FingerPrintService_CancelScanJS_Req, FingerPrintService_CancelScanJS_Ans>::Pointer ctx)
  93. {
  94. LOG_FUNCTION();
  95. DbgToBeidou(ctx->link, __FUNCTION__)();
  96. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke CancelScanJS");
  97. m_pEntity->CancelScanJS(ctx);
  98. }
  99. #pragma endregion JS接口实现
  100. void CFingerPrintEntity::OnSysVarEvent(const char *pszKey,
  101. const char *pszValue, const char *pszOldValue, const char *pszEntityName)
  102. {
  103. if ((_strnicmp(pszKey, "UIState", strlen("UIState")) == 0))
  104. { //增加页面位置判断
  105. m_fsm.OnUIState4SetWhatPage(pszValue);
  106. }
  107. }
  108. SP_BEGIN_ENTITY_MAP()
  109. SP_ENTITY(CFingerPrintEntity)
  110. SP_END_ENTITY_MAP()