Browse Source

调整任务列表、查询绑定接口

pull/62/head
JeshuaRen 10 months ago
parent
commit
f9db58b364
3 changed files with 21 additions and 4 deletions
  1. +5
    -3
      sdks/pcmscheduler/jobmgr.go
  2. +7
    -1
      sdks/pcmscheduler/jobset.go
  3. +9
    -0
      sdks/pcmscheduler/models.go

+ 5
- 3
sdks/pcmscheduler/jobmgr.go View File

@@ -10,9 +10,11 @@ import (
)

type QueryTasksReq struct {
PageNum int64 `form:"pageNum"`
PageSize int64 `form:"pageSize"`
Type int64 `form:"type"`
PageNum int64 `form:"pageNum"`
PageSize int64 `form:"pageSize"`
Type int64 `form:"type"`
Name string `form:"name"`
Status string `form:"status"`
}

type QueryTasksResp struct {


+ 7
- 1
sdks/pcmscheduler/jobset.go View File

@@ -226,6 +226,9 @@ func (c *Client) CreateJob(req CreateAIJobReq, token string) (*CreateJobResp, er
return nil, err
}

//all, err := io.ReadAll(resp.Body)
//println(string(all))

contType := resp.Header.Get("Content-Type")
if strings.Contains(contType, http2.ContentTypeJSON) {
var codeResp response2[CreateJobResp]
@@ -402,7 +405,7 @@ type JCS struct {
type BindParam struct {
BootFile string `json:"bootFile"`
DefaultBranch string `json:"defaultBranch"`
RepoName string `json:"repo"`
RepoName string `json:"repoName"`
}

type BindResp struct {
@@ -459,6 +462,9 @@ func (c *Client) BindModel(req BindReq, token string) (*BindResp, error) {
return nil, err
}

//all, err := io.ReadAll(resp.Body)
//println(string(all))

contType := resp.Header.Get("Content-Type")
if strings.Contains(contType, http2.ContentTypeJSON) {
var codeResp response2[BindResp]


+ 9
- 0
sdks/pcmscheduler/models.go View File

@@ -536,6 +536,7 @@ var QueryBindingDataParamTypeUnion = types.NewTypeUnion[QueryBindingDataParam](
(*PrivateLevel)(nil),
(*ApplyLevel)(nil),
(*PublicLevel)(nil),
(*CommonDataParam)(nil),
)

var _ = serder.UseTypeUnionInternallyTagged(&QueryBindingDataParamTypeUnion, "type")
@@ -568,3 +569,11 @@ type PublicLevel struct {
Type string `json:"type" binding:"required"`
Info schsdk.DataBinding `json:"info"` // 可选,用于精细筛选,功能暂未实现
}

type CommonDataParam struct {
serder.Metadata `union:"common"`
QueryBindingDataParamBase
Type string `json:"type" binding:"required"`
UserID cdssdk.UserID `json:"userID" binding:"required"`
BindingIDs []int64 `json:"bindingIDs" binding:"required"`
}

Loading…
Cancel
Save