remove unnecessary comments
This commit is contained in:
parent
e277644657
commit
6c5b191462
1 changed files with 0 additions and 10 deletions
10
main.go
10
main.go
|
|
@ -17,7 +17,6 @@ import (
|
|||
"github.com/labstack/echo/v4/middleware"
|
||||
)
|
||||
|
||||
// Todo model
|
||||
type Bewertung struct {
|
||||
Vorname string
|
||||
Nachname string
|
||||
|
|
@ -53,11 +52,9 @@ var (
|
|||
func main() {
|
||||
e := echo.New()
|
||||
|
||||
// Middleware
|
||||
e.Use(middleware.Logger())
|
||||
e.Use(middleware.Recover())
|
||||
|
||||
// Routes
|
||||
e.GET("/", renderBewertungenRoute)
|
||||
e.POST("/toggle/:id", toggleWertungRoute)
|
||||
e.POST("/add", addBewertungRoute)
|
||||
|
|
@ -65,15 +62,12 @@ func main() {
|
|||
e.GET("/end", endRoute)
|
||||
|
||||
// Start the server
|
||||
// e.Logger.Fatal(e.Start(":3000"))
|
||||
go func() {
|
||||
e.Logger.Fatal(e.Start(":3000"))
|
||||
}()
|
||||
|
||||
// Öffne den Standardbrowser mit der Seite localhost:3000
|
||||
openInBrowser("http://localhost:3000")
|
||||
|
||||
// Warte auf ein Signal zum Beenden (zum Beispiel STRG+C)
|
||||
select {}
|
||||
}
|
||||
|
||||
|
|
@ -124,7 +118,6 @@ func parseBewertungen(c echo.Context) Bewertung {
|
|||
gesamtProzent := hvProzent*maxPunkte.HvGewichtung/100 + lvProzent*maxPunkte.LvGewichtung/100
|
||||
gesamtNote := setNote(gesamtProzent)
|
||||
|
||||
// Create a new Bewertung struct
|
||||
return Bewertung{
|
||||
ID: len(bewertungen) + 1,
|
||||
Vorname: string(vorname),
|
||||
|
|
@ -473,7 +466,6 @@ func exportBewertungenRoute(c echo.Context) error {
|
|||
pdf := gofpdf.New("P", "mm", "A4", "")
|
||||
pdf.AddPage()
|
||||
|
||||
// Add table headers
|
||||
pdf.SetFont("Arial", "B", 12)
|
||||
pdf.CellFormat(27, 10, "Vorname", "1", 0, "", false, 0, "")
|
||||
pdf.CellFormat(27, 10, "Nachname", "1", 0, "", false, 0, "")
|
||||
|
|
@ -484,7 +476,6 @@ func exportBewertungenRoute(c echo.Context) error {
|
|||
pdf.CellFormat(27, 10, "Gesamtnote", "1", 0, "", false, 0, "")
|
||||
pdf.Ln(-1)
|
||||
|
||||
// Add table rows
|
||||
pdf.SetFont("Arial", "", 11)
|
||||
for _, bewertung := range bewertungen {
|
||||
pdf.CellFormat(27, 10, bewertung.Vorname, "1", 0, "", false, 0, "")
|
||||
|
|
@ -497,7 +488,6 @@ func exportBewertungenRoute(c echo.Context) error {
|
|||
pdf.Ln(-1)
|
||||
}
|
||||
|
||||
// Save PDF file
|
||||
err := pdf.OutputFileAndClose("bewertungen.pdf")
|
||||
if err != nil {
|
||||
fmt.Println("Fehler beim Exportieren der Bewertungen:", err)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue