You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
385 B

4 years ago
  1. package api
  2. import (
  3. "git.aiterp.net/lucifer/server3/app/config"
  4. "git.aiterp.net/lucifer/server3/models"
  5. "github.com/gin-gonic/gin"
  6. )
  7. func Events(r gin.IRoutes) {
  8. r.POST("", handler(func(c *gin.Context) (interface{}, error) {
  9. var event models.Event
  10. err := parseBody(c, &event)
  11. if err != nil {
  12. return nil, err
  13. }
  14. config.EventChannel<-event
  15. return event, nil
  16. }))
  17. }