247 lines
6.9 KiB
Go
247 lines
6.9 KiB
Go
package models
|
|
|
|
import (
|
|
"mime/multipart"
|
|
"time"
|
|
)
|
|
|
|
type ClusterResponse struct {
|
|
Code int `json:"code"`
|
|
Msg string `json:"msg"`
|
|
Data ClusterData `json:"data"`
|
|
TraceID string `json:"traceId"`
|
|
}
|
|
|
|
type ClusterData struct {
|
|
Clusters []ClusterItem `json:"list"`
|
|
Total int `json:"total"`
|
|
PageNum int `json:"pageNum"`
|
|
PageSize int `json:"pageSize"`
|
|
}
|
|
|
|
type ClusterItem struct {
|
|
ID string `json:"id"`
|
|
AdapterID string `json:"adapterId"`
|
|
Name string `json:"name"`
|
|
Nickname string `json:"nickname"`
|
|
Description string `json:"description"`
|
|
}
|
|
|
|
type PackageCreateLoad struct {
|
|
Info PackageCreateLoadInfo `form:"info" binding:"required"`
|
|
Files []*multipart.FileHeader `form:"files"`
|
|
}
|
|
|
|
type UserID int
|
|
type BucketID int
|
|
type StorageID int
|
|
|
|
type PackageCreateLoadInfo struct {
|
|
UserID int `json:"userID" binding:"required"`
|
|
BucketID int `json:"bucketID" binding:"required"`
|
|
Name string `json:"name" binding:"required"`
|
|
//LoadTo int `json:"loadTo"`
|
|
//LoadToPath []string `json:"loadToPath"`
|
|
}
|
|
|
|
type PresignedPackageCreateUpload struct {
|
|
UserID int `json:"userID"`
|
|
Info PresignedPackageCreateUploadInfo `json:"info"`
|
|
}
|
|
|
|
type PresignedPackageCreateUploadResp struct {
|
|
Code string `json:"code"`
|
|
Message string `json:"message"`
|
|
Data struct {
|
|
PresignUrl string `json:"presignUrl"`
|
|
} `json:"data"`
|
|
}
|
|
|
|
type PresignedPackageCreateUploadInfo struct {
|
|
Type string `json:"type"`
|
|
Param PresignedPackageCreateUploadParam `json:"params"`
|
|
}
|
|
|
|
type PresignedPackageCreateUploadParam struct {
|
|
BucketID int `json:"bucketID" binding:"required"`
|
|
Name string `json:"name" binding:"required"`
|
|
PackageID int `json:"packageID"`
|
|
Zip bool `json:"zip"`
|
|
CopyTo []int `json:"copyTo"`
|
|
CopyPath []string `json:"copyToPath"`
|
|
}
|
|
|
|
type PackageCreateResponse struct {
|
|
Code string `json:"code"`
|
|
Message string `json:"message"`
|
|
Data PackageData `json:"data"`
|
|
}
|
|
|
|
type PackageData struct {
|
|
Package Package `json:"package"`
|
|
Objects []FileObject `json:"objects"`
|
|
CopyToFullPaths []string `json:"copiedToFullPaths"`
|
|
}
|
|
|
|
type Package struct {
|
|
PackageID int `json:"packageID"`
|
|
Name string `json:"name"`
|
|
BucketID int `json:"bucketID"`
|
|
CreateTime time.Time `json:"createTime"`
|
|
State string `json:"state"`
|
|
}
|
|
|
|
type FileObject struct {
|
|
ObjectID int `json:"objectID"`
|
|
PackageID int `json:"packageID"`
|
|
Path string `json:"path"`
|
|
Size string `json:"size"`
|
|
FileHash string `json:"fileHash"`
|
|
Redundancy Redundancy `json:"redundancy"`
|
|
CreateTime time.Time `json:"createTime"`
|
|
UpdateTime time.Time `json:"updateTime"`
|
|
}
|
|
|
|
type Redundancy struct {
|
|
Type string `json:"type"`
|
|
}
|
|
|
|
type DatasetBindingInfo struct {
|
|
Type string `json:"type"`
|
|
Name string `json:"name"`
|
|
Description string `json:"description"`
|
|
Category string `json:"category"`
|
|
PackageID int `json:"packageID"`
|
|
ClusterIDs []string `json:"clusterIDs"`
|
|
}
|
|
|
|
// DatasetAppInfoDetail 应用信息中的Info结构
|
|
type DatasetAppInfoDetail struct {
|
|
Type string `json:"type"`
|
|
LocalPath string `json:"localPath"`
|
|
ObjectIDs []int `json:"objectIDs"`
|
|
BindingInfo DatasetBindingInfo `json:"bindingInfo"`
|
|
}
|
|
|
|
// DatasetAppInfo 应用信息
|
|
type DatasetAppInfo struct {
|
|
Type string `json:"type"`
|
|
Name string `json:"name"`
|
|
Description string `json:"description"`
|
|
Info DatasetAppInfoDetail `json:"info"`
|
|
}
|
|
|
|
// DatasetAppSetInfo 应用集信息
|
|
type DatasetAppSetInfo struct {
|
|
Apps []DatasetAppInfo `json:"apps"`
|
|
}
|
|
|
|
// DatasetBindRequest 数据集请求
|
|
type DatasetBindRequest struct {
|
|
UserID int `json:"userID"`
|
|
AppInstanceID int `json:"appInstanceID"`
|
|
AppSetInfo DatasetAppSetInfo `json:"appSetInfo"`
|
|
}
|
|
|
|
// ModelBindingInfo 模型绑定信息
|
|
type ModelBindingInfo struct {
|
|
Type string `json:"type"`
|
|
Name string `json:"name"`
|
|
Description string `json:"description"`
|
|
Category string `json:"category"`
|
|
ModelType string `json:"modelType"`
|
|
Env string `json:"env"`
|
|
PackageID int `json:"packageID"`
|
|
ClusterIDs []string `json:"clusterIDs"`
|
|
}
|
|
|
|
// ModelAppInfoDetail 应用信息中的Info结构
|
|
type ModelAppInfoDetail struct {
|
|
Type string `json:"type"`
|
|
LocalPath string `json:"localPath"`
|
|
ObjectIDs []int `json:"objectIDs"`
|
|
CopiedTo []int `json:"copiedTo"`
|
|
CopiedToFullRoots []string `json:"copiedToFullRoots"`
|
|
BindingInfo ModelBindingInfo `json:"bindingInfo"`
|
|
}
|
|
|
|
// ModelAppInfo 应用信息
|
|
type ModelAppInfo struct {
|
|
Type string `json:"type"`
|
|
Name string `json:"name"`
|
|
Description string `json:"description"`
|
|
Info ModelAppInfoDetail `json:"info"`
|
|
}
|
|
|
|
// ModelAppSetInfo 应用集信息
|
|
type ModelAppSetInfo struct {
|
|
Apps []ModelAppInfo `json:"apps"`
|
|
}
|
|
|
|
// ModelBindRequest 模型请求
|
|
type ModelBindRequest struct {
|
|
UserID int `json:"userID"`
|
|
AppInstanceID int `json:"appInstanceID"`
|
|
AppSetInfo ModelAppSetInfo `json:"appSetInfo"`
|
|
}
|
|
|
|
// CodeBindingInfo 算法绑定信息
|
|
type CodeBindingInfo struct {
|
|
Type string `json:"type"`
|
|
Name string `json:"name"`
|
|
Description string `json:"description"`
|
|
ImageID int `json:"imageID"`
|
|
BootstrapObjectID int `json:"bootstrapObjectID"`
|
|
PackageID int `json:"packageID"`
|
|
ClusterID string `json:"clusterID"`
|
|
}
|
|
|
|
// CodeAppInfoDetail 应用信息中的Info结构
|
|
type CodeAppInfoDetail struct {
|
|
Type string `json:"type"`
|
|
LocalPath string `json:"localPath"`
|
|
ObjectIDs []int `json:"objectIDs"`
|
|
BindingInfo CodeBindingInfo `json:"bindingInfo"`
|
|
}
|
|
|
|
// CodeAppInfo 应用信息
|
|
type CodeAppInfo struct {
|
|
Type string `json:"type"`
|
|
Name string `json:"name"`
|
|
Description string `json:"description"`
|
|
Info CodeAppInfoDetail `json:"info"`
|
|
}
|
|
|
|
// CodeAppSetInfo 应用集信息
|
|
type CodeAppSetInfo struct {
|
|
Apps []CodeAppInfo `json:"apps"`
|
|
}
|
|
|
|
// CodeBindRequest 算法请求
|
|
type CodeBindRequest struct {
|
|
UserID int `json:"userID"`
|
|
AppInstanceID int `json:"appInstanceID"`
|
|
AppSetInfo CodeAppSetInfo `json:"appSetInfo"`
|
|
}
|
|
|
|
type BindingResponse struct {
|
|
JobSetID string `json:"jobSetID"`
|
|
Message string `json:"message"`
|
|
}
|
|
|
|
type BindingResult struct {
|
|
BindingID int `json:"bindingID"`
|
|
}
|
|
|
|
type BindResultSet struct {
|
|
BindCodeID int `json:"bind_code_id"`
|
|
BindDatasetID int `json:"bind_dataset_id"`
|
|
BindModelID int `json:"bind_model_id"`
|
|
BindSubModelID int `json:"bind_sub_model_id"`
|
|
}
|
|
|
|
type UploadFileConfig struct {
|
|
FilePrefix string
|
|
Files []string
|
|
}
|