common.go 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. // Copyright 2019 getensh.com. All rights reserved.
  2. // Use of this source code is governed by getensh.com.
  3. package handle
  4. import (
  5. "adm-ods/apis"
  6. "adm-ods/consts"
  7. "adm-ods/impl/analysis"
  8. )
  9. // 处理函数的声明
  10. type Handler func(*apis.OdsMessage) ([]map[string]string, error)
  11. type ParasHandler func(string) ([]map[string]string, error)
  12. type ProviderLogTask struct {
  13. OnlineFunction Handler
  14. ParasFunction ParasHandler
  15. }
  16. // 声明在线任务
  17. var OdsOnlineTaskMap = map[string]ProviderLogTask{
  18. consts.SOURCEODS1: {analysis.HandleOnlineOds1, analysis.ParasOds1},
  19. consts.SOURCEODS2: {analysis.HandleOnlineOds2, analysis.ParasOds2},
  20. consts.SOURCEODS3: {analysis.HandleOnlineOds3, analysis.ParasOds3},
  21. consts.SOURCEODS4: {analysis.HandleOnlineOds4, analysis.ParasOds4},
  22. consts.SOURCEODS5: {analysis.HandleOnlineOds5, analysis.ParasOds5},
  23. consts.SOURCEODS6: {analysis.HandleOnlineOds6, analysis.ParasOds6},
  24. consts.SOURCEODS7: {analysis.HandleOnlineOds7, analysis.ParasOds7},
  25. consts.SOURCEODS8: {analysis.HandleOnlineOds8, analysis.ParasOds8},
  26. consts.SOURCEODS9: {analysis.HandleOnlineOds9, analysis.ParasOds9},
  27. consts.SOURCEODS10: {analysis.HandleOnlineOds10, analysis.ParasOds10},
  28. consts.SOURCEODS11: {analysis.HandleOnlineOds11, analysis.ParasOds11},
  29. consts.SOURCEODS12: {analysis.HandleOnlineOds12, analysis.ParasOds12},
  30. consts.SOURCEODS13: {analysis.HandleOnlineOds13, analysis.ParasOds13},
  31. consts.SOURCEODS15: {analysis.HandleOnlineOds15, analysis.ParasOds15},
  32. consts.SOURCEODS16: {analysis.HandleOnlineOds16, analysis.ParasOds16},
  33. consts.SOURCEODS17: {analysis.HandleOnlineOds17, analysis.ParasOds12},
  34. consts.SOURCEODS18: {analysis.HandleOnlineOds18, analysis.ParasOds18},
  35. }
  36. // 声明数据源编码到源编码映射
  37. var ProviderApiCodeToSoucreCodeMap = map[string]string{
  38. consts.CXYVIOLATION: consts.SOURCEODS1,
  39. consts.ZQYPLATEVEHICLE: consts.SOURCEODS2,
  40. consts.ZQYVINVEHICLE: consts.SOURCEODS3,
  41. consts.ZQYINSUREDATE: consts.SOURCEODS4,
  42. consts.SPYDEFINEVIN: consts.SOURCEODS5,
  43. consts.SPYVINNEW: consts.SOURCEODS16,
  44. consts.SPYTWODATE: consts.SOURCEODS6,
  45. consts.SPYTWODATE2: consts.SOURCEODS6,
  46. consts.SPYTRANSFERRECORD: consts.SOURCEODS7,
  47. consts.SPYINSUREDATE: consts.SOURCEODS8,
  48. consts.SPYTRANSFERBYVIN: consts.SOURCEODS9,
  49. consts.SPYTWOELEMENTVERIFY: consts.SOURCEODS10,
  50. consts.DRVVEHICLEOWNERVERIFY: consts.SOURCEODS11,
  51. consts.DRVVEHICLEOWNERVERIFYBAK: consts.SOURCEODS11,
  52. consts.ZCRKTWOELEMENTVERIFY: consts.SOURCEODS12,
  53. consts.ZCRKTWOELEMENTVERIFY2: consts.SOURCEODS17,
  54. consts.ZJCVEHICLEOWNER: consts.SOURCEODS13,
  55. consts.DYIDCERTVERIFY: consts.SOURCEODS15,
  56. consts.ZCRKENGINENO: consts.SOURCEODS18,
  57. }