controllers

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 19, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CodeToText = map[string]string{
	"JLP": "Jumlah lapangan pekerjaan lebih penting",
	"GAJ": "Gaji lebih penting",
	"PEW": "Peluang wirausaha lebih penting",
	"MIN": "Minat lebih penting",
	"FAS": "Fasilitas pendukung lebih penting",
}

Functions

func HandleDeleteAnswer

func HandleDeleteAnswer(w http.ResponseWriter, r *http.Request)

HandleDeleteAnswer godoc

@Summary		Delete student questionnare answer
@Description	Delete student questionnare answer
@Tags			Questionnare
@Tags			Student
@Accept			json
@Produce		json
@Param			Authorization	header		string				true	"Insert your access token"	default(Bearer <Add access token here>)
@Success		201				{object}	httpx.MessageJsonResponse
@Failure		400				{object}	httpx.ErrorJsonResponse
@Failure		500				{object}	httpx.ErrorJsonResponse
@Router			/questionnare/answers [delete]

func HandleDeleteRecommendations

func HandleDeleteRecommendations(w http.ResponseWriter, r *http.Request)

HandleDeleteRecommendations godoc

@Summary		Delete recommendation for a student
@Description	Delete recommendation for a student
@Tags			Recommendations
@Tags			Admin
@Accept			json
@Produce		json
@Param			Authorization	header		string								true	"Insert your access token"	default(Bearer <Add access token here>)
@Param			body			body		schemas.DeleteRecommendationRequest	true	"Delete student recommendation request body"
@Success		201				{object}	httpx.MessageJsonResponse
@Failure		400				{object}	httpx.ErrorJsonResponse
@Failure		500				{object}	httpx.ErrorJsonResponse
@Router			/recommendations [delete]

func HandleDeleteStudent

func HandleDeleteStudent(w http.ResponseWriter, r *http.Request)

HandleDeleteStudent godoc

@Summary		Delete a student
@Description	Delete a student from a school
@Tags			Students
@Tags			Admin
@Accept			json
@Produce		json
@Param			Authorization	header		string							true	"Insert your access token"	default(Bearer <Add access token here>)
@Param			body			body		schemas.DeleteStudentRequest	true	"Delete student request body"
@Success		201				{object}	httpx.MessageJsonResponse
@Failure		400				{object}	httpx.ErrorJsonResponse
@Failure		500				{object}	httpx.ErrorJsonResponse
@Router			/students [delete]

func HandleGetAlternatives

func HandleGetAlternatives(w http.ResponseWriter, r *http.Request)

HandleGetAlternatives godoc

@Summary		Get alternatives
@Description	Get all alternatives
@Tags			Common
@Accept			json
@Produce		json
@Success		200	{object}	httpx.DataJsonResponse{data=[]schemas.Alternative}
@Failure		500	{object}	httpx.ErrorJsonResponse
@Router			/alternatives [get]

func HandleGetIncompleteQuestionnareSettings

func HandleGetIncompleteQuestionnareSettings(w http.ResponseWriter, r *http.Request)

HandleGetIncompleteQuestionnareSettings godoc

@Summary		Get incomplete questionnare settings
@Description	Get incomplete questionnare settings
@Tags			Questionnare
@Tags			Admin
@Accept			json
@Produce		json
@Param			Authorization	header		string	true	"Insert your access token"	default(Bearer <Add access token here>)
@Success		200				{object}	httpx.DataJsonResponse{data=[]schemas.QuestionnareSettingAlternative}
@Failure		400				{object}	httpx.ErrorJsonResponse
@Failure		500				{object}	httpx.ErrorJsonResponse
@Router			/questionnare/settings/incomplete [get]

func HandleGetQuesionnareStatus

func HandleGetQuesionnareStatus(w http.ResponseWriter, r *http.Request)

HandleGetQuesionnareStatus godoc

@Summary		Get questionnare status
@Description	Get questionnare status
@Tags			Questionnare
@Tags			Student
@Accept			json
@Produce		json
@Param			Authorization	header		string	true	"Insert your access token"	default(Bearer <Add access token here>)
@Success		200				{object}	httpx.DataJsonResponse{data=schemas.QuestionnareStatusResponse}
@Failure		400				{object}	httpx.ErrorJsonResponse
@Failure		500				{object}	httpx.ErrorJsonResponse
@Router			/questionnare/status [get]

