First swagger version, added auto-migrate on startup

This commit is contained in:
2026-03-15 20:40:41 +05:00
parent fb0269f804
commit b38f9cf8fd
18 changed files with 984 additions and 30 deletions

19
internal/models/user.go Normal file
View File

@@ -0,0 +1,19 @@
package models
import (
"time"
"github.com/google/uuid"
)
type User struct {
ID uuid.UUID `db:"id" json:"id"`
Email string `db:"email" json:"email"`
Slug string `db:"slug" json:"slug"`
PasswordHash string `db:"password_hash" json:"-"`
FullName *string `db:"full_name" json:"full_name,omitempty"`
AvatarURL *string `db:"avatar_url" json:"avatar_url,omitempty"`
CreatedAt time.Time `db:"created_at" json:"created_at"`
UpdatedAt *time.Time `db:"updated_at" json:"updated_at,omitempty"`
LastLoginAt *time.Time `db:"last_login_at" json:"last_login_at,omitempty"`
}