Initial commit
This commit is contained in:
39
internal/logic/a/new.go
Normal file
39
internal/logic/a/new.go
Normal file
@@ -0,0 +1,39 @@
|
||||
package a
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"git.apinb.com/bsm-sdk/core/utils"
|
||||
tushare "github.com/ShawnRong/tushare-go"
|
||||
)
|
||||
|
||||
var (
|
||||
TushareToken = "432de9ba12b6711948450273ed6e478dbac9e3e712323bbf823ada11"
|
||||
TushareClient *tushare.TuShare
|
||||
)
|
||||
|
||||
func NewApiClient() {
|
||||
TushareClient = tushare.New(TushareToken)
|
||||
}
|
||||
|
||||
func ReturnLastDay() (string, string) {
|
||||
now := time.Now()
|
||||
end := now.Format("20060102")
|
||||
start := now.AddDate(0, 0, -1).Format("20060102")
|
||||
return start, end
|
||||
}
|
||||
|
||||
func Anys2Strings(any []any) []string {
|
||||
var ret []string
|
||||
for _, item := range any {
|
||||
ret = append(ret, utils.AnyToString(item))
|
||||
}
|
||||
return ret
|
||||
}
|
||||
|
||||
func Any2Float(in any) float64 {
|
||||
if in == nil {
|
||||
return -1
|
||||
}
|
||||
return in.(float64)
|
||||
}
|
||||
Reference in New Issue
Block a user