39 lines
1.1 KiB
Go
39 lines
1.1 KiB
Go
package types
|
|
|
|
import (
|
|
"time"
|
|
|
|
"gitea.local/admin/hspguard/internal/repository"
|
|
"github.com/google/uuid"
|
|
)
|
|
|
|
type ApiServiceDTO struct {
|
|
ID uuid.UUID `json:"id"`
|
|
ClientID string `json:"client_id"`
|
|
Name string `json:"name"`
|
|
Description *string `json:"description"`
|
|
IconUrl *string `json:"icon_url"`
|
|
RedirectUris []string `json:"redirect_uris"`
|
|
Scopes []string `json:"scopes"`
|
|
GrantTypes []string `json:"grant_types"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
UpdatedAt time.Time `json:"updated_at"`
|
|
IsActive bool `json:"is_active"`
|
|
}
|
|
|
|
func NewApiServiceDTO(service repository.ApiService) ApiServiceDTO {
|
|
return ApiServiceDTO{
|
|
ID: service.ID,
|
|
ClientID: service.ClientID,
|
|
Name: service.Name,
|
|
Description: service.Description,
|
|
IconUrl: service.IconUrl,
|
|
RedirectUris: service.RedirectUris,
|
|
Scopes: service.Scopes,
|
|
GrantTypes: service.GrantTypes,
|
|
CreatedAt: service.CreatedAt,
|
|
UpdatedAt: service.UpdatedAt,
|
|
IsActive: service.IsActive,
|
|
}
|
|
}
|