Skip to content

Commit 45f44cb

Browse files
committed
refactor(api): try to match with github api
1 parent 7103a2c commit 45f44cb

File tree

3 files changed

+420
-668
lines changed

3 files changed

+420
-668
lines changed

routers/api/v1/repo/board.go

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
// Copyright 2016 The Gogs Authors. All rights reserved.
2+
// Copyright 2018 The Gitea Authors. All rights reserved.
3+
// Use of this source code is governed by a MIT-style
4+
// license that can be found in the LICENSE file.
5+
6+
package repo
7+
8+
import (
9+
"code.gitea.io/gitea/modules/context"
10+
)
11+
12+
func GetProjectBoard(ctx *context.APIContext) {
13+
// swagger:operation GET /projects/boards/{id} board boardGetProjectBoard
14+
// ---
15+
// summary: Get project board
16+
// produces:
17+
// - application/json
18+
// parameters:
19+
// - name: id
20+
// in: path
21+
// description: id of the board
22+
// type: string
23+
// required: true
24+
// responses:
25+
// "200":
26+
// "$ref": "#/responses/ProjectBoard"
27+
// "403":
28+
// "$ref": "#/responses/forbidden"
29+
// "404":
30+
// "$ref": "#/responses/notFound"
31+
}
32+
33+
func UpdateProjectBoard(ctx *context.APIContext) {
34+
// swagger:operation PATCH /projects/boards/{id} board boardUpdateProjectBoard
35+
// ---
36+
// summary: Update project board
37+
// produces:
38+
// - application/json
39+
// consumes:
40+
// - application/json
41+
// parameters:
42+
// - name: id
43+
// in: path
44+
// description: id of the project board
45+
// type: string
46+
// required: true
47+
// responses:
48+
// "200":
49+
// "$ref": "#/responses/ProjectBoard"
50+
// "403":
51+
// "$ref": "#/responses/forbidden"
52+
// "404":
53+
// "$ref": "#/responses/notFound"
54+
}
55+
56+
func DeleteProjectBoard(ctx *context.APIContext) {
57+
// swagger:operation DELETE /projects/boards/{id} board boardDeleteProjectBoard
58+
// ---
59+
// summary: Delete project board
60+
// produces:
61+
// - application/json
62+
// parameters:
63+
// - name: id
64+
// in: path
65+
// description: id of the project board
66+
// type: string
67+
// required: true
68+
// responses:
69+
// "204":
70+
// "description": "Project board deleted"
71+
// "403":
72+
// "$ref": "#/responses/forbidden"
73+
// "404":
74+
// "$ref": "#/responses/notFound"
75+
}
76+
77+
func ListProjectBoards(ctx *context.APIContext) {
78+
// swagger:operation GET /projects/{projectId}/boards board boardGetProjectBoards
79+
// ---
80+
// summary: Get project boards
81+
// produces:
82+
// - application/json
83+
// parameters:
84+
// - name: projectId
85+
// in: path
86+
// description: projectId of the project
87+
// type: string
88+
// required: true
89+
// responses:
90+
// "200":
91+
// "$ref": "#/responses/ProjectBoardList"
92+
// "403":
93+
// "$ref": "#/responses/forbidden"
94+
// "404":
95+
// "$ref": "#/responses/notFound"
96+
}
97+
98+
func CreateProjectBoard(ctx *context.APIContext) {
99+
// swagger:operation POST /projects/{projectId}/boards board boardCreateProjectBoard
100+
// ---
101+
// summary: Create project board
102+
// produces:
103+
// - application/json
104+
// consumes:
105+
// - application/json
106+
// parameters:
107+
// - name: id
108+
// in: path
109+
// description: id of the project
110+
// type: string
111+
// required: true
112+
// responses:
113+
// "201":
114+
// "$ref": "#/responses/ProjectBoard"
115+
// "403":
116+
// "$ref": "#/responses/forbidden"
117+
// "404":
118+
// "$ref": "#/responses/notFound"
119+
}

0 commit comments

Comments
 (0)