enhance logging and fix Null pointer exception at wifi Null
This commit is contained in:
@@ -52,7 +52,7 @@ public class QRCodeTypeController {
|
||||
@PostMapping(value = API_URL_QRCODE_SCAN, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResponseEntity<BaseScanResponse> scanQRCode(@RequestBody QRCodePayload payload,
|
||||
@RequestHeader(required = false, name = HEADER_USER_ID) String userId) {
|
||||
logger.info("Invoking scan endpoint");
|
||||
logger.info("User Id Invoking scan endpoint: {}", userId);
|
||||
return ResponseEntity.ok(qrCodeTypeService.scanQRCode(userId, payload));
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.safeqr.app.qrcode.entity;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import jakarta.persistence.*;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
@@ -31,6 +32,7 @@ public class WifiEntity {
|
||||
|
||||
private String ssid;
|
||||
private String password;
|
||||
@JsonInclude(JsonInclude.Include.NON_EMPTY)
|
||||
private String encryption;
|
||||
private boolean hidden;
|
||||
}
|
||||
|
||||
@@ -60,6 +60,11 @@ public class WifiVerificationService {
|
||||
}
|
||||
|
||||
public String getClassification(String encryptionType) {
|
||||
// Check if encryptionType is null
|
||||
if (encryptionType == null) {
|
||||
return CLASSIFY_UNSAFE;
|
||||
}
|
||||
|
||||
if (encryptionType.equalsIgnoreCase("WPA") ||
|
||||
encryptionType.equalsIgnoreCase("WPA2") ||
|
||||
encryptionType.equalsIgnoreCase("WPA3")) {
|
||||
|
||||
Reference in New Issue
Block a user