mirror of
https://github.com/ArvinLovegood/go-stock.git
synced 2025-07-19 00:00:09 +08:00
update
This commit is contained in:
parent
9665462ae5
commit
29158f51af
@ -162,7 +162,7 @@ func NewStockDataApi() *StockDataApi {
|
|||||||
}
|
}
|
||||||
func (receiver StockDataApi) GetStockBaseInfo() {
|
func (receiver StockDataApi) GetStockBaseInfo() {
|
||||||
res := &TushareStockBasicResponse{}
|
res := &TushareStockBasicResponse{}
|
||||||
_, err := receiver.client.R().
|
resp, err := receiver.client.R().
|
||||||
SetHeader("content-type", "application/json").
|
SetHeader("content-type", "application/json").
|
||||||
SetBody(&TushareRequest{
|
SetBody(&TushareRequest{
|
||||||
ApiName: "stock_basic",
|
ApiName: "stock_basic",
|
||||||
@ -174,7 +174,7 @@ func (receiver StockDataApi) GetStockBaseInfo() {
|
|||||||
Post(tushare_api_url)
|
Post(tushare_api_url)
|
||||||
//logger.SugaredLogger.Infof("GetStockBaseInfo %s", string(resp.Body()))
|
//logger.SugaredLogger.Infof("GetStockBaseInfo %s", string(resp.Body()))
|
||||||
//resp.Body()写入文件
|
//resp.Body()写入文件
|
||||||
//ioutil.WriteFile("stock_basic.json", resp.Body(), 0666)
|
ioutil.WriteFile("stock_basic.json", resp.Body(), 0666)
|
||||||
//logger.SugaredLogger.Infof("GetStockBaseInfo %+v", res)
|
//logger.SugaredLogger.Infof("GetStockBaseInfo %+v", res)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.SugaredLogger.Error(err.Error())
|
logger.SugaredLogger.Error(err.Error())
|
||||||
|
18
main.go
18
main.go
@ -9,12 +9,10 @@ import (
|
|||||||
"github.com/wailsapp/wails/v2/pkg/options"
|
"github.com/wailsapp/wails/v2/pkg/options"
|
||||||
"github.com/wailsapp/wails/v2/pkg/options/mac"
|
"github.com/wailsapp/wails/v2/pkg/options/mac"
|
||||||
"github.com/wailsapp/wails/v2/pkg/options/windows"
|
"github.com/wailsapp/wails/v2/pkg/options/windows"
|
||||||
"github.com/wailsapp/wails/v2/pkg/runtime"
|
|
||||||
"go-stock/backend/data"
|
"go-stock/backend/data"
|
||||||
"go-stock/backend/db"
|
"go-stock/backend/db"
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
"time"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
//go:embed frontend/dist
|
//go:embed frontend/dist
|
||||||
@ -42,14 +40,14 @@ func main() {
|
|||||||
// Create an instance of the app structure
|
// Create an instance of the app structure
|
||||||
app := NewApp()
|
app := NewApp()
|
||||||
|
|
||||||
ticker := time.NewTicker(time.Second)
|
//ticker := time.NewTicker(time.Second)
|
||||||
defer ticker.Stop()
|
//defer ticker.Stop()
|
||||||
//定时更新数据
|
////定时更新数据
|
||||||
go func() {
|
//go func() {
|
||||||
for range ticker.C {
|
// for range ticker.C {
|
||||||
runtime.WindowSetTitle(app.ctx, "go-stock "+time.Now().Format("2006-01-02 15:04:05"))
|
// runtime.WindowSetTitle(app.ctx, "go-stock "+time.Now().Format("2006-01-02 15:04:05"))
|
||||||
}
|
// }
|
||||||
}()
|
//}()
|
||||||
// Create application with options
|
// Create application with options
|
||||||
err := wails.Run(&options.App{
|
err := wails.Run(&options.App{
|
||||||
Title: "go-stock",
|
Title: "go-stock",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user