Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix swagger docs workflow #190

Merged
merged 2 commits into from
Jan 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 19 additions & 17 deletions controllers/project_reg.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,23 +33,25 @@ type RegisterProjectReqFields struct {

// RegisterProject godoc
//
// @Summary Register a Project
// @Description Register a new project with the provided details.
// @Accept json
// @Produce json
// @Param request body RegisterProjoectReqFields true "Fields required for project registeration"
// @Success 200 {object} utils.HTTPMessage "Success."
// @Failure 401 {object} utils.HTTPMessage "Login username and mentor username do not match."
// @Failure 400 {object} utils.HTTPMessage "Error: Project `project` already exists."
// @Failure 400 {object} utils.HTTPMessage "Error decoding request JSON body."
// @Failure 400 {object} utils.HTTPMessage "Error: Mentor `mentor` does not exist."
// @Failure 400 {object} utils.HTTPMessage "Error: Secondary mentor `secondary_mentor` cannot be same as primary mentor."
// @Failure 500 {object} utils.HTTPMessage "Error fetching mentor `mentor`."
// @Failure 500 {object} utils.HTTPMessage "Error fetching secondary mentor `secondary_mentor`."
// @Failure 500 {object} utils.HTTPMessage "Error adding the project in the database."
// @Failure 500 {object} utils.HTTPMessage "Database error."
// @Security JWT
// @Router /project/ [post]
// @Summary Register a Project
// @Description Register a new project with the provided details.
// @Accept json
// @Produce json
// @Param request body RegisterProjectReqFields true "Fields required for project registeration"
// @Success 200 {object} utils.HTTPMessage "Success."
// @Failure 401 {object} utils.HTTPMessage "Login username and mentor username do not match."
// @Failure 400 {object} utils.HTTPMessage "Error: Project `project` already exists."
// @Failure 400 {object} utils.HTTPMessage "Error decoding request JSON body."
// @Failure 400 {object} utils.HTTPMessage "Error: Mentor `mentor` does not exist."
// @Failure 400 {object} utils.HTTPMessage "Error: Secondary mentor `secondary_mentor` cannot be same as primary mentor."
// @Failure 500 {object} utils.HTTPMessage "Error fetching mentor `mentor`."
// @Failure 500 {object} utils.HTTPMessage "Error fetching secondary mentor `secondary_mentor`."
// @Failure 500 {object} utils.HTTPMessage "Error adding the project in the database."
// @Failure 500 {object} utils.HTTPMessage "Database error."
//
// @Security JWT
//
// @Router /project/ [post]
func RegisterProject(w http.ResponseWriter, r *http.Request) {
app := r.Context().Value(middleware.APP_CTX_KEY).(*middleware.App)
db := app.Db
Expand Down
Loading