32 lines
826 B
Go
32 lines
826 B
Go
package models
|
|
|
|
// LoginRequest represents the login request payload
|
|
type LoginRequest struct {
|
|
Username string `json:"username" binding:"required"`
|
|
Password string `json:"password" binding:"required"`
|
|
}
|
|
|
|
// TokenResponse represents the token response
|
|
type TokenResponse struct {
|
|
AccessToken string `json:"access_token"`
|
|
TokenType string `json:"token_type"`
|
|
ExpiresIn int64 `json:"expires_in"`
|
|
}
|
|
|
|
// JWTClaims represents the JWT claims
|
|
type JWTClaims struct {
|
|
UserID string `json:"user_id"`
|
|
Username string `json:"username"`
|
|
Email string `json:"email"`
|
|
Role string `json:"role"`
|
|
}
|
|
|
|
// User represents a user for authentication
|
|
type User struct {
|
|
ID string `json:"id"`
|
|
Username string `json:"username"`
|
|
Email string `json:"email"`
|
|
Password string `json:"-"`
|
|
Role string `json:"role"`
|
|
}
|