保誠-保戶業務員媒合平台
wayne
2021-11-24 03a858f2882bedeb5925b65cb045ccbbb1202329
pamapi/src/main/java/com/pollex/pam/web/rest/OtpResource.java
@@ -21,6 +21,7 @@
import javax.xml.rpc.ServiceException;
import java.rmi.RemoteException;
import java.util.Arrays;
import java.util.UUID;
@RestController
@@ -43,7 +44,6 @@
    @PostMapping("/sendOtp")
    public ResponseEntity<Object> sendOtp(@RequestBody OtpLoginVM login) {
        try {
            if(applicationProperty.isMockLogin()) {
                return new ResponseEntity<>(getMockSendOtpResponse(), HttpStatus.OK);
            }
@@ -56,9 +56,6 @@
            }
            return ResponseEntity.status(HttpStatus.BAD_REQUEST).body("can not support this login type, loginType = " + login.getLoginType().name());
        } catch (ServiceException | RemoteException e) {
            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body("connecting otp web service error");
        }
    }
    @PostMapping("/verify")
@@ -79,6 +76,6 @@
    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", "", ""));
    }
}