@@ -15,20 +15,20 @@ import (
15
15
logutil "kusionstack.io/kusion/pkg/server/util/logging"
16
16
)
17
17
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]
32
32
func (h * Handler ) CreateModule () http.HandlerFunc {
33
33
return func (w http.ResponseWriter , r * http.Request ) {
34
34
// Getting stuff from context.
@@ -55,19 +55,19 @@ func (h *Handler) CreateModule() http.HandlerFunc {
55
55
}
56
56
}
57
57
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]
71
71
func (h * Handler ) DeleteModule () http.HandlerFunc {
72
72
return func (w http.ResponseWriter , r * http.Request ) {
73
73
// Getting stuff from context.
@@ -83,21 +83,21 @@ func (h *Handler) DeleteModule() http.HandlerFunc {
83
83
}
84
84
}
85
85
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]
101
101
func (h * Handler ) UpdateModule () http.HandlerFunc {
102
102
return func (w http.ResponseWriter , r * http.Request ) {
103
103
// Getting stuff from context.
@@ -127,19 +127,19 @@ func (h *Handler) UpdateModule() http.HandlerFunc {
127
127
}
128
128
}
129
129
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]
143
143
func (h * Handler ) GetModule () http.HandlerFunc {
144
144
return func (w http.ResponseWriter , r * http.Request ) {
145
145
// Getting stuff from context.
@@ -155,22 +155,22 @@ func (h *Handler) GetModule() http.HandlerFunc {
155
155
}
156
156
}
157
157
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]
174
174
func (h * Handler ) ListModules () http.HandlerFunc {
175
175
return func (w http.ResponseWriter , r * http.Request ) {
176
176
// Getting stuff from context.
0 commit comments