k
This commit is contained in:
@@ -19,9 +19,10 @@ import (
|
|||||||
|
|
||||||
var (
|
var (
|
||||||
Config struct {
|
Config struct {
|
||||||
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")
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user