Skip to content

Commit 2a88912

Browse files
committed
fix lint
1 parent e20e64a commit 2a88912

File tree

2 files changed

+128
-128
lines changed

2 files changed

+128
-128
lines changed

pkg/server/handler/module/handler.go

+71-71
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,20 @@ import (
1515
logutil "kusionstack.io/kusion/pkg/server/util/logging"
1616
)
1717

18-
// @Id createModule
19-
// @Summary Create module
20-
// @Description Create a new Kusion module
21-
// @Tags module
22-
// @Accept json
23-
// @Produce json
24-
// @Param module body request.CreateModuleRequest true "Created module"
25-
// @Success 200 {object} handler.Response{data=entity.Module} "Success"
26-
// @Failure 400 {object} error "Bad Request"
27-
// @Failure 401 {object} error "Unauthorized"
28-
// @Failure 429 {object} error "Too Many Requests"
29-
// @Failure 404 {object} error "Not Found"
30-
// @Failure 500 {object} error "Internal Server Error"
31-
// @Router /api/v1/modules [post]
18+
// @Id createModule
19+
// @Summary Create module
20+
// @Description Create a new Kusion module
21+
// @Tags module
22+
// @Accept json
23+
// @Produce json
24+
// @Param module body request.CreateModuleRequest true "Created module"
25+
// @Success 200 {object} handler.Response{data=entity.Module} "Success"
26+
// @Failure 400 {object} error "Bad Request"
27+
// @Failure 401 {object} error "Unauthorized"
28+
// @Failure 429 {object} error "Too Many Requests"
29+
// @Failure 404 {object} error "Not Found"
30+
// @Failure 500 {object} error "Internal Server Error"
31+
// @Router /api/v1/modules [post]
3232
func (h *Handler) CreateModule() http.HandlerFunc {
3333
return func(w http.ResponseWriter, r *http.Request) {
3434
// Getting stuff from context.
@@ -55,19 +55,19 @@ func (h *Handler) CreateModule() http.HandlerFunc {
5555
}
5656
}
5757

58-
// @Id deleteModule
59-
// @Summary Delete module
60-
// @Description Delete the specified module by name
61-
// @Tags module
62-
// @Produce json
63-
// @Param moduleName path string true "Module Name"
64-
// @Success 200 {object} handler.Response{data=string} "Success"
65-
// @Failure 400 {object} error "Bad Request"
66-
// @Failure 401 {object} error "Unauthorized"
67-
// @Failure 429 {object} error "Too Many Requests"
68-
// @Failure 404 {object} error "Not Found"
69-
// @Failure 500 {object} error "Internal Server Error"
70-
// @Router /api/v1/modules/{moduleName} [delete]
58+
// @Id deleteModule
59+
// @Summary Delete module
60+
// @Description Delete the specified module by name
61+
// @Tags module
62+
// @Produce json
63+
// @Param moduleName path string true "Module Name"
64+
// @Success 200 {object} handler.Response{data=string} "Success"
65+
// @Failure 400 {object} error "Bad Request"
66+
// @Failure 401 {object} error "Unauthorized"
67+
// @Failure 429 {object} error "Too Many Requests"
68+
// @Failure 404 {object} error "Not Found"
69+
// @Failure 500 {object} error "Internal Server Error"
70+
// @Router /api/v1/modules/{moduleName} [delete]
7171
func (h *Handler) DeleteModule() http.HandlerFunc {
7272
return func(w http.ResponseWriter, r *http.Request) {
7373
// Getting stuff from context.
@@ -83,21 +83,21 @@ func (h *Handler) DeleteModule() http.HandlerFunc {
8383
}
8484
}
8585

86-
// @Id updateModule
87-
// @Summary Update module
88-
// @Description Update the specified module
89-
// @Tags module
90-
// @Accept json
91-
// @Produce json
92-
// @Param moduleName path string true "Module Name"
93-
// @Param module body request.UpdateModuleRequest true "Updated module"
94-
// @Success 200 {object} handler.Response{data=entity.Module} "Success"
95-
// @Failure 400 {object} error "Bad Request"
96-
// @Failure 401 {object} error "Unauthorized"
97-
// @Failure 429 {object} error "Too Many Requests"
98-
// @Failure 404 {object} error "Not Found"
99-
// @Failure 500 {object} error "Internal Server Error"
100-
// @Router /api/v1/modules/{moduleName} [put]
86+
// @Id updateModule
87+
// @Summary Update module
88+
// @Description Update the specified module
89+
// @Tags module
90+
// @Accept json
91+
// @Produce json
92+
// @Param moduleName path string true "Module Name"
93+
// @Param module body request.UpdateModuleRequest true "Updated module"
94+
// @Success 200 {object} handler.Response{data=entity.Module} "Success"
95+
// @Failure 400 {object} error "Bad Request"
96+
// @Failure 401 {object} error "Unauthorized"
97+
// @Failure 429 {object} error "Too Many Requests"
98+
// @Failure 404 {object} error "Not Found"
99+
// @Failure 500 {object} error "Internal Server Error"
100+
// @Router /api/v1/modules/{moduleName} [put]
101101
func (h *Handler) UpdateModule() http.HandlerFunc {
102102
return func(w http.ResponseWriter, r *http.Request) {
103103
// Getting stuff from context.
@@ -127,19 +127,19 @@ func (h *Handler) UpdateModule() http.HandlerFunc {
127127
}
128128
}
129129

130-
// @Id getModule
131-
// @Summary Get module
132-
// @Description Get module information by module name
133-
// @Tags module
134-
// @Produce json
135-
// @Param moduleName path string true "Module Name"
136-
// @Success 200 {object} handler.Response{data=entity.Module} "Success"
137-
// @Failure 400 {object} error "Bad Request"
138-
// @Failure 401 {object} error "Unauthorized"
139-
// @Failure 429 {object} error "Too Many Requests"
140-
// @Failure 404 {object} error "Not Found"
141-
// @Failure 500 {object} error "Internal Server Error"
142-
// @Router /api/v1/modules/{moduleName} [get]
130+
// @Id getModule
131+
// @Summary Get module
132+
// @Description Get module information by module name
133+
// @Tags module
134+
// @Produce json
135+
// @Param moduleName path string true "Module Name"
136+
// @Success 200 {object} handler.Response{data=entity.Module} "Success"
137+
// @Failure 400 {object} error "Bad Request"
138+
// @Failure 401 {object} error "Unauthorized"
139+
// @Failure 429 {object} error "Too Many Requests"
140+
// @Failure 404 {object} error "Not Found"
141+
// @Failure 500 {object} error "Internal Server Error"
142+
// @Router /api/v1/modules/{moduleName} [get]
143143
func (h *Handler) GetModule() http.HandlerFunc {
144144
return func(w http.ResponseWriter, r *http.Request) {
145145
// Getting stuff from context.
@@ -155,22 +155,22 @@ func (h *Handler) GetModule() http.HandlerFunc {
155155
}
156156
}
157157

158-
// @Id listModule
159-
// @Summary List module
160-
// @Description List module information
161-
// @Tags module
162-
// @Produce json
163-
// @Param workspaceID query uint false "Workspace ID to filter module list by. Default to all workspaces."
164-
// @Param moduleName query string false "Module name to filter module list by. Default to all modules."
165-
// @Param page query uint false "The current page to fetch. Default to 1"
166-
// @Param pageSize query uint false "The size of the page. Default to 10"
167-
// @Success 200 {object} handler.Response{data=response.PaginatedModuleResponse} "Success"
168-
// @Failure 400 {object} error "Bad Request"
169-
// @Failure 401 {object} error "Unauthorized"
170-
// @Failure 429 {object} error "Too Many Requests"
171-
// @Failure 404 {object} error "Not Found"
172-
// @Failure 500 {object} error "Internal Server Error"
173-
// @Router /api/v1/modules [get]
158+
// @Id listModule
159+
// @Summary List module
160+
// @Description List module information
161+
// @Tags module
162+
// @Produce json
163+
// @Param workspaceID query uint false "Workspace ID to filter module list by. Default to all workspaces."
164+
// @Param moduleName query string false "Module name to filter module list by. Default to all modules."
165+
// @Param page query uint false "The current page to fetch. Default to 1"
166+
// @Param pageSize query uint false "The size of the page. Default to 10"
167+
// @Success 200 {object} handler.Response{data=response.PaginatedModuleResponse} "Success"
168+
// @Failure 400 {object} error "Bad Request"
169+
// @Failure 401 {object} error "Unauthorized"
170+
// @Failure 429 {object} error "Too Many Requests"
171+
// @Failure 404 {object} error "Not Found"
172+
// @Failure 500 {object} error "Internal Server Error"
173+
// @Router /api/v1/modules [get]
174174
func (h *Handler) ListModules() http.HandlerFunc {
175175
return func(w http.ResponseWriter, r *http.Request) {
176176
// Getting stuff from context.

pkg/server/handler/workspace/configs.go

+57-57
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,20 @@ import (
99
"kusionstack.io/kusion/pkg/server/handler"
1010
)
1111

12-
// @Id getWorkspaceConfigs
13-
// @Summary get workspace configurations
14-
// @Description Get configurations in the specified workspace
15-
// @Tags workspace
16-
// @Accept json
17-
// @Produce json
18-
// @Param workspaceID path int true "Workspace ID"
19-
// @Success 200 {object} request.WorkspaceConfigs "Success"
20-
// @Failure 400 {object} error "Bad Request"
21-
// @Failure 401 {object} error "Unauthorized"
22-
// @Failure 429 {object} error "Too Many Requests"
23-
// @Failure 404 {object} error "Not Found"
24-
// @Failure 500 {object} error "Internal Server Error"
25-
// @Router /api/v1/workspaces/{workspaceID}/configs [get]
12+
// @Id getWorkspaceConfigs
13+
// @Summary get workspace configurations
14+
// @Description Get configurations in the specified workspace
15+
// @Tags workspace
16+
// @Accept json
17+
// @Produce json
18+
// @Param workspaceID path int true "Workspace ID"
19+
// @Success 200 {object} request.WorkspaceConfigs "Success"
20+
// @Failure 400 {object} error "Bad Request"
21+
// @Failure 401 {object} error "Unauthorized"
22+
// @Failure 429 {object} error "Too Many Requests"
23+
// @Failure 404 {object} error "Not Found"
24+
// @Failure 500 {object} error "Internal Server Error"
25+
// @Router /api/v1/workspaces/{workspaceID}/configs [get]
2626
func (h *Handler) GetWorkspaceConfigs() http.HandlerFunc {
2727
return func(w http.ResponseWriter, r *http.Request) {
2828
// Getting stuff from the context.
@@ -38,20 +38,20 @@ func (h *Handler) GetWorkspaceConfigs() http.HandlerFunc {
3838
}
3939
}
4040

41-
// @Id validateWorkspaceConfigs
42-
// @Summary Validate workspace configurations
43-
// @Description Validate the configurations in the specified workspace
44-
// @Tags workspace
45-
// @Accept json
46-
// @Produce json
47-
// @Param workspace body request.WorkspaceConfigs true "Workspace configurations to be validated"
48-
// @Success 200 {object} request.WorkspaceConfigs "Success"
49-
// @Failure 400 {object} error "Bad Request"
50-
// @Failure 401 {object} error "Unauthorized"
51-
// @Failure 429 {object} error "Too Many Requests"
52-
// @Failure 404 {object} error "Not Found"
53-
// @Failure 500 {object} error "Internal Server Error"
54-
// @Router /api/v1/workspaces/configs/validate [post]
41+
// @Id validateWorkspaceConfigs
42+
// @Summary Validate workspace configurations
43+
// @Description Validate the configurations in the specified workspace
44+
// @Tags workspace
45+
// @Accept json
46+
// @Produce json
47+
// @Param workspace body request.WorkspaceConfigs true "Workspace configurations to be validated"
48+
// @Success 200 {object} request.WorkspaceConfigs "Success"
49+
// @Failure 400 {object} error "Bad Request"
50+
// @Failure 401 {object} error "Unauthorized"
51+
// @Failure 429 {object} error "Too Many Requests"
52+
// @Failure 404 {object} error "Not Found"
53+
// @Failure 500 {object} error "Internal Server Error"
54+
// @Router /api/v1/workspaces/configs/validate [post]
5555
func (h *Handler) ValidateWorkspaceConfigs() http.HandlerFunc {
5656
return func(w http.ResponseWriter, r *http.Request) {
5757
// Decode the request body into the payload.
@@ -66,21 +66,21 @@ func (h *Handler) ValidateWorkspaceConfigs() http.HandlerFunc {
6666
}
6767
}
6868

69-
// @Id updateWorkspaceConfigs
70-
// @Summary Update workspace configurations
71-
// @Description Update the configurations in the specified workspace
72-
// @Tags workspace
73-
// @Accept json
74-
// @Produce json
75-
// @Param workspaceID path int true "Workspace ID"
76-
// @Param workspace body request.WorkspaceConfigs true "Updated workspace configurations"
77-
// @Success 200 {object} request.WorkspaceConfigs "Success"
78-
// @Failure 400 {object} error "Bad Request"
79-
// @Failure 401 {object} error "Unauthorized"
80-
// @Failure 429 {object} error "Too Many Requests"
81-
// @Failure 404 {object} error "Not Found"
82-
// @Failure 500 {object} error "Internal Server Error"
83-
// @Router /api/v1/workspaces/{workspaceID}/configs [put]
69+
// @Id updateWorkspaceConfigs
70+
// @Summary Update workspace configurations
71+
// @Description Update the configurations in the specified workspace
72+
// @Tags workspace
73+
// @Accept json
74+
// @Produce json
75+
// @Param workspaceID path int true "Workspace ID"
76+
// @Param workspace body request.WorkspaceConfigs true "Updated workspace configurations"
77+
// @Success 200 {object} request.WorkspaceConfigs "Success"
78+
// @Failure 400 {object} error "Bad Request"
79+
// @Failure 401 {object} error "Unauthorized"
80+
// @Failure 429 {object} error "Too Many Requests"
81+
// @Failure 404 {object} error "Not Found"
82+
// @Failure 500 {object} error "Internal Server Error"
83+
// @Router /api/v1/workspaces/{workspaceID}/configs [put]
8484
func (h *Handler) UpdateWorkspaceConfigs() http.HandlerFunc {
8585
return func(w http.ResponseWriter, r *http.Request) {
8686
// Getting stuff from context.
@@ -103,20 +103,20 @@ func (h *Handler) UpdateWorkspaceConfigs() http.HandlerFunc {
103103
}
104104
}
105105

106-
// @Id createWorkspaceModDeps
107-
// @Summary Create the module dependencies of the workspace
108-
// @Description Create the module dependencies in kcl.mod of the specified workspace
109-
// @Tags workspace
110-
// @Accept json
111-
// @Produce plain
112-
// @Param workspaceID path int true "Workspace ID"
113-
// @Success 200 {object} string "Success"
114-
// @Failure 400 {object} error "Bad Request"
115-
// @Failure 401 {object} error "Unauthorized"
116-
// @Failure 429 {object} error "Too Many Requests"
117-
// @Failure 404 {object} error "Not Found"
118-
// @Failure 500 {object} error "Internal Server Error"
119-
// @Router /api/v1/workspaces/{workspaceID}/configs/mod-deps [post]
106+
// @Id createWorkspaceModDeps
107+
// @Summary Create the module dependencies of the workspace
108+
// @Description Create the module dependencies in kcl.mod of the specified workspace
109+
// @Tags workspace
110+
// @Accept json
111+
// @Produce plain
112+
// @Param workspaceID path int true "Workspace ID"
113+
// @Success 200 {object} string "Success"
114+
// @Failure 400 {object} error "Bad Request"
115+
// @Failure 401 {object} error "Unauthorized"
116+
// @Failure 429 {object} error "Too Many Requests"
117+
// @Failure 404 {object} error "Not Found"
118+
// @Failure 500 {object} error "Internal Server Error"
119+
// @Router /api/v1/workspaces/{workspaceID}/configs/mod-deps [post]
120120
func (h *Handler) CreateWorkspaceModDeps() http.HandlerFunc {
121121
return func(w http.ResponseWriter, r *http.Request) {
122122
// Getting stuff from context.

0 commit comments

Comments
 (0)