func HandleGetQuestionnareSettings

func HandleGetQuestionnareSettings(w http.ResponseWriter, r *http.Request)

HandleGetQuestionnareSettings godoc

@Summary		Get questionnare settings
@Description	Get questionnare settings
@Tags			Questionnare
@Tags			Admin
@Accept			json
@Produce		json
@Param			Authorization	header		string	true	"Insert your access token"	default(Bearer <Add access token here>)
@Success		200				{object}	httpx.DataJsonResponse{data=[]schemas.QuestionnareSettingAlternative}
@Failure		400				{object}	httpx.ErrorJsonResponse
@Failure		500				{object}	httpx.ErrorJsonResponse
@Router			/questionnare/settings [get]

func HandleGetQuestions

func HandleGetQuestions(w http.ResponseWriter, r *http.Request)

HandleGetQuestions godoc

@Summary		Get Questions
@Description	Get all available questions
@Tags			Questionnare
@Tags			Student
@Accept			json
@Produce		json
@Param			Authorization	header		string	true	"Insert your access token"	default(Bearer <Add access token here>)
@Success		200				{object}	httpx.DataJsonResponse{data=[]schemas.QuestionResponse}
@Failure		400				{object}	httpx.ErrorJsonResponse
@Failure		500				{object}	httpx.ErrorJsonResponse
@Router			/questionnare/questions [get]

func HandleGetRecommendationStudent

func HandleGetRecommendationStudent(w http.ResponseWriter, r *http.Request)

HandleGetRecommendationStudent godoc

@Summary		Get student recommendations details
@Description	Get student recommendations details
@Tags			Recommendations
@Tags			Admin
@Accept			json
@Produce		json
@Param			Authorization	header		string	true	"Insert your access token"	default(Bearer <Add access token here>)
@Param			studentId		path		string	true	"Id student"
@Success		200				{object}	httpx.DataJsonResponse{data=schemas.Recommendation}
@Failure		400				{object}	httpx.ErrorJsonResponse
@Failure		404				{object}	httpx.ErrorJsonResponse
@Failure		500				{object}	httpx.ErrorJsonResponse
@Router			/recommendations/student/{studentId} [get]

func HandleGetRecommendations

func HandleGetRecommendations(w http.ResponseWriter, r *http.Request)

HandleGetRecommendations godoc

@Summary		Get all students recommendations
@Description	Get all students recommendations
@Tags			Recommendations
@Tags			Admin
@Accept			json
@Produce		json
@Param			Authorization	header		string	true	"Insert your access token"	default(Bearer <Add access token here>)
@Success		200				{object}	httpx.DataJsonResponse{data=[]schemas.StudentRecommendation}
@Failure		400				{object}	httpx.ErrorJsonResponse
@Failure		500				{object}	httpx.ErrorJsonResponse
@Router			/recommendations [get]

func HandleGetRecommendationsStudent

func HandleGetRecommendationsStudent(w http.ResponseWriter, r *http.Request)

HandleGetRecommendationsStudent godoc

@Summary		Get recommendations for a student
@Description	Get recommendations for a student
@Tags			Recommendations
@Tags			Student
@Accept			json
@Produce		json
@Param			Authorization	header		string	true	"Insert your access token"	default(Bearer <Add access token here>)
@Success		200				{object}	httpx.DataJsonResponse{data=schemas.Recommendation}
@Failure		400				{object}	httpx.ErrorJsonResponse
@Failure		404				{object}	httpx.ErrorJsonResponse
@Failure		500				{object}	httpx.ErrorJsonResponse
@Router			/recommendations/student [get]

func HandleGetSchool

func HandleGetSchool(w http.ResponseWriter, r *http.Request)

HandleGetSchool godoc

