This commit is contained in:
2026-02-11 17:46:22 +03:00
commit eacfacb13b
266 changed files with 51337 additions and 0 deletions

8
svc/utils/error.go Normal file
View File

@@ -0,0 +1,8 @@
// utils/logger.go
package utils
import "log"
func LogError(scope string, err error) {
log.Printf("[%s] %v", scope, err)
}

6
svc/utils/mail.env Normal file
View File

@@ -0,0 +1,6 @@
SMTP_HOST=smtp.office365.com
SMTP_PORT=587
SMTP_USERNAME=admin@baggi.com.tr
SMTP_PASSWORD=Tav34909
SMTP_FROM=admin@baggi.com.tr
SMTP_STARTTLS=true

17
svc/utils/utils.go Normal file
View File

@@ -0,0 +1,17 @@
package utils
import (
"bssapp-backend/auth"
"bssapp-backend/models"
)
func UserFromClaims(c *auth.Claims) *models.User {
if c == nil {
return nil
}
return &models.User{
ID: int(c.ID),
Username: c.Username,
}
}

11
svc/utils/uuid.go Normal file
View File

@@ -0,0 +1,11 @@
// utils/uuid.go
package utils
import (
"github.com/google/uuid"
)
// NewUUID returns a new random UUID (v4)
func NewUUID() string {
return uuid.New().String()
}