feat: add AuthResponseDTO for login and refresh token responses

This commit is contained in:
2026-01-10 22:46:56 +01:00
parent f39dcff67d
commit e08e2b3189

View File

@@ -0,0 +1,23 @@
package dto
import (
"goyco/internal/services"
)
type AuthResponseDTO struct {
AccessToken string `json:"access_token"`
RefreshToken string `json:"refresh_token"`
User UserDTO `json:"user"`
}
func ToAuthResponseDTO(result *services.AuthResult) AuthResponseDTO {
if result == nil {
return AuthResponseDTO{}
}
return AuthResponseDTO{
AccessToken: result.AccessToken,
RefreshToken: result.RefreshToken,
User: ToUserDTO(result.User),
}
}