fix bug
This commit is contained in:
@@ -42,8 +42,8 @@ func main() {
|
|||||||
// csv文件写入
|
// csv文件写入
|
||||||
func WriterCSV(fileName string, datas [][]string) {
|
func WriterCSV(fileName string, datas [][]string) {
|
||||||
|
|
||||||
//OpenFile读取文件,不存在时则创建,使用追加模式
|
//OpenFile读取文件,不存在时则创建
|
||||||
File, err := os.OpenFile(fileName, os.O_RDWR|os.O_APPEND|os.O_CREATE, 0666)
|
File, err := os.OpenFile(fileName, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0666)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println("文件打开失败!")
|
log.Println("文件打开失败!")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +1,16 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"time"
|
|
||||||
|
"git.apinb.com/dataset/stock/internal/logic/a"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
t, err := time.Parse("20060102", "20230101")
|
a.NewApiClient()
|
||||||
if err != nil {
|
reply, err := a.SetFinaIndicator("000012.SZ", "20230101", "20260124")
|
||||||
fmt.Println("error", err)
|
fmt.Println("Err", err)
|
||||||
}
|
jsonBytes, _ := json.Marshal(reply.Data.Items)
|
||||||
fmt.Println(t)
|
fmt.Println("Reply", string(jsonBytes))
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -9,7 +9,8 @@ import (
|
|||||||
type StockFinaIndicator struct {
|
type StockFinaIndicator struct {
|
||||||
gorm.Model
|
gorm.Model
|
||||||
TsCode string `gorm:"type:varchar(20);not null;index:fi_ts_code;uniqueIndex:un_fi_code_date;comment:TS代码"`
|
TsCode string `gorm:"type:varchar(20);not null;index:fi_ts_code;uniqueIndex:un_fi_code_date;comment:TS代码"`
|
||||||
AnnDate int `gorm:"index:idx_ann_date;uniqueIndex:un_fi_code_date;comment:公告日期"`
|
Period int `gorm:"index:idx_period;uniqueIndex:un_fi_code_date;comment:报告期数"`
|
||||||
|
AnnDate string `gorm:"index:idx_ann_date;comment:公告日期"`
|
||||||
EndDate string `gorm:"index:idx_end_date;comment:报告期"`
|
EndDate string `gorm:"index:idx_end_date;comment:报告期"`
|
||||||
|
|
||||||
// 每股指标
|
// 每股指标
|
||||||
|
|||||||
Reference in New Issue
Block a user