handler

package
v0.0.0-...-37076da Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetStudents

func GetStudents() echo.HandlerFunc

GetStudents godoc

@Summary Get all students @Description Get all students @ID get-students @Tags student @Produce json @Success 200 {object} []student.Student @Security access_token @Router /students [get]

func RegisterStudent

func RegisterStudent() echo.HandlerFunc

RegitersStudent godoc

@Summary Register a student @Description Register a student @ID register-student @Tags student @Produce json @Param student body adapter.RegisterStudent true "Student" @Success 201 {object} HttpNewStudent @Failure 400 {object} http_error.HTTPBadRequestError "Bad request" @Failure 409 {object} http_error.HTTPError "User with that email already exists" @Failure 500 {object} http_error.HTTPError "An error occurred" @Router /student [post]

Types

type HttpNewStudent

type HttpNewStudent struct {
	Data HttpStudent `json:"data"`
}

HttpNewStudent is a student representation for http response

func NewHttpNewStudent

func NewHttpNewStudent(s student.Student) *HttpNewStudent

NewHttpNewStudent creates a new HttpNewStudent

type HttpStudent

type HttpStudent struct {
	ID    string `json:"id,omitempty" example:"550e8400-e29b-41d4-a716-446655440000" format:"uuid"`
	Email string `json:"email,omitempty" example:"john@doe.com" format:"email"`
	Scope string `json:"scopes,omitempty" example:"student"`
}

HttpStudent is a student representation for http response

Jump to

Keyboard shortcuts

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