Chore: project init

This commit is contained in:
2026-02-24 13:18:43 +09:00
commit 3345549051
23 changed files with 788 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
package auth
import "gorm.io/gorm"
type Repository struct {
db *gorm.DB
}
func NewRepository(db *gorm.DB) *Repository {
return &Repository{db: db}
}
func (r *Repository) FindByUsername(username string) (*User, error) {
var user User
err := r.db.Where("username = ?", username).First(&user).Error
return &user, err
}
func (r *Repository) Create(user *User) error {
return r.db.Create(user).Error
}