Skip to content

Commit

Permalink
feat: googlebot 등록 X
Browse files Browse the repository at this point in the history
  • Loading branch information
jcw1031 committed Feb 21, 2024
1 parent 6e47e56 commit 1ab5d91
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/main/java/ac/knu/likeknu/service/DeviceService.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,16 @@ public DeviceService(DeviceRepository deviceRepository) {
}

public void registerDeviceId(DeviceRegistrationRequest deviceRequest) {
String userAgent = deviceRequest.userAgent();
if (userAgent.contains("Googlebot")) {
return;
}

String deviceId = deviceRequest.deviceId();
Device device = deviceRepository.findById(deviceId)
.orElseGet(() -> Device.of(deviceRequest));

device.updatePlatform(deviceRequest.userAgent());
device.updatePlatform(userAgent);
String campus = deviceRequest.campus();
device.updateCampus(Campus.of(campus));
device.visitNow();
Expand Down

0 comments on commit 1ab5d91

Please sign in to comment.