var.go 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. // var
  2. package service
  3. import (
  4. "qfw/util/mongodb"
  5. "sync"
  6. )
  7. var (
  8. Sysconfig map[string]interface{} //配置文件
  9. Mogdbs map[string]MongoTool //mongodb连接
  10. ClearThread = make(chan bool, 10) //清洗线程
  11. ResultInfos []*ResultInfo //清洗后的数据
  12. UpResults []*ResultInfo //待更新数据
  13. UpdateLock = sync.Mutex{} //更新锁
  14. UpSize = 100 //批量更新阈值
  15. )
  16. type MongoTool struct {
  17. Mongodb mongodb.MongodbSim
  18. Name, Coll string
  19. }
  20. type ResultInfo struct {
  21. Bidding *BidInfo //
  22. Extract *ExtractInfo //
  23. Project *ProjectInfo //
  24. Flag int //更新标记
  25. }
  26. //bidding数据
  27. type BidInfo struct {
  28. Id string
  29. Data map[string]interface{} //原始信息
  30. UpParam []string //更新属性集
  31. }
  32. //抽取结果数据
  33. type ExtractInfo struct {
  34. Id string
  35. Data map[string]interface{} //原始信息
  36. UpParam []string //更新属性集
  37. }
  38. //项目数据
  39. type ProjectInfo struct {
  40. Id string
  41. Data map[string]interface{} //原始信息
  42. UpParam []string //更新属性集
  43. }