Skip to content

Commit

Permalink
Merge branch 'develop' into feature/526
Browse files Browse the repository at this point in the history
  • Loading branch information
miseongk authored Nov 3, 2024
2 parents cc2af92 + da26443 commit 485bd87
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class BottleControllerV2(

// TODO: 따닥 방지
@ApiOperation("마이페이지 - 추가로 보틀 받기")
@GetMapping("/additional-random")
@PostMapping("/additional-random")
@AuthRequired
fun getAdditionalRandomBottle(@AuthUserId userId: Long) {
return bottleFacadeV2.getAdditionalRandomBottle(userId)
Expand Down
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,
) {
}
9 changes: 5 additions & 4 deletions api/src/main/resources/sql/ddl/table_query.sql
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@ CREATE TABLE user
is_match_activated BOOLEAN DEFAULT TRUE NOT NULL comment '매칭 활성화 여부',
last_random_matched_at DATETIME DEFAULT CURRENT_TIMESTAMP comment '유저의 최근 랜덤 매칭 시간으로, 랜덤 매칭시 갱신',
is_notification_enabled tinyint(1) default 0 not null comment '핸드폰 알림 허용 여부',
device_name varchar(255) null,
app_version varchar(255) null,
created_at DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL,
updated_at DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP NOT NULL
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;

CREATE TABLE user_profile
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 485bd87

Please sign in to comment.