@Summary		Get school
@Description	Get current authenticated user shcool
@Tags			Common
@Tags			Student
@Tags			Admin
@Accept			json
@Produce		json
@Param			Authorization	header		string	true	"Insert your access token"	default(Bearer <Add access token here>)
@Success		200				{object}	httpx.DataJsonResponse{data=schemas.School}
@Failure		404				{object}	httpx.ErrorJsonResponse
@Failure		500				{object}	httpx.ErrorJsonResponse
@Router			/school [get]

func HandleGetStatistics

func HandleGetStatistics(w http.ResponseWriter, r *http.Request)

HandleGetStatistics godoc

@Summary		Get statistic
@Description	Get statistics
@Tags			Common
@Tags			Admin
@Accept			json
@Produce		json
@Param			Authorization	header		string	true	"Insert your access token"	default(Bearer <Add access token here>)
@Success		200				{object}	httpx.DataJsonResponse{data=schemas.Statistic}
@Failure		500				{object}	httpx.ErrorJsonResponse
@Router			/statistics [get]

func HandleGetStudent

func HandleGetStudent(w http.ResponseWriter, r *http.Request)

HandleGetStudent godoc

@Summary		Get a student
@Description	Get a student from a school
@Tags			Students
@Tags			Admin
@Accept			json
@Produce		json
@Param			Authorization	header		string	true	"Insert your access token"	default(Bearer <Add access token here>)
@Param			studentId		path		string	true	"Id student"
@Success		200				{object}	httpx.DataJsonResponse{data=schemas.Student}
@Failure		400				{object}	httpx.ErrorJsonResponse
@Failure		404				{object}	httpx.ErrorJsonResponse
@Failure		500				{object}	httpx.ErrorJsonResponse
@Router			/students/{studentId} [get]

func HandleGetStudentProfile

func HandleGetStudentProfile(w http.ResponseWriter, r *http.Request)

HandleGetStudentProfile godoc

@Summary		Get a student profile
@Description	Get a student profile
@Tags			Students
@Tags			Student
@Accept			json
@Produce		json
@Param			Authorization	header		string	true	"Insert your access token"	default(Bearer <Add access token here>)
@Success		200				{object}	httpx.DataJsonResponse{data=schemas.StudentProfile}
@Failure		400				{object}	httpx.ErrorJsonResponse
@Failure		500				{object}	httpx.ErrorJsonResponse
@Router			/students/profile [get]

func HandleGetStudents

func HandleGetStudents(w http.ResponseWriter, r *http.Request)

HandleStudents godoc

@Summary		Get students
@Description	Get all students from a school
@Tags			Students
@Tags			Admin
@Accept			json
@Produce		json
@Param			Authorization	header		string	true	"Insert your access token"	default(Bearer <Add access token here>)
@Success		200				{object}	httpx.DataJsonResponse{data=[]schemas.Student}
@Failure		400				{object}	httpx.ErrorJsonResponse
@Failure		500				{object}	httpx.ErrorJsonResponse
@Router			/students [get]

func HandlePatchAdminProfile

func HandlePatchAdminProfile(w http.ResponseWriter, r *http.Request)

HandlePatchAdminProfile godoc

@Summary		Update admin profile
@Description	Update admin profile
@Tags			Admin
@Accept			json
@Produce		json
@Param			Authorization	header		string						true	"Insert your access token"	default(Bearer <Add access token here>)
@Param			body			body		schemas.UpdateAdminRequest	true	"Update admin profile request body"
@Success		201				{object}	httpx.MessageJsonResponse
@Failure		400				{object}	httpx.ErrorJsonResponse
@Failure		500				{object}	httpx.ErrorJsonResponse
@Router			/admin/profile [patch]

func HandlePatchStudent

func HandlePatchStudent(w http.ResponseWriter, r *http.Request)

HandlePatchStudent godoc

@Summary		Update a student
@Description	Update a student from a school
@Tags			Students
@Tags			Admin
@Accept			json
@Produce		json
@Param			Authorization	header		string							true	"Insert your access token"	default(Bearer <Add access token here>)
@Param			studentId		path		string							true	"Update student id"
@Param			body			body		schemas.UpdateStudentRequest	true	"Update student request body"
@Success		201				{object}	httpx.MessageJsonResponse
@Failure		400				{object}	httpx.ErrorJsonResponse
@Failure		500				{object}	httpx.ErrorJsonResponse
@Router			/students/{studentId} [patch]

