修改二板涨停情况查询,新增按条件筛选

This commit is contained in:
2026-05-06 18:11:30 +08:00
parent f1734a68ae
commit cf71dd2207
9 changed files with 560 additions and 121 deletions
+13 -8
View File
@@ -7,12 +7,13 @@ import (
type Config struct {
Database struct {
User string
Password string
Host string
Port int
Dbname string
Charset string
User string
Password string
Host string
Port int
Dbname string
Charset string
Collation string
}
Server struct {
Port int
@@ -39,8 +40,12 @@ func InitConfig() {
// GetDSN 生成 MySQL 连接字符串
func GetDSN() string {
db := AppConfig.Database
return fmt.Sprintf("%s:%s@tcp(%s:%d)/%s?charset=%s&parseTime=True&loc=Local",
db.User, db.Password, db.Host, db.Port, db.Dbname, db.Charset)
collation := db.Collation
if collation == "" {
collation = "utf8mb4_unicode_ci"
}
return fmt.Sprintf("%s:%s@tcp(%s:%d)/%s?charset=%s&collation=%s&parseTime=True&loc=Local",
db.User, db.Password, db.Host, db.Port, db.Dbname, db.Charset, collation)
}
// GetServerPort 获取服务器端口字符串