This commit is contained in:
@@ -3,6 +3,7 @@ package com.drinkool.services;
|
||||
import com.drinkool.Role;
|
||||
import com.drinkool.Url;
|
||||
import com.drinkool.entities.ManagerEntity;
|
||||
import com.drinkool.entities.StaffEntity;
|
||||
import com.drinkool.lib.dtos.SmsOtp;
|
||||
import com.drinkool.models.UserModel;
|
||||
import jakarta.inject.Inject;
|
||||
@@ -28,6 +29,10 @@ public class AccountService {
|
||||
ManagerEntity.find("phone", input.phone).firstResult() != null
|
||||
) return Response.accepted().entity(Role.Manager).build();
|
||||
|
||||
if (
|
||||
StaffEntity.find("phone", input.phone).firstResult() != null
|
||||
) return Response.accepted().entity(Role.Staff).build();
|
||||
|
||||
String otp = otpService.generateAndSaveOtp(input.phone);
|
||||
|
||||
System.out.println("OTP cho " + input.phone + " là: " + otp);
|
||||
|
||||
Reference in New Issue
Block a user