pusher/pushers/controller_test.go
timerzz c16e02a7ea
All checks were successful
Build image / build (push) Successful in 1m21s
feat push可以不传id
2024-11-29 21:53:59 +08:00

22 lines
554 B
Go

package pushers
import (
"fmt"
"testing"
"gitea.timerzz.com/kedaya_haitao/pusher/kitex_gen/config"
"gorm.io/driver/postgres"
"gorm.io/gorm"
)
func GetDevDB() (*gorm.DB, error) {
dsn := fmt.Sprintf("host=%s user=%s password=%s dbname=%s port=%s sslmode=disable TimeZone=Asia/Shanghai", "192.168.31.55", "timerzz", "zhhg1997", "kedaya_dev", "5432")
return gorm.Open(postgres.Open(dsn), &gorm.Config{})
}
func TestNewController(t *testing.T) {
db, _ := GetDevDB()
var pushers []config.PusherConfig
_ = db.Find(&pushers)
fmt.Println(pushers)
}