12345678910111213141516171819202122232425262728293031 |
- package services
- import (
- "fmt"
- "github.com/rdlucklib/rdluck_tools/http"
- "hongze/hongtao3_watch/global"
- "net/url"
- )
- const (
- // RefreshUrl 值示例:http://127.0.0.1:7007/hongtao/refresh?FilePath=E:\hz\hongtao3_data\excel\Oneline\%E7%83%A7%E7%A2%B1.xlsx
- DefaultRefreshUrl = "http://127.0.0.1:7007/"
- )
- // InvokeRefreshServer 调用红桃3刷新数据的服务(目前是python)
- func InvokeRefreshServer(filePath string) {
- var refreshUrl string
- refreshUrl = global.CONFIG.Serve.RefreshUrl
- if global.CONFIG.Serve.RefreshUrl == "" {
- refreshUrl = DefaultRefreshUrl
- }
- //filePathStr:=url.PathEscape(filePath)
- refreshUrl = refreshUrl + "hongtao/refresh?FilePath=" + url.QueryEscape(filePath)
- fmt.Println("红桃3刷新,文件路径:", filePath, ";刷新URL:"+refreshUrl)
- body, err := http.Get(refreshUrl)
- if err != nil {
- fmt.Println("红桃3刷新 Err:" + err.Error())
- return
- }
- fmt.Println("红桃3刷新,文件路径:", filePath, " ,Result:"+string(body))
- }
|