handler

package
v0.0.0-...-207707d Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Class

type Class struct {
	StudentId  primitive.ObjectID `json:"studentId" bson:"studentId"`
	Time       string             `json:"time" bson:"time"`
	Type       string             `json:"type" bson:"type"`
	Attendence *bool              `json:"attendance" bson:"attendance"`
}

Create struct (class) for Classes that will be added to Schedule

type Schedule

type Schedule struct {
	Id      primitive.ObjectID `json:"id" bson:"_id"`
	Date    primitive.DateTime `bson:"date" json:"date"`
	Classes []Class            `bson:"classes" json:"classes"`
}

Create struct (class) for Schedule

type ScheduleHandler

type ScheduleHandler struct{}

Create struct (class) for StudentHandler to handle requests

func (*ScheduleHandler) Create

func (scheduleHandler *ScheduleHandler) Create(w http.ResponseWriter, r *http.Request)

POST for schedule creation

func (*ScheduleHandler) DeleteByID

func (scheduleHandler *ScheduleHandler) DeleteByID(w http.ResponseWriter, r *http.Request)

DELETE for deleting schedule

func (*ScheduleHandler) GetByID

func (scheduleHandler *ScheduleHandler) GetByID(w http.ResponseWriter, r *http.Request)

GET for one schedule by ID

func (*ScheduleHandler) List

func (scheduleHandler *ScheduleHandler) List(w http.ResponseWriter, r *http.Request)

GET for schedules list

func (*ScheduleHandler) UpdateByID

func (scheduleHandler *ScheduleHandler) UpdateByID(w http.ResponseWriter, r *http.Request)

PUT for schedule classes update

type Student

type Student struct {
	Id           primitive.ObjectID `json:"id" bson:"_id"`
	Fullname     string             `json:"fullname" bson:"fullname"`
	Phone        string             `json:"phone" bson:"phone"`
	Subscription *int               `json:"subscription" bson:"subscription"`
	StartDate    *time.Time         `json:"startDate" bson:"startDate"`
	LastDate     *time.Time         `json:"lastDate" bson:"lastDate"`
	Comments     *string            `json:"comments" bson:"comments"`
}

Create struct (class) for Student

type StudentHandler

type StudentHandler struct{}

Create struct (class) for StudentHandler to handle requests

func (*StudentHandler) Create

func (studentHandler *StudentHandler) Create(w http.ResponseWriter, r *http.Request)

POST for student creation

func (*StudentHandler) DeleteByID

func (studentHandler *StudentHandler) DeleteByID(w http.ResponseWriter, r *http.Request)

DELETE for one student by ID

func (*StudentHandler) GetByID

func (studentHandler *StudentHandler) GetByID(w http.ResponseWriter, r *http.Request)

GET for one student by ID

func (*StudentHandler) List

func (studentHandler *StudentHandler) List(w http.ResponseWriter, r *http.Request)

GET for students list

func (*StudentHandler) UpdateByID

func (studentHandler *StudentHandler) UpdateByID(w http.ResponseWriter, r *http.Request)

PUT for one student by ID

Jump to

Keyboard shortcuts

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