main.go 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. package main
  2. import (
  3. "data_ai/extract"
  4. "data_ai/tool"
  5. "data_ai/udp"
  6. "data_ai/ul"
  7. log "github.com/donnie4w/go-logger/logger"
  8. )
  9. func init() {
  10. //增量设置全部false
  11. ul.IsTool = true
  12. ul.IsFull = false
  13. ul.IsLocal = true
  14. if ul.IsTool {
  15. log.Debug("工具版本···")
  16. ul.InitToolVar()
  17. } else {
  18. ul.InitGlobalVar()
  19. if !ul.IsFull {
  20. log.Debug("正常版本···")
  21. udp.InitProcessVar()
  22. } else {
  23. log.Debug("全量版本···")
  24. }
  25. }
  26. }
  27. func main() {
  28. if ul.IsTool {
  29. tool.StartToolInfo()
  30. return
  31. } else {
  32. if !ul.IsFull {
  33. extract.TestSingleFieldInfo("bidding", "670cc446b25c3e1deb887d52")
  34. return
  35. }
  36. }
  37. lock := make(chan bool)
  38. <-lock
  39. }
  40. //func test() {
  41. // log.Debug("开始大模型验证内存数据···")
  42. // q := map[string]interface{}{}
  43. // pool_mgo := make(chan bool, ul.Reading)
  44. // wg_mgo := &sync.WaitGroup{}
  45. // sess := ul.SourceMgo.GetMgoConn()
  46. // defer ul.SourceMgo.DestoryMongoConn(sess)
  47. // total, isok := 0, 0
  48. // it := sess.DB(ul.SourceMgo.DbName).C(ul.Ext_Name).Find(&q).Sort("_id").Iter()
  49. // for tmp := make(map[string]interface{}); it.Next(&tmp); total++ {
  50. // if total%100 == 0 {
  51. // log.Debug("cur index ", total)
  52. // }
  53. // isok++
  54. // pool_mgo <- true
  55. // wg_mgo.Add(1)
  56. // go func(tmp map[string]interface{}) {
  57. // defer func() {
  58. // <-pool_mgo
  59. // wg_mgo.Done()
  60. // }()
  61. // detail := qu.ObjToString(tmp["detail"])
  62. // filetext := qu.ObjToString(tmp["filetext"]) //此处为附件信息···
  63. // if utf8.RuneCountInString(detail) < 100 {
  64. // detail = filetext
  65. // }
  66. // detail = ul.HttpConvertToMarkdown(detail)
  67. // //最终结果...
  68. // if detail != "" {
  69. //
  70. // }
  71. // }(tmp)
  72. // tmp = make(map[string]interface{})
  73. // }
  74. // wg_mgo.Wait()
  75. // log.Debug("ai is over ...")
  76. //}