Skip to content

Commit

Permalink
Merge pull request #190 from shikharish/docs
Browse files Browse the repository at this point in the history
Fix swagger docs workflow
  • Loading branch information
harshkhandeparkar authored Jan 5, 2024
2 parents b36418a + 2e26044 commit cb4ac13
Showing 1 changed file with 19 additions and 17 deletions.
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

0 comments on commit cb4ac13

Please sign in to comment.