| @@ -46,3 +46,9 @@ type User struct { | |||||
| UserName string `gorm:"column:username" json:"userName"` | UserName string `gorm:"column:username" json:"userName"` | ||||
| Created time.Time `gorm:"column:created_at" json:"created"` | Created time.Time `gorm:"column:created_at" json:"created"` | ||||
| } | } | ||||
| type Bucket struct { | |||||
| ID cdssdk.BucketID `gorm:"column:id" json:"id"` | |||||
| UserID cdssdk.UserID `gorm:"column:user_id" json:"userID"` | |||||
| DataType string `gorm:"column:data_type" json:"dataType"` | |||||
| } | |||||
| @@ -58,8 +58,8 @@ func (c *Client) GetClusterInfo(req GetClusterInfoReq) ([]ClusterDetail, error) | |||||
| } | } | ||||
| type CreateJobReq struct { | type CreateJobReq struct { | ||||
| //Name string `json:"name"` | |||||
| //Description string `json:"description"` | |||||
| Name string `json:"name"` | |||||
| Description string `json:"description"` | |||||
| JobResources schsdk.JobResources `json:"jobResources"` | JobResources schsdk.JobResources `json:"jobResources"` | ||||
| DataDistribute DataDistribute `json:"dataDistributes"` | DataDistribute DataDistribute `json:"dataDistributes"` | ||||
| } | } | ||||
| @@ -120,11 +120,11 @@ func (c *Client) CreateJob(req CreateJobReq) (*CreateJobResp, error) { | |||||
| } | } | ||||
| // 将req转换成json,并打印 | // 将req转换成json,并打印 | ||||
| req2, err := serder.ObjectToJSONEx(req) | |||||
| if err != nil { | |||||
| return nil, fmt.Errorf("request to json: %w", err) | |||||
| } | |||||
| fmt.Println(string(req2)) | |||||
| //req2, err := serder.ObjectToJSONEx(req) | |||||
| //if err != nil { | |||||
| // return nil, fmt.Errorf("request to json: %w", err) | |||||
| //} | |||||
| //fmt.Println(string(req2)) | |||||
| resp, err := http2.PostJSON(targetUrl, http2.RequestParam{ | resp, err := http2.PostJSON(targetUrl, http2.RequestParam{ | ||||
| Body: req, | Body: req, | ||||
| @@ -17,6 +17,8 @@ const ( | |||||
| ResourceTypeStorage ResourceType = "STORAGE" | ResourceTypeStorage ResourceType = "STORAGE" | ||||
| ResourceTypeMemory ResourceType = "MEMORY" | ResourceTypeMemory ResourceType = "MEMORY" | ||||
| Split = "/" | |||||
| CODE = "code" | CODE = "code" | ||||
| DATASET = "dataset" | DATASET = "dataset" | ||||
| IMAGE = "image" | IMAGE = "image" | ||||
| @@ -379,6 +381,7 @@ type CodeBinding struct { | |||||
| Description string `json:"description"` | Description string `json:"description"` | ||||
| ImageID string `json:"imageID"` | ImageID string `json:"imageID"` | ||||
| ObjectID cdssdk.ObjectID `json:"objectID"` | ObjectID cdssdk.ObjectID `json:"objectID"` | ||||
| FilePath string `json:"filePath"` | |||||
| PackageID cdssdk.PackageID `json:"packageID"` | PackageID cdssdk.PackageID `json:"packageID"` | ||||
| } | } | ||||
| @@ -29,6 +29,7 @@ type Binding struct { | |||||
| UserID cdssdk.UserID `gorm:"column:user_id" json:"userID"` | UserID cdssdk.UserID `gorm:"column:user_id" json:"userID"` | ||||
| Name string `gorm:"column:name" json:"Name"` | Name string `gorm:"column:name" json:"Name"` | ||||
| DataType string `gorm:"column:data_type" json:"dataType"` | DataType string `gorm:"column:data_type" json:"dataType"` | ||||
| JsonData string `gorm:"column:json_data" json:"jsonData"` | |||||
| Content string `gorm:"column:content" json:"Content"` | Content string `gorm:"column:content" json:"Content"` | ||||
| AccessLevel string `gorm:"column:access_level" json:"accessLevel"` | AccessLevel string `gorm:"column:access_level" json:"accessLevel"` | ||||
| CreateTime time.Time `gorm:"column:created_at" json:"createTime"` | CreateTime time.Time `gorm:"column:created_at" json:"createTime"` | ||||
| @@ -33,6 +33,8 @@ func DefaultLoad(modeulName string, defCfg interface{}) error { | |||||
| // filepath.Join用于将多个路径组合成一个路径 | // filepath.Join用于将多个路径组合成一个路径 | ||||
| configFilePath := filepath.Join(filepath.Dir(execPath), "..", "confs", fmt.Sprintf("%s.config.json", modeulName)) | configFilePath := filepath.Join(filepath.Dir(execPath), "..", "confs", fmt.Sprintf("%s.config.json", modeulName)) | ||||
| configFilePath = "D:\\Work\\Codes\\workspace\\workspace\\scheduler\\common\\assets\\confs\\middleware.json" | |||||
| return Load(configFilePath, defCfg) | return Load(configFilePath, defCfg) | ||||
| } | } | ||||