Merge branch 'main' of github.com:ardeman/project-legalgo-go

This commit is contained in:
ericprd
2025-03-06 11:07:04 +08:00
1783 changed files with 692916 additions and 21 deletions
+6 -6
View File
@@ -13,14 +13,14 @@ type DB struct {
*gorm.DB
}
func NewDB() (*DB, error) {
func NewDB(cfg *config.Config) (*DB, error) {
dsn := fmt.Sprintf(
"host=%s user=%s password=%s dbname=%s port=%v sslmode=disable",
config.DB_HOST,
config.DB_USER,
config.DB_PASSWORD,
config.DB_NAME,
config.DB_PORT,
cfg.Database.Host,
cfg.Database.Username,
cfg.Database.Password,
cfg.Database.DB,
cfg.Database.Port,
)
if dsn == "" {