Skip to content

Commit 2700966

Browse files
authored
v0.1.10
v0.1.10
2 parents 59ba6df + 22d99fe commit 2700966

File tree

15 files changed

+58
-24
lines changed

15 files changed

+58
-24
lines changed

sseudam-clients/notification/src/main/kotlin/com/sseudam/client/discord/DiscordClientSender.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ class DiscordClientSender(
4545
4646
**이메일:** ${userProfile.email}
4747
**회원 ID:** ${userProfile.id}
48+
**닉네임:** ${userProfile.nickname}
49+
**사용자 관심지역:** ${userProfile.address.site}
4850
**가입일시:** ${userProfile.createdAt.toLocalDate()} ${userProfile.createdAt.toLocalTime()}
4951
""".trimIndent()
5052

sseudam-core/core-api/src/main/kotlin/com/sseudam/presentation/v1/auth/AuthController.kt

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import com.sseudam.auth.AuthenticationFacade
44
import com.sseudam.auth.AuthenticationService
55
import com.sseudam.auth.CredentialSocial
66
import com.sseudam.client.oauth.OAuthService
7-
import com.sseudam.common.Address
87
import com.sseudam.presentation.v1.annotation.ApiV1Controller
98
import com.sseudam.presentation.v1.auth.request.LoginRequest
109
import com.sseudam.presentation.v1.auth.request.RefreshTokenRequest
@@ -97,7 +96,7 @@ class AuthController(
9796
credentialSocial =
9897
CredentialSocial(
9998
email = socialInfo.email,
100-
name = null,
99+
name = "",
101100
socialId = socialInfo.id,
102101
socialType = SocialType.APPLE,
103102
),
@@ -114,14 +113,7 @@ class AuthController(
114113
if (tempUser == null) {
115114
throw ErrorException(ErrorType.NOT_FOUND_DATA)
116115
} else {
117-
userService.updateName(tempUser.key, request.name)
118-
userService.updateAddress(
119-
tempUser.key,
120-
Address(
121-
city = request.address.split(" ")[1],
122-
site = request.address,
123-
),
124-
)
116+
userService.socialSignUp(tempUser, request.toNewUser(tempUser.socialId, tempUser.socialType, request.address))
125117
}
126118
return SignUpResponse("회원가입에 성공했습니다.")
127119
}

sseudam-core/core-api/src/main/kotlin/com/sseudam/presentation/v1/auth/request/SignUpRequest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ data class SignUpRequest(
1414
@Schema(description = "비밀번호", example = "password")
1515
val password: String,
1616
@Schema(description = "이름", example = "윤범차")
17-
val name: String?,
17+
val name: String,
1818
@Schema(description = "이름", example = "닉네임이야")
19-
val nickname: String?,
19+
val nickname: String,
2020
) {
2121
fun toNewUser(password: String): NewUser =
2222
NewUser(

sseudam-core/core-api/src/main/kotlin/com/sseudam/presentation/v1/auth/request/SignUpSocialRequest.kt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package com.sseudam.presentation.v1.auth.request
33
import com.sseudam.auth.AuthorityType
44
import com.sseudam.auth.GrantedAuthority
55
import com.sseudam.auth.NewAuthenticationSocial
6+
import com.sseudam.common.Address
67
import com.sseudam.user.NewUser
78
import com.sseudam.user.SocialType
89
import io.swagger.v3.oas.annotations.media.Schema
@@ -28,6 +29,23 @@ data class SignUpSocialRequest(
2829
address = null,
2930
)
3031

32+
fun toNewUser(
33+
socialId: String,
34+
socialType: SocialType,
35+
site: String,
36+
): NewUser =
37+
NewUser(
38+
email = email,
39+
name = name,
40+
socialId = socialId,
41+
socialType = socialType,
42+
address =
43+
Address(
44+
city = site.split(" ").getOrNull(1) ?: "",
45+
site = site,
46+
),
47+
)
48+
3149
fun toNewAuthenticationSocial(
3250
socialId: String,
3351
socialType: SocialType,

sseudam-core/core-api/src/main/kotlin/com/sseudam/presentation/v1/report/request/ReportValidationRequest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ data class ReportValidationRequest(
1616
when {
1717
name.isBlank() -> throw ErrorException(ErrorType.SPOT_NAME_IS_BLANK)
1818
name.length < 2 -> throw ErrorException(ErrorType.INVALID_TRASH_SPOT_NAME_TWO)
19-
name.length > 12 -> throw ErrorException(ErrorType.INVALID_TRASH_SPOT_NAME_TWELVE)
19+
name.length > 30 -> throw ErrorException(ErrorType.INVALID_TRASH_SPOT_NAME_TWELVE)
2020
}
2121
}
2222
}

sseudam-core/core-api/src/main/kotlin/com/sseudam/presentation/v1/suggestion/request/SuggestionValidationRequest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ data class SuggestionValidationRequest(
1616
when {
1717
name.isBlank() -> throw ErrorException(ErrorType.SPOT_NAME_IS_BLANK)
1818
name.length < 2 -> throw ErrorException(ErrorType.INVALID_TRASH_SPOT_NAME_TWO)
19-
name.length > 12 -> throw ErrorException(ErrorType.INVALID_TRASH_SPOT_NAME_TWELVE)
19+
name.length > 30 -> throw ErrorException(ErrorType.INVALID_TRASH_SPOT_NAME_TWELVE)
2020
}
2121
}
2222
}

sseudam-core/core-api/src/test/kotlin/com/sseudam/domain/trashspot/TrashSpotFacadeTest.kt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,16 @@ class TrashSpotFacadeTest :
6060
status = SuggestionStatus.WAITING,
6161
createdAt = LocalDateTime.now(),
6262
)
63-
val userProfile = UserProfile(id = 123L, key = "k", email = "[email protected]", name = "u", nickname = "nick", createdAt = LocalDateTime.now())
63+
val userProfile =
64+
UserProfile(
65+
id = 123L,
66+
key = "k",
67+
email = "[email protected]",
68+
name = "u",
69+
nickname = "nick",
70+
address = spot.address,
71+
createdAt = LocalDateTime.now(),
72+
)
6473

6574
every { service.findBy(1L) } returns spot
6675
every { imageService.findBySpotId(1L) } returns listOf(image)

sseudam-core/core-domain/src/main/kotlin/com/sseudam/auth/CredentialSocial.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import com.sseudam.user.SocialType
44

55
data class CredentialSocial(
66
val email: String,
7-
val name: String?,
7+
val name: String,
88
val socialId: String,
99
val socialType: SocialType,
1010
)

sseudam-core/core-domain/src/main/kotlin/com/sseudam/user/NewUser.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import com.sseudam.common.Address
1313
* @property socialType 소셜 타입
1414
*/
1515
data class NewUser(
16-
val name: String?,
16+
val name: String,
1717
val nickname: String? = null,
1818
val address: Address?,
1919
val email: String,

sseudam-core/core-domain/src/main/kotlin/com/sseudam/user/UserEventListener.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class UserEventListener(
1818
private val discordClient: DiscordClient,
1919
) {
2020
@ApplicationModuleListener(condition = "#event.userId != null")
21-
fun onCreatePetListener(event: UserCreatedEvent) {
21+
fun onCreatePetListener(event: UserSignUpEvent) {
2222
val (currentYear, currentMonth) = LocalDate.now().let { it.year to it.month }
2323

2424
val pets = petReader.readAllLatestSeasonPets(currentYear, currentMonth)
@@ -29,7 +29,7 @@ class UserEventListener(
2929
}
3030

3131
@ApplicationModuleListener(condition = "#event.userId != null")
32-
fun onDiscordNotificationListener(event: UserCreatedEvent) {
32+
fun onDiscordNotificationListener(event: UserSignUpEvent) {
3333
val userProfile =
3434
userReader.readUserProfile(event.userId)
3535
?: throw ErrorException(ErrorType.NOT_FOUND_USER)

0 commit comments

Comments
 (0)