added usertest

main
Nilo Roberto C Paim 2024-05-07 10:21:23 -03:00
parent a647c18fee
commit 0418ad4466
3 changed files with 17 additions and 0 deletions

View File

@ -190,3 +190,18 @@ func Checkuser(c *fiber.Ctx) error {
return c.JSON(user)
}
func Checkusertest(c *fiber.Ctx) error {
var usertest models.UserTest
email := c.Params("email")
database.DB.Where("email = ?", email).First(&usertest)
// if user.ID == 0 {
// return fiber.ErrNotFound
// }
return c.JSON(usertest)
}

View File

@ -25,4 +25,5 @@ type UserTest struct {
Name string `gorm:"size:40" json:"name"`
Email string `gorm:"size:40;unique" json:"email"`
Password []byte `gorm:"size:100;" json:"-"`
Status string `gorm:"size:2" json:"status"` // TR - Teste Realizado, TS - Aguardando
}

View File

@ -20,6 +20,7 @@ func Setup(app *fiber.App) {
app.Post("/register", controllers.AddUser)
app.Get("/checkuser/:email", controllers.Checkuser)
app.Get("/checktsertest/:name", controllers.Checkusertest)
// Webhooks
app.Post("/on_server_start", controllers.ServerStart)