package dto // CreateStorageRequest 创建存储后端请求 type CreateStorageRequest struct { Name string `json:"name" binding:"required"` Type string `json:"type" binding:"required"` // nfs, pv, hostPath Description string `json:"description"` IsDefault bool `json:"is_default"` IsShared bool `json:"is_shared"` ClusterID string `json:"cluster_id,omitempty"` // 用于 cluster-level storage // NFS 配置 NFS NFSConfigDTO `json:"nfs,omitempty"` // PV 配置 PV PVConfigDTO `json:"pv,omitempty"` // HostPath 配置 HostPath HostPathConfigDTO `json:"hostPath,omitempty"` } // UpdateStorageRequest 更新存储后端请求 type UpdateStorageRequest struct { Name string `json:"name"` Type string `json:"type"` Description string `json:"description"` IsDefault bool `json:"is_default"` IsShared bool `json:"is_shared"` ClusterID string `json:"cluster_id,omitempty"` // 用于 cluster-level storage // NFS 配置 NFS NFSConfigDTO `json:"nfs,omitempty"` // PV 配置 PV PVConfigDTO `json:"pv,omitempty"` // HostPath 配置 HostPath HostPathConfigDTO `json:"hostPath,omitempty"` } // NFSConfigDTO NFS 配置 type NFSConfigDTO struct { Server string `json:"server"` Path string `json:"path"` } // PVConfigDTO PV 配置 type PVConfigDTO struct { StorageClassName string `json:"storageClassName"` Capacity string `json:"capacity"` AccessModes []string `json:"accessModes"` } // HostPathConfigDTO HostPath 配置 type HostPathConfigDTO struct { Path string `json:"path"` } // StorageResponse 存储后端响应 type StorageResponse struct { ID string `json:"id"` WorkspaceID string `json:"workspace_id,omitempty"` ClusterID string `json:"cluster_id,omitempty"` OwnerID string `json:"owner_id,omitempty"` Name string `json:"name"` Type string `json:"type"` Config StorageConfigDTO `json:"config"` Description string `json:"description"` IsDefault bool `json:"is_default"` IsShared bool `json:"is_shared"` CreatedAt string `json:"createdAt"` UpdatedAt string `json:"updatedAt"` } // StorageConfigDTO 存储配置(脱敏后) type StorageConfigDTO struct { NFS *NFSConfigDTO `json:"nfs,omitempty"` PV *PVConfigDTO `json:"pv,omitempty"` HostPath *HostPathConfigDTO `json:"hostPath,omitempty"` }