master
parent
f6dce5be20
commit
13c64896eb
|
|
@ -22,6 +22,7 @@ var (
|
||||||
Port int
|
Port int
|
||||||
SessionD string
|
SessionD string
|
||||||
Debug bool
|
Debug bool
|
||||||
|
Semaphore sync.Mutex
|
||||||
}
|
}
|
||||||
|
|
||||||
//go:embed template.d/login.html
|
//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 {
|
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")
|
return errors.New("not impl")
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue