Skip to content

Commit

Permalink
hotfix: model name and os version collect
Browse files Browse the repository at this point in the history
  • Loading branch information
jcw1031 committed May 6, 2024
1 parent 3e05e11 commit 3995f33
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
package ac.knu.likeknu.controller.dto.device.request;

import ac.knu.likeknu.domain.constants.Campus;
import com.fasterxml.jackson.annotation.JsonAlias;

public record DeviceRegistrationRequest(
String deviceId, String userAgent, Campus campus, String themeColor, String favoriteCafeteria
String deviceId,
@JsonAlias("platform")
String userAgent,
String modelName,
String osVersion,
Campus campus,
String themeColor,
String favoriteCafeteria
) {
}
11 changes: 11 additions & 0 deletions src/main/java/ac/knu/likeknu/domain/Device.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ public class Device {

private String platform;

private String modelName;

private String osVersion;

private String themeColor;

private String favoriteCafeteria;
Expand Down Expand Up @@ -112,5 +116,12 @@ public void update(DeviceRegistrationRequest deviceRequest) {
this.themeColor = deviceRequest.themeColor();
this.favoriteCafeteria = deviceRequest.favoriteCafeteria();
lastVisitedAt = LocalDateTime.now();

if (deviceRequest.modelName() != null) {
this.modelName = deviceRequest.modelName();
}
if (deviceRequest.osVersion() != null) {
this.osVersion = deviceRequest.osVersion();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ALTER TABLE device
ADD COLUMN model_name VARCHAR(32) AFTER platform;

ALTER TABLE device
ADD COLUMN os_version VARCHAR(12) AFTER model_name;

0 comments on commit 3995f33

Please sign in to comment.