Init: lab4 done

This commit is contained in:
2025-11-07 05:26:09 +08:00
commit b55f254d82
23 changed files with 1140 additions and 0 deletions

17
utils/initDB.go Normal file
View File

@@ -0,0 +1,17 @@
package utils
import (
"context"
"golang-lab4/models"
"github.com/uptrace/bun"
)
func InitDB(db *bun.DB) {
err := db.ResetModel(context.Background(),
(*models.UrlState)(nil),
)
if err != nil {
panic(err)
}
}