Compare commits

..

3 Commits

Author SHA1 Message Date
钱纯净
4d1487f0b6 Merge remote-tracking branch 'origin/master' 2025-11-02 21:59:20 +08:00
钱纯净
bd3863d3c5 优化etf的判断,sh51xxxx,sh56xxxx,sh68xxxx,sz15xxxx,sz16xxxx 2025-11-02 21:58:44 +08:00
injoyai
5fb1a212c6 增加tdx.DialWorkday 2025-10-31 10:45:22 +08:00
2 changed files with 11 additions and 2 deletions

View File

@@ -281,11 +281,11 @@ func IsETF(code string) bool {
code = strings.ToLower(code) code = strings.ToLower(code)
switch { switch {
case code[0:2] == ExchangeSH.String() && case code[0:2] == ExchangeSH.String() &&
(code[2:5] == "510" || code[2:5] == "511" || code[2:5] == "512" || code[2:5] == "513" || code[2:5] == "515"): (code[2:4] == "51" || code[2:4] == "56" || code[2:4] == "58"):
return true return true
case code[0:2] == ExchangeSZ.String() && case code[0:2] == ExchangeSZ.String() &&
(code[2:5] == "159"): (code[2:4] == "15" || code[2:4] == "16"):
return true return true
} }
return false return false

View File

@@ -6,6 +6,7 @@ import (
_ "github.com/go-sql-driver/mysql" _ "github.com/go-sql-driver/mysql"
"github.com/injoyai/base/maps" "github.com/injoyai/base/maps"
"github.com/injoyai/conv" "github.com/injoyai/conv"
"github.com/injoyai/ios/client"
"github.com/injoyai/logs" "github.com/injoyai/logs"
"github.com/injoyai/tdx/protocol" "github.com/injoyai/tdx/protocol"
"github.com/robfig/cron/v3" "github.com/robfig/cron/v3"
@@ -16,6 +17,14 @@ import (
"xorm.io/xorm" "xorm.io/xorm"
) )
func DialWorkday(op ...client.Option) (*Workday, error) {
c, err := DialDefault(op...)
if err != nil {
return nil, err
}
return NewWorkdaySqlite(c)
}
func NewWorkdayMysql(c *Client, dsn string) (*Workday, error) { func NewWorkdayMysql(c *Client, dsn string) (*Workday, error) {
//连接数据库 //连接数据库