mirror of
https://github.com/pocket-id/pocket-id.git
synced 2025-12-07 13:42:59 +03:00
27 lines
870 B
Go
27 lines
870 B
Go
package dto
|
|
|
|
import (
|
|
datatype "github.com/pocket-id/pocket-id/backend/internal/model/types"
|
|
)
|
|
|
|
type ApiKeyCreateDto struct {
|
|
Name string `json:"name" binding:"required,min=3,max=50"`
|
|
Description string `json:"description"`
|
|
ExpiresAt datatype.DateTime `json:"expiresAt" binding:"required"`
|
|
}
|
|
|
|
type ApiKeyDto struct {
|
|
ID string `json:"id"`
|
|
Name string `json:"name"`
|
|
Description string `json:"description"`
|
|
ExpiresAt datatype.DateTime `json:"expiresAt"`
|
|
LastUsedAt *datatype.DateTime `json:"lastUsedAt"`
|
|
CreatedAt datatype.DateTime `json:"createdAt"`
|
|
ExpirationEmailSent bool `json:"expirationEmailSent"`
|
|
}
|
|
|
|
type ApiKeyResponseDto struct {
|
|
ApiKey ApiKeyDto `json:"apiKey"`
|
|
Token string `json:"token"`
|
|
}
|