Remove user authentication and switch to simple admin password check (It wont have more than one admin user so no need for registeration (I LOVE .Net/C# btw))

This commit is contained in:
2025-05-15 20:25:28 +03:30
parent d646515776
commit 49b38470cf
7 changed files with 14 additions and 79 deletions
-24
View File
@@ -1,24 +0,0 @@
package services
import (
"CatsOfMastodonBotGo/internal/models"
"gorm.io/gorm"
)
type UserService struct {
db *gorm.DB
}
func NewUserService(db *gorm.DB) *UserService {
return &UserService{db: db}
}
func (us *UserService) CreateUser(user models.ComUser) int {
return int(us.db.Create(&user).RowsAffected)
}
func (us *UserService) GetUserByUsername(username string) models.ComUser {
var user models.ComUser
us.db.Where("username = ?", username).First(&user)
return user
}