added account
This commit is contained in:
@@ -2,16 +2,34 @@ package models
|
||||
|
||||
import "time"
|
||||
|
||||
// User represents a user account
|
||||
type User struct {
|
||||
ID int `json:"id"`
|
||||
Email string `json:"email"`
|
||||
PasswordHash string `json:"-"` // never expose in JSON
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
}
|
||||
|
||||
// Session represents a user session
|
||||
type Session struct {
|
||||
Token string `json:"token"`
|
||||
UserID int `json:"user_id"`
|
||||
ExpiresAt time.Time `json:"expires_at"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
}
|
||||
|
||||
// Ingredient represents a food ingredient
|
||||
type Ingredient struct {
|
||||
ID int `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Unit string `json:"unit"` // e.g., "grams", "ml", "cups", "pieces", "tbsp"
|
||||
ID int `json:"id"`
|
||||
UserID int `json:"user_id"`
|
||||
Name string `json:"name"`
|
||||
Unit string `json:"unit"` // e.g., "grams", "ml", "cups", "pieces", "tbsp"
|
||||
}
|
||||
|
||||
// Meal represents a meal recipe
|
||||
type Meal struct {
|
||||
ID int `json:"id"`
|
||||
UserID int `json:"user_id"`
|
||||
Name string `json:"name"`
|
||||
Description string `json:"description"`
|
||||
MealType string `json:"meal_type"` // "breakfast", "lunch", "snack"
|
||||
|
||||
Reference in New Issue
Block a user