1234567891011121314151617181920212223 |
- package routes
- import (
- "fmt"
- "net/http"
- utils "github.com/nchursin/formtgbot/api/utils"
- "github.com/nchursin/formtgbot/redis"
- structs "github.com/nchursin/formtgbot/structs"
- tg "github.com/nchursin/formtgbot/telegram"
- )
- func Response(w http.ResponseWriter, r *http.Request) {
- var parsedBody structs.Vacancy
- utils.ParseJson(r.Body, &parsedBody)
- fmt.Printf("Incoming request %s\n", parsedBody)
- redis.Store(&parsedBody)
- tg.GetBot().SendMessage(&parsedBody)
- fmt.Fprintf(w, "Logged")
- }
|