update
This commit is contained in:
parent
ff78042fe4
commit
94daad0c1f
@ -27,7 +27,7 @@ type LoginInput struct {
|
||||
Password string `json:"password" binding:"required"`
|
||||
}
|
||||
|
||||
// --- FUNGSI REGISTER ---
|
||||
// FUNGSI REGISTER
|
||||
func Register(c *gin.Context) {
|
||||
var input RegisterInput
|
||||
if err := c.ShouldBindJSON(&input); err != nil {
|
||||
@ -79,7 +79,6 @@ func Login(c *gin.Context) {
|
||||
}
|
||||
|
||||
// 4. Bikin Token JWT (Tiket Masuk)
|
||||
// Token berlaku selama 24 jam
|
||||
expirationTime := time.Now().Add(24 * time.Hour)
|
||||
claims := &jwt.MapClaims{
|
||||
"user_id": user.UserID,
|
||||
@ -104,4 +103,4 @@ func Login(c *gin.Context) {
|
||||
"role": user.Role,
|
||||
},
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@ -108,7 +108,7 @@ type UpdateStatusInput struct {
|
||||
Status string `json:"status" binding:"required"`
|
||||
}
|
||||
|
||||
//UPDATE STATUS (ADMIN)
|
||||
// UPDATE STATUS (ADMIN)
|
||||
func UpdateBookingStatus(c *gin.Context) {
|
||||
bookingID := c.Param("id")
|
||||
|
||||
@ -143,12 +143,12 @@ func UpdateBookingStatus(c *gin.Context) {
|
||||
})
|
||||
}
|
||||
|
||||
//INPUT UNTUK ESP3
|
||||
// INPUT UNTUK ESP3
|
||||
type RedeemInput struct {
|
||||
RedeemCode string `json:"redeem_code" binding:"required"`
|
||||
}
|
||||
|
||||
//VERIFIKASI KODE DARI ESP32
|
||||
// VERIFIKASI KODE DARI ESP32
|
||||
func VerifyRedeemCode(c *gin.Context) {
|
||||
var input RedeemInput
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user