bel 2023-06-17 09:37:51 -06:00
parent f6dce5be20
commit 13c64896eb
1 changed files with 17 additions and 3 deletions

View File

@ -19,9 +19,10 @@ import (
var (
Config struct {
Port int
SessionD string
Debug bool
Port int
SessionD string
Debug bool
Semaphore sync.Mutex
}
//go:embed template.d/login.html
@ -231,5 +232,18 @@ func handleNotFound(w http.ResponseWriter, r *http.Request) error {
}
func handleAPIChatBot(w http.ResponseWriter, r *http.Request) error {
cookie, _ := ParseCookie(r)
err := r.ParseForm()
if err != nil {
return err
}
got := r.PostForm.Get("Message")
if len(got) == 0 {
return errors.New("empty Message")
}
Config.Semaphore.Lock()
defer Config.Semaphore.Unlock()
return errors.New("not impl")
}