package types import "gitea.local/admin/hspguard/internal/repository" type ServiceSessionDTO struct { User UserDTO `json:"user"` ApiService ApiServiceDTO `json:"api_service"` repository.ServiceSession } func NewServiceSessionDTO(row *repository.GetServiceSessionsRow) *ServiceSessionDTO { return &ServiceSessionDTO{ User: NewUserDTO(&row.User), ApiService: NewApiServiceDTO(row.ApiService), ServiceSession: row.ServiceSession, } } type UserSessionDTO struct { User UserDTO `json:"user"` repository.UserSession } func NewUserSessionDTO(row *repository.GetUserSessionsRow) *UserSessionDTO { return &UserSessionDTO{ User: NewUserDTO(&row.User), UserSession: row.UserSession, } }