-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#86 - 사용자의 기본 프로필을 설정 및 차단된 유저의 프로필을 설정한다 #89
Changes from 17 commits
5b60b43
c5c9e66
62a8a43
f66a8c6
ac27dee
7373593
9371341
e183b27
06e70df
8df3169
d953284
462bfbd
e36a0ff
1adef4b
dc2c4e9
3c989bf
92b3024
326bf9f
1491f1d
0ba533d
88a2aa1
b4b23cb
b0378dd
410bd89
c5b8aab
8dc9107
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.wespot.config | ||
|
||
import jakarta.annotation.PostConstruct | ||
import org.springframework.context.annotation.Configuration | ||
import org.springframework.context.annotation.Profile | ||
import java.util.* | ||
|
||
@Configuration | ||
@Profile("!local") | ||
class TimeZoneConfig { | ||
|
||
@PostConstruct | ||
fun timeZoneSetUp() { | ||
TimeZone.setDefault(TimeZone.getTimeZone("Asia/Seoul")) | ||
} | ||
|
||
} | ||
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ import com.wespot.auth.dto.request.SignUpRequest | |
import com.wespot.auth.dto.request.ConsentsRequest | ||
import com.wespot.auth.dto.response.TokenResponse | ||
import com.wespot.user.ConsentType | ||
import com.wespot.user.Gender | ||
import com.wespot.user.User | ||
import com.wespot.user.fixture.UserFixture | ||
|
||
|
@@ -15,7 +16,7 @@ object AuthFixture { | |
return SignUpRequest( | ||
signUpToken = "signUpToken", | ||
name = "Test User", | ||
gender = "male", | ||
gender = Gender.MALE, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 오우 쮓, 이거 Notification과 관련이 있는뎅 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 이것도 좀만 커밋 밀어넣을게용 허허허 ^.^ |
||
consents = ConsentsRequest( | ||
marketing = true | ||
), | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,30 @@ | ||
package com.wespot.common.infra | ||
|
||
import org.springframework.boot.test.context.TestConfiguration | ||
import org.springframework.context.annotation.Bean | ||
import org.springframework.jdbc.datasource.init.DataSourceInitializer | ||
import org.testcontainers.containers.GenericContainer | ||
import org.testcontainers.utility.DockerImageName | ||
import javax.sql.DataSource | ||
|
||
|
||
@TestConfiguration | ||
class TestContainer { | ||
|
||
companion object { | ||
private const val REDIS_DOCKER_IMAGE: String = "redis:7.0.8-alpine" | ||
|
||
init { | ||
val REDIS_CONTAINER = GenericContainer(DockerImageName.parse(REDIS_DOCKER_IMAGE)) | ||
.withExposedPorts(6379) | ||
.withReuse(true) | ||
private val REDIS_CONTAINER = GenericContainer(DockerImageName.parse(REDIS_DOCKER_IMAGE)) | ||
.withExposedPorts(6379) | ||
.withReuse(true) | ||
|
||
init { | ||
REDIS_CONTAINER.start() | ||
|
||
System.setProperty("spring.data.redis.host", REDIS_CONTAINER.getHost()) | ||
System.setProperty("spring.data.redis.host", REDIS_CONTAINER.host) | ||
System.setProperty("spring.data.redis.port", REDIS_CONTAINER.getMappedPort(6379).toString()) | ||
} | ||
|
||
} | ||
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ package com.wespot.notification.domain.vote | |
|
||
import com.wespot.notification.NotificationType | ||
import com.wespot.notification.vote.ReceivedVoteNotificationService | ||
import com.wespot.user.Gender | ||
import io.kotest.core.spec.style.BehaviorSpec | ||
import io.kotest.matchers.shouldBe | ||
import java.time.LocalDate | ||
|
@@ -11,7 +12,7 @@ class ReceivedVoteNotificationServiceTest : BehaviorSpec({ | |
given("남학생이 투표를 완료했을 때") { | ||
val service = ReceivedVoteNotificationService() | ||
`when`("투표를 받은이에게") { | ||
val notification = service.getNotification(100L, "female") | ||
val notification = service.getNotification(100L, Gender.FEMALE) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 머야 자기야 바꿔줬네? 대-박 |
||
then("알림이 발송된다.") { | ||
notification.userId shouldBe 100L | ||
notification.type shouldBe NotificationType.VOTE_RECEIVED | ||
|
@@ -26,7 +27,7 @@ class ReceivedVoteNotificationServiceTest : BehaviorSpec({ | |
given("여학생이 투표를 완료했을 때") { | ||
val service = ReceivedVoteNotificationService() | ||
`when`("투표를 받은이에게") { | ||
val notification = service.getNotification(100L, "male") | ||
val notification = service.getNotification(100L, Gender.MALE) | ||
then("알림이 발송된다.") { | ||
notification.userId shouldBe 100L | ||
notification.type shouldBe NotificationType.VOTE_RECEIVED | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ import com.wespot.user.SocialType | |
import com.wespot.user.User | ||
import com.wespot.user.UserConsent | ||
import com.wespot.user.UserIntroduction | ||
import com.wespot.user.Gender | ||
import com.wespot.user.dto.request.UpdateProfileRequest | ||
import org.springframework.security.authentication.TestingAuthenticationToken | ||
import org.springframework.security.core.context.SecurityContextHolder | ||
|
@@ -29,7 +30,7 @@ object UserFixture { | |
role = Role.USER, | ||
name = "TestUser", | ||
introduction = UserIntroduction.from("hello"), | ||
gender = "male", | ||
gender = Gender.MALE, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 자기야 이걸로 인해서 Postman 스펙도 조금 바뀌었엉 확인해줘잉 |
||
schoolId = 1L, | ||
grade = 1, | ||
classNumber = 1, | ||
|
@@ -64,7 +65,7 @@ object UserFixture { | |
role = Role.USER, | ||
name = "TestUser", | ||
introduction = UserIntroduction.from("hello"), | ||
gender = "male", | ||
gender = Gender.MALE, | ||
schoolId = 1L, | ||
grade = 1, | ||
classNumber = 1, | ||
|
@@ -98,7 +99,7 @@ object UserFixture { | |
role = Role.USER, | ||
name = "Sender", | ||
introduction = UserIntroduction.from("intro"), | ||
gender = "M", | ||
gender = Gender.MALE, | ||
schoolId = 1L, | ||
grade = 1, | ||
classNumber = 1, | ||
|
@@ -132,7 +133,7 @@ object UserFixture { | |
role = Role.USER, | ||
name = "Receiver", | ||
introduction = UserIntroduction.from("intro"), | ||
gender = "M", | ||
gender = Gender.MALE, | ||
schoolId = 1L, | ||
grade = 1, | ||
classNumber = 1, | ||
|
@@ -189,7 +190,7 @@ object UserFixture { | |
password = "password", | ||
name = name, | ||
introduction = UserIntroduction.from("소개 $id"), | ||
gender = "M", | ||
gender = Gender.MALE, | ||
schoolId = schoolId, | ||
profile = Profile(profileId, "", ""), | ||
fcm = null, | ||
|
@@ -227,7 +228,7 @@ object UserFixture { | |
role = Role.USER, | ||
name = "TestUser", | ||
introduction = UserIntroduction.from("hello"), | ||
gender = "male", | ||
gender = Gender.MALE, | ||
schoolId = schoolId, | ||
grade = grade, | ||
classNumber = classNumber, | ||
|
@@ -264,7 +265,7 @@ object UserFixture { | |
role = Role.USER, | ||
name = "TestUser", | ||
introduction = UserIntroduction.from("hello"), | ||
gender = "male", | ||
gender = Gender.MALE, | ||
schoolId = schoolId, | ||
grade = grade, | ||
classNumber = classNumber, | ||
|
@@ -301,7 +302,7 @@ object UserFixture { | |
role = Role.USER, | ||
name = "TestUser", | ||
introduction = UserIntroduction.from("hello"), | ||
gender = "male", | ||
gender = Gender.MALE, | ||
schoolId = schoolId, | ||
grade = grade, | ||
classNumber = classNumber, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
package com.wespot.auth.dto.request | ||
|
||
data class ProfileRequest( | ||
val backgroundColor: String, | ||
val iconUrl: String, | ||
val backgroundColor: String?, | ||
val iconUrl: String?, | ||
) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,14 +2,16 @@ package com.wespot.message.dto.response | |
|
||
data class MessageBlockedListResponse( | ||
val messages: List<MessageBlockedResponse>, | ||
val hasNext: Boolean | ||
val hasNext: Boolean, | ||
val lastCursorId: Long, | ||
) { | ||
companion object { | ||
|
||
fun from(messages: List<MessageBlockedResponse>, hasNext: Boolean): MessageBlockedListResponse { | ||
return MessageBlockedListResponse( | ||
messages = messages, | ||
hasNext = hasNext | ||
hasNext = hasNext, | ||
lastCursorId = messages.lastOrNull()?.id ?: 0L | ||
Comment on lines
+13
to
+14
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 굳굳! |
||
) | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
기천짱 미안해요. 여기다가 커밋 끼워넣었어잉 봐줘잉
이전에는 timezone 설정이 제대로 되어 있지 않아, 투표 독려도 정확하지 않은 시간에 들어갔었어요.
하지만, 이 설정으로 인해, 투표 독려가 실행되는 시각인 9,15,21시 중 9시에 정확히 잘 실행되는 것을 볼 수 있어요.