ilk
This commit is contained in:
8
svc/utils/error.go
Normal file
8
svc/utils/error.go
Normal 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
6
svc/utils/mail.env
Normal 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
17
svc/utils/utils.go
Normal 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
11
svc/utils/uuid.go
Normal 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()
|
||||
}
|
||||
Reference in New Issue
Block a user