added usertest
parent
a647c18fee
commit
0418ad4466
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue