api_tool.go 760 B

1234567891011121314151617181920212223242526272829
  1. package services
  2. import (
  3. "eta/mysteel_watch/global"
  4. "fmt"
  5. "github.com/rdlucklib/rdluck_tools/http"
  6. "net/url"
  7. )
  8. const (
  9. RefreshUrl = "http://127.0.0.1:7007/mysteel_chemical/refresh"
  10. )
  11. // MysteelChemicalRefresh
  12. // @Description: 调用python服务去刷新excel文件
  13. // @author: Roc
  14. // @datetime 2023-11-27 09:39:05
  15. // @param filePath string
  16. func MysteelChemicalRefresh(filePath string) {
  17. //filePathStr:=url.PathEscape(filePath)
  18. refreshUrl := RefreshUrl + "?FilePath=" + url.QueryEscape(filePath)
  19. fmt.Println("MysteelChemicalRefresh URL:" + refreshUrl)
  20. body, err := http.Get(refreshUrl)
  21. if err != nil {
  22. global.LOG.Error("MysteelChemicalRefresh Err:" + err.Error())
  23. return
  24. }
  25. global.LOG.Debug("MysteelChemicalRefresh Result:" + string(body))
  26. }