保誠-保戶業務員媒合平台
wayne
2021-11-24 75fd8a02c058f6a51e3c5ea36d997c157c070793
pamapi/src/main/java/com/pollex/pam/web/rest/OtpResource.java
@@ -25,6 +25,7 @@
import javax.xml.rpc.ServiceException;
import java.rmi.RemoteException;
import java.util.Arrays;
import java.util.UUID;
@RestController
@@ -74,6 +75,11 @@
        } catch (ServiceException | RemoteException e) {
            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body("connecting otp web service error");
        }
        else if(login.getLoginType() == OtpLoginTypeEnum.EMAIL) {
            return new ResponseEntity<>(otpWebService.sendByEmail(login.getAccount()), HttpStatus.OK);
        }
        return ResponseEntity.status(HttpStatus.BAD_REQUEST).body("can not support this login type, loginType = " + login.getLoginType().name());
    }
    @PostMapping("/verify")
@@ -86,7 +92,7 @@
 
    private OtpResponseDTO getMockSendOtpResponse() {
        String indexKey = UUID.randomUUID().toString().substring(0, 8);
        return new OtpResponseDTO(new String[]{indexKey, "0", "", ""});
        return new OtpResponseDTO(Arrays.asList(indexKey, "0", "", ""));
    }
    
    @PostMapping("/register")