Skip to content

Commit 572d87c

Browse files
committed
fix: update delete task job and list tasks job api args.
Signed-off-by: Asklv <boironic@gmail.com>
1 parent dcbb0f7 commit 572d87c

File tree

2 files changed

+9
-15
lines changed

2 files changed

+9
-15
lines changed

internal/job/types.go

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,33 +35,29 @@ type PreheatResponse struct {
3535

3636
// ListTasksRequest defines the request parameters for listing tasks.
3737
type ListTasksRequest struct {
38-
TaskID string `json:"task_id" validate:"required"`
39-
Page int `json:"page" validate:"required"`
40-
PerPage int `json:"per_page" validate:"required"`
38+
TaskID string `json:"task_id" validate:"required"`
4139
}
4240

4341
// ListTasksResponse defines the response parameters for listing tasks.
4442
type ListTasksResponse struct {
4543
Peers []*resource.Peer `json:"peers"`
46-
Page int `json:"page"`
47-
Total int `json:"total"`
4844
}
4945

5046
// DeleteTaskRequest defines the request parameters for deleting task.
5147
type DeleteTaskRequest struct {
5248
TaskID string `json:"task_id" validate:"required"`
5349
}
5450

55-
// TaskInfo includes information about a task along with peer details and a description.
56-
type TaskInfo struct {
57-
Task *resource.Task `json:"task"`
58-
Peer *resource.Peer `json:"peer"`
59-
Desc string `json:"desc"`
51+
// Task includes information about a task along with peer details and a description.
52+
type Task struct {
53+
Task *resource.Task `json:"task"`
54+
Peer *resource.Peer `json:"peer"`
55+
Description string `json:"description"`
6056
}
6157

6258
// DeleteTaskResponse represents the response after attempting to delete tasks,
6359
// categorizing them into successfully and unsuccessfully deleted.
6460
type DeleteTaskResponse struct {
65-
SuccessTasks []*TaskInfo `json:"success_tasks"`
66-
FailureTasks []*TaskInfo `json:"failure_tasks"`
61+
SuccessTasks []*Task `json:"success_tasks"`
62+
FailureTasks []*Task `json:"failure_tasks"`
6763
}

manager/types/job.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,7 @@ type CreateListTasksJobRequest struct {
8080
}
8181

8282
type ListTasksArgs struct {
83-
TaskID string `json:"task_id" binding:"required"`
84-
Page int `json:"page" binding:"omitempty,gte=1"`
85-
PerPage int `json:"per_page" binding:"omitempty,gte=1,lte=10000000"`
83+
TaskID string `json:"task_id" binding:"required"`
8684
}
8785

8886
type PreheatArgs struct {

0 commit comments

Comments
 (0)