18 lines
315 B
Go
18 lines
315 B
Go
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)
|
|
} |