Skip to content

Commit

Permalink
feat: 유저 정보에 디바이스명 추가 (#540)
Browse files Browse the repository at this point in the history
  • Loading branch information
injoon2019 authored Oct 30, 2024
1 parent c16239f commit da26443
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ class UserFacade(
userId = userId,
alimyTurnedOn = nativeAlimyRequest.alimyTurnedOn,
deviceName = nativeAlimyRequest.deviceName,
appVersion = nativeAlimyRequest.appVersion
appVersion = nativeAlimyRequest.appVersion,
deviceId = nativeAlimyRequest.deviceId,
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ data class NativeSettingRegisterRequest(
val alimyTurnedOn: Boolean = false,
val deviceName: String? = null,
val appVersion: String? = null,
val deviceId: String? = null,
) {
}
1 change: 1 addition & 0 deletions api/src/main/resources/sql/ddl/table_query.sql
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ CREATE TABLE user
is_notification_enabled tinyint(1) default 0 not null comment '핸드폰 알림 허용 여부',
device_name varchar(255) null,
app_version varchar(255) null,
deviceId varchar(255) null,
created_at DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL,
updated_at DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP NOT NULL
) AUTO_INCREMENT = 10;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ class User(

var deviceName: String? = null,

var deviceId: String? = null,

var appVersion: String? = null,
) : BaseEntity() {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,12 @@ class UserService(
}

@Transactional
fun changeNativeSetting(userId: Long, alimyTurnedOn: Boolean, deviceName: String?, appVersion: String?) {
fun changeNativeSetting(userId: Long, alimyTurnedOn: Boolean, deviceName: String?, appVersion: String?, deviceId: String?) {
userRepository.findByIdOrNull(userId)?.let {
it.isNotificationEnabled = alimyTurnedOn
it.appVersion = appVersion
it.deviceName = deviceName
it.deviceId = deviceId
}
}
}

0 comments on commit da26443

Please sign in to comment.