Skip to content

Commit

Permalink
feat: add DefaultFilteredQueryParams for job (#3608)
Browse files Browse the repository at this point in the history
Signed-off-by: Gaius <gaius.qi@gmail.com>
  • Loading branch information
gaius-qi authored Oct 28, 2024
1 parent 5a51a61 commit 90d2017
Show file tree
Hide file tree
Showing 14 changed files with 110 additions and 570 deletions.
4 changes: 0 additions & 4 deletions api/manager/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -4208,10 +4208,6 @@ const docTemplate = `{
"bio": {
"type": "string"
},
"result": {
"type": "object",
"additionalProperties": {}
},
"scheduler_cluster_ids": {
"type": "array",
"items": {
Expand Down
4 changes: 0 additions & 4 deletions api/manager/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -4202,10 +4202,6 @@
"bio": {
"type": "string"
},
"result": {
"type": "object",
"additionalProperties": {}
},
"scheduler_cluster_ids": {
"type": "array",
"items": {
Expand Down
3 changes: 0 additions & 3 deletions api/manager/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -464,9 +464,6 @@ definitions:
type: object
bio:
type: string
result:
additionalProperties: {}
type: object
scheduler_cluster_ids:
items:
type: integer
Expand Down
13 changes: 13 additions & 0 deletions manager/service/job.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import (
"d7y.io/dragonfly/v2/manager/metrics"
"d7y.io/dragonfly/v2/manager/models"
"d7y.io/dragonfly/v2/manager/types"
"d7y.io/dragonfly/v2/pkg/net/http"
"d7y.io/dragonfly/v2/pkg/retry"
"d7y.io/dragonfly/v2/pkg/slices"
"d7y.io/dragonfly/v2/pkg/structure"
Expand All @@ -46,6 +47,10 @@ func (s *service) CreatePreheatJob(ctx context.Context, json types.CreatePreheat
json.Args.Timeout = types.DefaultJobTimeout
}

if json.Args.FilteredQueryParams == "" {
json.Args.FilteredQueryParams = http.RawDefaultFilteredQueryParams
}

args, err := structure.StructToMap(json.Args)
if err != nil {
return nil, err
Expand Down Expand Up @@ -85,6 +90,10 @@ func (s *service) CreatePreheatJob(ctx context.Context, json types.CreatePreheat
}

func (s *service) CreateGetTaskJob(ctx context.Context, json types.CreateGetTaskJobRequest) (*models.Job, error) {
if json.Args.FilteredQueryParams == "" {
json.Args.FilteredQueryParams = http.RawDefaultFilteredQueryParams
}

args, err := structure.StructToMap(json.Args)
if err != nil {
return nil, err
Expand Down Expand Up @@ -128,6 +137,10 @@ func (s *service) CreateDeleteTaskJob(ctx context.Context, json types.CreateDele
json.Args.Timeout = types.DefaultJobTimeout
}

if json.Args.FilteredQueryParams == "" {
json.Args.FilteredQueryParams = http.RawDefaultFilteredQueryParams
}

args, err := structure.StructToMap(json.Args)
if err != nil {
return nil, err
Expand Down
74 changes: 0 additions & 74 deletions manager/types/model.go

This file was deleted.

87 changes: 0 additions & 87 deletions manager/types/model_test.go

This file was deleted.

39 changes: 0 additions & 39 deletions pkg/idgen/model_id.go

This file was deleted.

Loading

0 comments on commit 90d2017

Please sign in to comment.