gitee.com/quant1x/engine@v1.8.4/datasource/dfcf/notices_test.go (about) 1 package dfcf 2 3 import ( 4 "encoding/json" 5 "fmt" 6 "gitee.com/quant1x/exchange" 7 "gitee.com/quant1x/gox/api" 8 "testing" 9 ) 10 11 func TestStockNoticeReport(t *testing.T) { 12 notices, _, err := StockNotices("603045", "20240101", "20240430", 1) 13 if err != nil { 14 return 15 } 16 data, err := json.Marshal(notices) 17 fmt.Println(api.Bytes2String(data)) 18 } 19 20 func TestNoticeDateForAnnualReport(t *testing.T) { 21 code := "sz301587" 22 date := "2024-04-09" 23 y, q := NoticeDateForReport(code, date) 24 fmt.Println(y, q) 25 ys := exchange.DateRange(date, y) 26 fmt.Println(len(ys)) 27 qs := exchange.DateRange(date, q) 28 fmt.Println(len(qs)) 29 }