30 lines
754 B
Go
30 lines
754 B
Go
|
package main
|
||
|
|
||
|
import (
|
||
|
"encoding/json"
|
||
|
"fmt"
|
||
|
"net/http"
|
||
|
)
|
||
|
|
||
|
func postPasswort(w http.ResponseWriter, r *http.Request) {
|
||
|
felder := make(map[string]string)
|
||
|
err := json.NewDecoder(r.Body).Decode(&felder)
|
||
|
check(err)
|
||
|
fmt.Printf("Username is %s\n", felder)
|
||
|
odtdatei := "www/data/passwort.odt"
|
||
|
fillODTForm("vorlagen/passwortschreiben.odt", odtdatei, felder)
|
||
|
makepdf(odtdatei)
|
||
|
json.NewEncoder(w).Encode("OK")
|
||
|
}
|
||
|
|
||
|
func postHandy(w http.ResponseWriter, r *http.Request) {
|
||
|
felder := make(map[string]string)
|
||
|
err := json.NewDecoder(r.Body).Decode(&felder)
|
||
|
check(err)
|
||
|
fmt.Printf("Username is %s\n", felder)
|
||
|
odtdatei := "www/data/handy.odt"
|
||
|
fillODTForm("vorlagen/handyausgabe.odt", odtdatei, felder)
|
||
|
makepdf(odtdatei)
|
||
|
json.NewEncoder(w).Encode("OK")
|
||
|
}
|