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
20 lines
385 B
package api
|
|
|
|
import (
|
|
"git.aiterp.net/lucifer/server3/app/config"
|
|
"git.aiterp.net/lucifer/server3/models"
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
func Events(r gin.IRoutes) {
|
|
r.POST("", handler(func(c *gin.Context) (interface{}, error) {
|
|
var event models.Event
|
|
err := parseBody(c, &event)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
config.EventChannel<-event
|
|
return event, nil
|
|
}))
|
|
}
|