func HandlePatchStudentProfile

func HandlePatchStudentProfile(w http.ResponseWriter, r *http.Request)

HandlePatchStudentProfile godoc

@Summary		Update a student profile
@Description	Update a student profile
@Tags			Students
@Tags			Student
@Accept			json
@Produce		json
@Param			Authorization	header		string							true	"Insert your access token"	default(Bearer <Add access token here>)
@Param			body			body		schemas.UpdateStudentRequest	true	"Update student profile body request"
@Success		201				{object}	httpx.MessageJsonResponse
@Failure		400				{object}	httpx.ErrorJsonResponse
@Failure		500				{object}	httpx.ErrorJsonResponse
@Router			/students/profile [patch]

func HandlePostAnswers

func HandlePostAnswers(w http.ResponseWriter, r *http.Request)

HandlePostAnswers godoc

@Summary		Submit answer
@Description	Submit questionnare answers
@Tags			Questionnare
@Tags			Student
@Accept			json
@Produce		json
@Param			Authorization	header		string				true	"Insert your access token"	default(Bearer <Add access token here>)
@Param			body			body		[]schemas.SubmitAnswerRequest	true	"Submit answer request body"
@Success		201				{object}	httpx.MessageJsonResponse
@Failure		400				{object}	httpx.ErrorJsonResponse
@Failure		500				{object}	httpx.ErrorJsonResponse
@Router			/questionnare/answers [post]

func HandlePostLogin

func HandlePostLogin(w http.ResponseWriter, r *http.Request)

HandlePostLogin godoc

@Summary		Login authentication
@Description	Login authentication for student and admin
@Tags			Auth
@Accept			json
@Produce		json
@Param			body	body		schemas.LoginRequest	true	"Login request body"
@Success		200		{object}	httpx.DataJsonResponse{data=schemas.LoginResponse}
@Failure		400		{object}	httpx.ErrorJsonResponse
@Failure		500		{object}	httpx.ErrorJsonResponse
@Router			/auth/login [post]

func HandlePostQuestionnareSettings

func HandlePostQuestionnareSettings(w http.ResponseWriter, r *http.Request)

HandlePostQuestionnareSettings godoc

@Summary		Add questionnare setting
@Description	Add a questionnare setting
@Tags			Questionnare
@Tags			Admin
@Accept			json
@Produce		json
@Param			Authorization	header		string								true	"Insert your access token"	default(Bearer <Add access token here>)
@Param			body			body		schemas.QuestionnareSettingRequest	true	"Add questionnare setting request body"
@Success		201				{object}	httpx.MessageJsonResponse
@Failure		400				{object}	httpx.ErrorJsonResponse
@Failure		500				{object}	httpx.ErrorJsonResponse
@Router			/questionnare/settings [post]

func HandlePostStudent

func HandlePostStudent(w http.ResponseWriter, r *http.Request)

HandlePostStudent godoc

@Summary		Add a student
@Description	Add a student from a school
@Tags			Students
@Tags			Admin
@Accept			json
@Produce		json
@Param			Authorization	header		string						true	"Insert your access token"	default(Bearer <Add access token here>)
@Param			body			body		schemas.AddStudentRequest	true	"Add student request body"
@Success		201				{object}	httpx.MessageJsonResponse
@Failure		400				{object}	httpx.ErrorJsonResponse
@Failure		500				{object}	httpx.ErrorJsonResponse
@Router			/students [post]

func HanldeGetAdminProfile

func HanldeGetAdminProfile(w http.ResponseWriter, r *http.Request)

HanldeGetAdminProfile godoc

@Summary		Get admin profile
@Description	Get admin profile
@Tags			Admin
@Accept			json
@Produce		json
@Param			Authorization	header		string	true	"Insert your access token"	default(Bearer <Add access token here>)
@Success		200				{object}	httpx.DataJsonResponse{data=schemas.Admin}
@Failure		400				{object}	httpx.ErrorJsonResponse
@Failure		404				{object}	httpx.ErrorJsonResponse
@Failure		500				{object}	httpx.ErrorJsonResponse
@Router			/admin/profile [get]

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL