event changes

main
Nilo Roberto C Paim 2023-09-10 08:34:59 -03:00
parent 6eef0934d5
commit e2f8970e6c
4 changed files with 6 additions and 7 deletions

View File

@ -75,10 +75,10 @@ func GetAllEvents(c *fiber.Ctx) error {
var events []models.Event
// _, err := utils.ProcessToken(c)
// if err != nil {
// return fiber.ErrUnauthorized
// }
_, err := utils.ProcessToken(c)
if err != nil {
return fiber.ErrUnauthorized
}
database.DB.Find(&events)

View File

@ -83,7 +83,7 @@ func ConnectDB() error {
user := models.User{
Name: "Pcast Admin",
Email: "pcast@pcast.com.br",
Email: "pcast@pcastive.com",
CompanyName: "PCast",
Password: passwd,
Channel: "pcast",

View File

@ -8,6 +8,6 @@ type Event struct {
Description string `gorm:"not null" json:"description"`
ExpectedDate time.Time `gorm:"not null" json:"startDt"`
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
}

View File

@ -18,7 +18,6 @@ func Setup(app *fiber.App) {
app.Post("/login", controllers.Login)
app.Post("/register", controllers.AddUser)
app.Get("/events", controllers.GetAllEvents)
// Webhooks
app.Post("/on_server_start", controllers.ServerStart)