Sprechstunden hinzufügen und durch einen E-Mail-Link bestätigen lassen
This commit is contained in:
parent
369f4ebcec
commit
78af58a51d
18 changed files with 291 additions and 29 deletions
|
@ -9,3 +9,20 @@ type Date struct {
|
|||
}
|
||||
|
||||
const MinuteGranularity int = 5
|
||||
|
||||
func DayName(day int) string {
|
||||
switch day {
|
||||
case 0:
|
||||
return "Montag"
|
||||
case 1:
|
||||
return "Dienstag"
|
||||
case 2:
|
||||
return "Mittwoch"
|
||||
case 3:
|
||||
return "Donnerstag"
|
||||
case 4:
|
||||
return "Freitag"
|
||||
default:
|
||||
return ""
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,5 +18,5 @@ type OfficeHourRepository interface {
|
|||
FindByRoom(room Room, activatedOnly bool) ([]OfficeHour, error)
|
||||
GetAll(activatedOnly bool) ([]OfficeHour, error)
|
||||
Delete(officeHour OfficeHour) error
|
||||
Add(officeHour OfficeHour) error
|
||||
Add(officeHour OfficeHour) (int, error)
|
||||
}
|
||||
|
|
20
models/request.go
Normal file
20
models/request.go
Normal file
|
@ -0,0 +1,20 @@
|
|||
// request
|
||||
package models
|
||||
|
||||
type Request struct {
|
||||
Id int
|
||||
OfficeHour OfficeHour
|
||||
Action int
|
||||
Secret string
|
||||
}
|
||||
|
||||
const RequestActivate int = 1
|
||||
const RequestDelete int = 2
|
||||
|
||||
const SecretLength int = 15
|
||||
|
||||
type RequestRepository interface {
|
||||
Add(officeHour OfficeHour, action int) (int, error)
|
||||
FindBySecret(secret string) (Request, error)
|
||||
Execute(request Request) error
|
||||
}
|
|
@ -12,5 +12,5 @@ type TutorRepository interface {
|
|||
FindByNameAndEmail(name string, email string) (Tutor, error)
|
||||
FindById(Id int) (Tutor, error)
|
||||
GetAll() ([]Tutor, error)
|
||||
Add(tutor Tutor) error
|
||||
Add(tutor Tutor) (int, error)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue