api_tool.go 850 B

123456789101112131415161718192021222324252627
  1. package services
  2. import (
  3. "fmt"
  4. "net/url"
  5. "github.com/rdlucklib/rdluck_tools/http"
  6. )
  7. const (
  8. // RefreshUrl 值示例:http://127.0.0.1:7007/hongtao/refresh?FilePath=E:\hz\hongtao3_data\excel\Oneline\%E7%83%A7%E7%A2%B1.xlsx
  9. RefreshUrl = "http://127.0.0.1:7007/hongqi/refresh"
  10. )
  11. // InvokeRefreshServer 调用卓创红期刷新数据的服务(目前是python)
  12. func InvokeRefreshServer(filePath string) {
  13. var refreshUrl string
  14. //filePathStr:=url.PathEscape(filePath)
  15. refreshUrl = RefreshUrl + "?FilePath=" + url.QueryEscape(filePath)
  16. fmt.Println("卓创红期刷新,文件路径:", filePath, ";刷新URL:"+refreshUrl)
  17. body, err := http.Get(refreshUrl)
  18. if err != nil {
  19. fmt.Println("卓创红期刷新 Err:" + err.Error())
  20. return
  21. }
  22. fmt.Println("卓创红期刷新,文件路径:", filePath, " ,Result:"+string(body))
  23. }