Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit482f337

Browse files
committed
Migrate task list
1 parent1e0548c commit482f337

File tree

13 files changed

+260
-176
lines changed

13 files changed

+260
-176
lines changed

‎coderd/aitasks.go‎

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,7 @@ func taskFromDBTaskAndWorkspace(dbTask database.Task, ws codersdk.Workspace) cod
339339
OrganizationID:dbTask.OrganizationID,
340340
OwnerID:dbTask.OwnerID,
341341
OwnerName:ws.OwnerName,
342+
OwnerAvatarURL:ws.OwnerAvatarURL,
342343
Name:dbTask.Name,
343344
TemplateID:ws.TemplateID,
344345
TemplateVersionID:dbTask.TemplateVersionID,
@@ -360,21 +361,13 @@ func taskFromDBTaskAndWorkspace(dbTask database.Task, ws codersdk.Workspace) cod
360361
}
361362
}
362363

363-
// tasksListResponse wraps a list of experimental tasks.
364-
//
365-
// Experimental: Response shape is experimental and may change.
366-
typetasksListResponsestruct {
367-
Tasks []codersdk.Task`json:"tasks"`
368-
Countint`json:"count"`
369-
}
370-
371364
// @Summary List AI tasks
372365
// @Description: EXPERIMENTAL: this endpoint is experimental and not guaranteed to be stable.
373366
// @ID list-tasks
374367
// @Security CoderSessionToken
375368
// @Tags Experimental
376369
// @Param q query string false "Search query for filtering tasks. Supports: owner:<username/uuid/me>, organization:<org-name/uuid>, status:<status>"
377-
// @Success 200 {object}coderd.tasksListResponse
370+
// @Success 200 {object}codersdk.TasksListResponse
378371
// @Router /api/experimental/tasks [get]
379372
//
380373
// EXPERIMENTAL: This endpoint is experimental and not guaranteed to be stable.
@@ -413,7 +406,7 @@ func (api *API) tasksList(rw http.ResponseWriter, r *http.Request) {
413406
return
414407
}
415408

416-
httpapi.Write(ctx,rw,http.StatusOK,tasksListResponse{
409+
httpapi.Write(ctx,rw,http.StatusOK,codersdk.TasksListResponse{
417410
Tasks:tasks,
418411
Count:len(tasks),
419412
})

‎coderd/apidoc/docs.go‎

Lines changed: 18 additions & 15 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎coderd/apidoc/swagger.json‎

Lines changed: 18 additions & 15 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎codersdk/aitasks.go‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ type Task struct {
135135
OrganizationID uuid.UUID`json:"organization_id" format:"uuid" table:"organization id"`
136136
OwnerID uuid.UUID`json:"owner_id" format:"uuid" table:"owner id"`
137137
OwnerNamestring`json:"owner_name" table:"owner name"`
138+
OwnerAvatarURLstring`json:"owner_avatar_url" table:"owner avatar url"`
138139
Namestring`json:"name" table:"name,default_sort"`
139140
TemplateID uuid.UUID`json:"template_id" format:"uuid" table:"template id"`
140141
TemplateVersionID uuid.UUID`json:"template_version_id" format:"uuid" table:"template version id"`
@@ -179,6 +180,12 @@ type TasksFilter struct {
179180
FilterQuerystring`json:"filter_query,omitempty"`
180181
}
181182

183+
// Experimental response shape for tasks list (server returns []Task).
184+
typeTasksListResponsestruct {
185+
Tasks []Task`json:"tasks"`
186+
Countint`json:"count"`
187+
}
188+
182189
func (fTasksFilter)asRequestOption()RequestOption {
183190
returnfunc(r*http.Request) {
184191
varparams []string
@@ -221,12 +228,7 @@ func (c *ExperimentalClient) Tasks(ctx context.Context, filter *TasksFilter) ([]
221228
returnnil,ReadBodyAsError(res)
222229
}
223230

224-
// Experimental response shape for tasks list (server returns []Task).
225-
typetasksListResponsestruct {
226-
Tasks []Task`json:"tasks"`
227-
Countint`json:"count"`
228-
}
229-
vartrestasksListResponse
231+
vartresTasksListResponse
230232
iferr:=json.NewDecoder(res.Body).Decode(&tres);err!=nil {
231233
returnnil,err
232234
}

‎docs/reference/api/experimental.md‎

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎docs/reference/api/schemas.md‎

Lines changed: 61 additions & 58 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp