event changes
parent
6eef0934d5
commit
e2f8970e6c
|
|
@ -75,10 +75,10 @@ func GetAllEvents(c *fiber.Ctx) error {
|
||||||
|
|
||||||
var events []models.Event
|
var events []models.Event
|
||||||
|
|
||||||
// _, err := utils.ProcessToken(c)
|
_, err := utils.ProcessToken(c)
|
||||||
// if err != nil {
|
if err != nil {
|
||||||
// return fiber.ErrUnauthorized
|
return fiber.ErrUnauthorized
|
||||||
// }
|
}
|
||||||
|
|
||||||
database.DB.Find(&events)
|
database.DB.Find(&events)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -83,7 +83,7 @@ func ConnectDB() error {
|
||||||
|
|
||||||
user := models.User{
|
user := models.User{
|
||||||
Name: "Pcast Admin",
|
Name: "Pcast Admin",
|
||||||
Email: "pcast@pcast.com.br",
|
Email: "pcast@pcastive.com",
|
||||||
CompanyName: "PCast",
|
CompanyName: "PCast",
|
||||||
Password: passwd,
|
Password: passwd,
|
||||||
Channel: "pcast",
|
Channel: "pcast",
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,6 @@ type Event struct {
|
||||||
Description string `gorm:"not null" json:"description"`
|
Description string `gorm:"not null" json:"description"`
|
||||||
ExpectedDate time.Time `gorm:"not null" json:"startDt"`
|
ExpectedDate time.Time `gorm:"not null" json:"startDt"`
|
||||||
UserId uint `gorm:"size:40;not null" json:"user"`
|
UserId uint `gorm:"size:40;not null" json:"user"`
|
||||||
EventType string `gorm:"size:1;not null;default:O" json:"eventtype"` // O = Open, C = Closed
|
EventType string `gorm:"size:1;not null;default:O" json:"eventtype"` // T = Test, N = Normal
|
||||||
Transmitted string `gorm:"size:1;not null;default:N" json:"transmitted"` // Y = Already transmitted, N = Not transmitted yet
|
Transmitted string `gorm:"size:1;not null;default:N" json:"transmitted"` // Y = Already transmitted, N = Not transmitted yet
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,6 @@ func Setup(app *fiber.App) {
|
||||||
|
|
||||||
app.Post("/login", controllers.Login)
|
app.Post("/login", controllers.Login)
|
||||||
app.Post("/register", controllers.AddUser)
|
app.Post("/register", controllers.AddUser)
|
||||||
app.Get("/events", controllers.GetAllEvents)
|
|
||||||
|
|
||||||
// Webhooks
|
// Webhooks
|
||||||
app.Post("/on_server_start", controllers.ServerStart)
|
app.Post("/on_server_start", controllers.ServerStart)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue