task.go 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. package services
  2. import (
  3. "eta/eta_data_init/utils"
  4. "fmt"
  5. )
  6. var IndexSourceMap map[string]int
  7. // IndexSourceRefreshMap 指标刷新地址的map
  8. var IndexSourceRefreshMap = map[int]string{
  9. utils.DATA_SOURCE_THS: "ths/refresh",
  10. utils.DATA_SOURCE_WIND: "wind/refresh",
  11. utils.DATA_SOURCE_PB: "pb/refresh",
  12. utils.DATA_SOURCE_LT: "lt/refresh",
  13. utils.DATA_SOURCE_MYSTEEL_CHEMICAL: "mysteel_chemical/refresh",
  14. utils.DATA_SOURCE_YS: "smm/refresh",
  15. }
  16. func Task() {
  17. fmt.Println("task start")
  18. //path, err := filepath.Abs(os.Args[0])
  19. //if err != nil {
  20. // fmt.Println(err)
  21. //}
  22. //
  23. //dir := filepath.Dir(path)
  24. //fmt.Println(dir)
  25. IndexSourceMap = make(map[string]int)
  26. IndexSourceMap["ths"] = utils.DATA_SOURCE_THS
  27. IndexSourceMap["同花顺"] = utils.DATA_SOURCE_THS
  28. IndexSourceMap["wind"] = utils.DATA_SOURCE_WIND
  29. IndexSourceMap["万得"] = utils.DATA_SOURCE_WIND
  30. IndexSourceMap["钢联"] = utils.DATA_SOURCE_MYSTEEL_CHEMICAL
  31. IndexSourceMap["彭博"] = utils.DATA_SOURCE_PB
  32. IndexSourceMap["SMM"] = utils.DATA_SOURCE_YS
  33. IndexSourceMap["路透"] = utils.DATA_SOURCE_LT
  34. fmt.Println("task end")
  35. }