diff --git a/src/main/kotlin/co/bearus/magcloud/config/filter/ApplicationFilter.kt b/src/main/kotlin/co/bearus/magcloud/config/filter/ApplicationFilter.kt index 9c15cb1..e62df2d 100644 --- a/src/main/kotlin/co/bearus/magcloud/config/filter/ApplicationFilter.kt +++ b/src/main/kotlin/co/bearus/magcloud/config/filter/ApplicationFilter.kt @@ -1,7 +1,6 @@ package co.bearus.magcloud.config.filter import co.bearus.magcloud.controller.dto.response.ErrorResponse -import co.bearus.magcloud.domain.exception.DomainException import co.bearus.magcloud.domain.exception.ErrorCode import co.bearus.magcloud.domain.service.AppInfoService import co.bearus.magcloud.domain.type.ContextLanguage @@ -46,10 +45,12 @@ class ApplicationFilter( response.contentType = MediaType.APPLICATION_JSON_VALUE response.outputStream.use { os -> - objectMapper.writeValue(os, ErrorResponse( + objectMapper.writeValue( + os, ErrorResponse( code = ErrorCode.APP_VERSION_EXCEPTION.code, message = ErrorCode.APP_VERSION_EXCEPTION.message[language] ?: "", - )) + ) + ) os.flush() } } diff --git a/src/main/kotlin/co/bearus/magcloud/config/filter/RequestInterceptor.kt b/src/main/kotlin/co/bearus/magcloud/config/filter/RequestInterceptor.kt index d3972b2..0b557b5 100644 --- a/src/main/kotlin/co/bearus/magcloud/config/filter/RequestInterceptor.kt +++ b/src/main/kotlin/co/bearus/magcloud/config/filter/RequestInterceptor.kt @@ -1,6 +1,5 @@ package co.bearus.magcloud.config.filter -import co.bearus.magcloud.domain.service.AppInfoService import jakarta.servlet.http.HttpServletRequest import jakarta.servlet.http.HttpServletResponse import org.slf4j.LoggerFactory @@ -8,7 +7,7 @@ import org.springframework.stereotype.Component import org.springframework.web.servlet.HandlerInterceptor @Component -class RequestInterceptor: HandlerInterceptor { +class RequestInterceptor : HandlerInterceptor { companion object { const val START_TIME_ATTR_NAME = "startTime" diff --git a/src/main/kotlin/co/bearus/magcloud/controller/AuthController.kt b/src/main/kotlin/co/bearus/magcloud/controller/AuthController.kt index 59944d4..49d0fe9 100644 --- a/src/main/kotlin/co/bearus/magcloud/controller/AuthController.kt +++ b/src/main/kotlin/co/bearus/magcloud/controller/AuthController.kt @@ -3,7 +3,6 @@ package co.bearus.magcloud.controller import co.bearus.magcloud.controller.dto.request.RefreshTokenRequestDTO import co.bearus.magcloud.controller.dto.request.SocialLoginDTO import co.bearus.magcloud.controller.dto.response.LoginResponseDTO -import co.bearus.magcloud.domain.exception.DomainException import co.bearus.magcloud.domain.exception.ValidationException import co.bearus.magcloud.domain.service.user.UserService import co.bearus.magcloud.domain.service.user.social.* diff --git a/src/main/kotlin/co/bearus/magcloud/controller/DiaryCommentController.kt b/src/main/kotlin/co/bearus/magcloud/controller/DiaryCommentController.kt index bd9b4d6..a0d3b4d 100644 --- a/src/main/kotlin/co/bearus/magcloud/controller/DiaryCommentController.kt +++ b/src/main/kotlin/co/bearus/magcloud/controller/DiaryCommentController.kt @@ -16,13 +16,7 @@ import co.bearus.magcloud.domain.type.ContextLanguage import co.bearus.magcloud.util.ULIDUtils import org.springframework.data.repository.findByIdOrNull import org.springframework.transaction.annotation.Transactional -import org.springframework.web.bind.annotation.DeleteMapping -import org.springframework.web.bind.annotation.GetMapping -import org.springframework.web.bind.annotation.PathVariable -import org.springframework.web.bind.annotation.PostMapping -import org.springframework.web.bind.annotation.RequestBody -import org.springframework.web.bind.annotation.RequestMapping -import org.springframework.web.bind.annotation.RestController +import org.springframework.web.bind.annotation.* @RestController @RequestMapping("/v1/diaries/{diaryId}/comments") diff --git a/src/main/kotlin/co/bearus/magcloud/controller/FriendController.kt b/src/main/kotlin/co/bearus/magcloud/controller/FriendController.kt index 2534e4f..d7b77b3 100644 --- a/src/main/kotlin/co/bearus/magcloud/controller/FriendController.kt +++ b/src/main/kotlin/co/bearus/magcloud/controller/FriendController.kt @@ -13,12 +13,7 @@ import co.bearus.magcloud.domain.service.notification.NotificationService import co.bearus.magcloud.domain.service.user.UserService import co.bearus.magcloud.domain.type.ContextLanguage import co.bearus.magcloud.domain.type.NotificationType -import org.springframework.web.bind.annotation.GetMapping -import org.springframework.web.bind.annotation.PatchMapping -import org.springframework.web.bind.annotation.PostMapping -import org.springframework.web.bind.annotation.RequestBody -import org.springframework.web.bind.annotation.RequestMapping -import org.springframework.web.bind.annotation.RestController +import org.springframework.web.bind.annotation.* @RestController @RequestMapping("/v1/users/friends") diff --git a/src/main/kotlin/co/bearus/magcloud/controller/FriendDiaryController.kt b/src/main/kotlin/co/bearus/magcloud/controller/FriendDiaryController.kt index 10b30c3..79aa46f 100644 --- a/src/main/kotlin/co/bearus/magcloud/controller/FriendDiaryController.kt +++ b/src/main/kotlin/co/bearus/magcloud/controller/FriendDiaryController.kt @@ -5,16 +5,11 @@ import co.bearus.magcloud.advice.WebUser import co.bearus.magcloud.controller.dto.response.DiaryResponseDTO import co.bearus.magcloud.domain.exception.DiaryNotExistsException import co.bearus.magcloud.domain.exception.IntegrityViolationException -import co.bearus.magcloud.domain.exception.ValidationException import co.bearus.magcloud.domain.service.diary.UserDiaryService import co.bearus.magcloud.domain.service.friend.FriendService import org.springframework.format.annotation.DateTimeFormat import org.springframework.http.ResponseEntity -import org.springframework.web.bind.annotation.GetMapping -import org.springframework.web.bind.annotation.PathVariable -import org.springframework.web.bind.annotation.RequestMapping -import org.springframework.web.bind.annotation.RequestParam -import org.springframework.web.bind.annotation.RestController +import org.springframework.web.bind.annotation.* import java.time.LocalDate @RestController diff --git a/src/main/kotlin/co/bearus/magcloud/controller/UserController.kt b/src/main/kotlin/co/bearus/magcloud/controller/UserController.kt index ab368a6..11d3341 100644 --- a/src/main/kotlin/co/bearus/magcloud/controller/UserController.kt +++ b/src/main/kotlin/co/bearus/magcloud/controller/UserController.kt @@ -49,7 +49,7 @@ class UserController( @PostMapping("/me/profile-image") fun updateProfileImage( @RequestUser user: WebUser, - @RequestBody request: ProfileImageUpdateRequest + @RequestBody request: ProfileImageUpdateRequest, ) { userProfileImageService.changeProfileImage( userId = user.userId, @@ -60,7 +60,7 @@ class UserController( @PostMapping("/me/name") fun updateName( @RequestUser user: WebUser, - @RequestBody request: ChangeNameRequest + @RequestBody request: ChangeNameRequest, ): UserDTO { if (request.name.length > 12) throw UserNameTooLongException() return userService.changeName( diff --git a/src/main/kotlin/co/bearus/magcloud/controller/UserDeviceController.kt b/src/main/kotlin/co/bearus/magcloud/controller/UserDeviceController.kt index 0332e5a..63d5a46 100644 --- a/src/main/kotlin/co/bearus/magcloud/controller/UserDeviceController.kt +++ b/src/main/kotlin/co/bearus/magcloud/controller/UserDeviceController.kt @@ -7,11 +7,7 @@ import co.bearus.magcloud.controller.dto.response.APIResponse import co.bearus.magcloud.domain.service.notification.NotificationService import co.bearus.magcloud.domain.service.notification.UserDeviceService import org.springframework.http.ResponseEntity -import org.springframework.web.bind.annotation.DeleteMapping -import org.springframework.web.bind.annotation.PostMapping -import org.springframework.web.bind.annotation.RequestBody -import org.springframework.web.bind.annotation.RequestMapping -import org.springframework.web.bind.annotation.RestController +import org.springframework.web.bind.annotation.* @RestController @RequestMapping("/v1/users/device") @@ -36,9 +32,4 @@ class UserDeviceController( this.userDeviceService.registerDevice(user.userId, deviceRegisterDTO) return ResponseEntity.ok(APIResponse.ok("삭제 성공")) } - - @PostMapping("/noti") - fun sendNoti() { - notificationService.broadcastMessage("asdf", "bsdef") - } } diff --git a/src/main/kotlin/co/bearus/magcloud/controller/dto/response/APIResponse.kt b/src/main/kotlin/co/bearus/magcloud/controller/dto/response/APIResponse.kt index 22e6777..a12d4ff 100644 --- a/src/main/kotlin/co/bearus/magcloud/controller/dto/response/APIResponse.kt +++ b/src/main/kotlin/co/bearus/magcloud/controller/dto/response/APIResponse.kt @@ -7,12 +7,13 @@ import com.fasterxml.jackson.annotation.JsonInclude @JsonInclude(JsonInclude.Include.NON_NULL) data class APIResponse( val success: Boolean, - val message: String + val message: String, ) { companion object { fun ok(message: String) = APIResponse(true, message) fun error(message: String) = APIResponse(false, message) fun ok(language: ContextLanguage, message: ResponseMessage) = APIResponse(true, message.message[language] ?: "") - fun error(language: ContextLanguage, message: ResponseMessage) = APIResponse(false, message.message[language] ?: "") + fun error(language: ContextLanguage, message: ResponseMessage) = + APIResponse(false, message.message[language] ?: "") } } diff --git a/src/main/kotlin/co/bearus/magcloud/domain/entity/AppInfoEntity.kt b/src/main/kotlin/co/bearus/magcloud/domain/entity/AppInfoEntity.kt index 9376e6c..66cd39a 100644 --- a/src/main/kotlin/co/bearus/magcloud/domain/entity/AppInfoEntity.kt +++ b/src/main/kotlin/co/bearus/magcloud/domain/entity/AppInfoEntity.kt @@ -1,6 +1,8 @@ package co.bearus.magcloud.domain.entity -import jakarta.persistence.* +import jakarta.persistence.Column +import jakarta.persistence.Entity +import jakarta.persistence.Id import java.io.Serializable @Entity(name = "app_info") diff --git a/src/main/kotlin/co/bearus/magcloud/domain/entity/diary/DiaryLikeEntity.kt b/src/main/kotlin/co/bearus/magcloud/domain/entity/diary/DiaryLikeEntity.kt index 5994c1e..966bef3 100644 --- a/src/main/kotlin/co/bearus/magcloud/domain/entity/diary/DiaryLikeEntity.kt +++ b/src/main/kotlin/co/bearus/magcloud/domain/entity/diary/DiaryLikeEntity.kt @@ -6,7 +6,6 @@ import jakarta.persistence.Entity import jakarta.persistence.Id import jakarta.persistence.IdClass import java.io.Serializable -import java.time.LocalDate @IdClass(DiaryLikeEntityKey::class) @Entity(name = "diary_like") diff --git a/src/main/kotlin/co/bearus/magcloud/domain/entity/diary/DiaryLikeEntityKey.kt b/src/main/kotlin/co/bearus/magcloud/domain/entity/diary/DiaryLikeEntityKey.kt index 6fd7f99..46c7c9a 100644 --- a/src/main/kotlin/co/bearus/magcloud/domain/entity/diary/DiaryLikeEntityKey.kt +++ b/src/main/kotlin/co/bearus/magcloud/domain/entity/diary/DiaryLikeEntityKey.kt @@ -1,7 +1,6 @@ package co.bearus.magcloud.domain.entity.diary import java.io.Serializable -import java.time.LocalDate class DiaryLikeEntityKey( val diaryId: String = "", diff --git a/src/main/kotlin/co/bearus/magcloud/domain/entity/user/UserNotificationConfigEntity.kt b/src/main/kotlin/co/bearus/magcloud/domain/entity/user/UserNotificationConfigEntity.kt index 2c66527..d78e2e4 100644 --- a/src/main/kotlin/co/bearus/magcloud/domain/entity/user/UserNotificationConfigEntity.kt +++ b/src/main/kotlin/co/bearus/magcloud/domain/entity/user/UserNotificationConfigEntity.kt @@ -1,7 +1,9 @@ package co.bearus.magcloud.domain.entity.user import co.bearus.magcloud.domain.entity.BaseAuditEntity -import jakarta.persistence.* +import jakarta.persistence.Column +import jakarta.persistence.Entity +import jakarta.persistence.Id import java.io.Serializable @Entity(name = "user_notification_config") diff --git a/src/main/kotlin/co/bearus/magcloud/domain/exception/DomainException.kt b/src/main/kotlin/co/bearus/magcloud/domain/exception/DomainException.kt index a181f0e..429dea4 100644 --- a/src/main/kotlin/co/bearus/magcloud/domain/exception/DomainException.kt +++ b/src/main/kotlin/co/bearus/magcloud/domain/exception/DomainException.kt @@ -1,7 +1,7 @@ package co.bearus.magcloud.domain.exception open class DomainException( - val errorCode: ErrorCode + val errorCode: ErrorCode, ) : RuntimeException() open class NotFoundDomainException : DomainException( diff --git a/src/main/kotlin/co/bearus/magcloud/domain/exception/ErrorCode.kt b/src/main/kotlin/co/bearus/magcloud/domain/exception/ErrorCode.kt index 97308b6..44fd6e4 100644 --- a/src/main/kotlin/co/bearus/magcloud/domain/exception/ErrorCode.kt +++ b/src/main/kotlin/co/bearus/magcloud/domain/exception/ErrorCode.kt @@ -20,7 +20,10 @@ enum class ErrorCode( USER_NICKNAME_TOO_LONG("UE0002", simpleMessage("닉네임은 12자 이하로 입력해주세요", "Nickname must be less than 12 characters")), DIARY_NOT_FOUND("DE0001", simpleMessage("다이어리를 찾을 수 없습니다", "Diary not found")), - CANNOT_UPDATE_MORE_THAN_TWO_DAYS("DE0002", simpleMessage("2일 이상 지난 일기는 편집할 수 없어요", "Cannot edit diary older than 2 days")), + CANNOT_UPDATE_MORE_THAN_TWO_DAYS( + "DE0002", + simpleMessage("2일 이상 지난 일기는 편집할 수 없어요", "Cannot edit diary older than 2 days") + ), ALREADY_FRIEND("FE0001", simpleMessage("이미 친구입니다", "Already friend")), ALREADY_FRIEND_REQUESTED("FE0002", simpleMessage("이미 친구 요청을 보냈습니다", "Already friend requested")), diff --git a/src/main/kotlin/co/bearus/magcloud/domain/projection/DailyUserProjection.kt b/src/main/kotlin/co/bearus/magcloud/domain/projection/DailyUserProjection.kt index 5a73f42..3bb32aa 100644 --- a/src/main/kotlin/co/bearus/magcloud/domain/projection/DailyUserProjection.kt +++ b/src/main/kotlin/co/bearus/magcloud/domain/projection/DailyUserProjection.kt @@ -19,7 +19,7 @@ data class DailyUserProjection @QueryProjection constructor( name = name, nameTag = "${name}#${tag}", profileImageUrl = profileImageUrl, - emotion = if(emotion == null || !isDiaryAllowed) "unselected" else emotion, + emotion = if (emotion == null || !isDiaryAllowed) "unselected" else emotion, updatedAtTs = updatedAt?.toEpochMillis() ?: 0L, ) } diff --git a/src/main/kotlin/co/bearus/magcloud/domain/projection/DiaryCommentProjection.kt b/src/main/kotlin/co/bearus/magcloud/domain/projection/DiaryCommentProjection.kt index bccc1b9..c430f90 100644 --- a/src/main/kotlin/co/bearus/magcloud/domain/projection/DiaryCommentProjection.kt +++ b/src/main/kotlin/co/bearus/magcloud/domain/projection/DiaryCommentProjection.kt @@ -1,7 +1,6 @@ package co.bearus.magcloud.domain.projection import co.bearus.magcloud.controller.dto.request.DiaryCommentDTO -import co.bearus.magcloud.controller.dto.response.DailyUserDTO import co.bearus.magcloud.util.DateUtils.Companion.toEpochMillis import com.querydsl.core.annotations.QueryProjection import java.time.LocalDateTime diff --git a/src/main/kotlin/co/bearus/magcloud/domain/projection/YearlyEmotionProjection.kt b/src/main/kotlin/co/bearus/magcloud/domain/projection/YearlyEmotionProjection.kt index 3e0b5c3..2f06ab7 100644 --- a/src/main/kotlin/co/bearus/magcloud/domain/projection/YearlyEmotionProjection.kt +++ b/src/main/kotlin/co/bearus/magcloud/domain/projection/YearlyEmotionProjection.kt @@ -1,7 +1,6 @@ package co.bearus.magcloud.domain.projection import com.querydsl.core.annotations.QueryProjection -import java.time.LocalDate data class YearlyEmotionProjection @QueryProjection constructor( val month: Int, diff --git a/src/main/kotlin/co/bearus/magcloud/domain/repository/JPADiaryCommentRepository.kt b/src/main/kotlin/co/bearus/magcloud/domain/repository/JPADiaryCommentRepository.kt index a563423..f787245 100644 --- a/src/main/kotlin/co/bearus/magcloud/domain/repository/JPADiaryCommentRepository.kt +++ b/src/main/kotlin/co/bearus/magcloud/domain/repository/JPADiaryCommentRepository.kt @@ -3,6 +3,6 @@ package co.bearus.magcloud.domain.repository import co.bearus.magcloud.domain.entity.diary.DiaryCommentEntity import org.springframework.data.jpa.repository.JpaRepository -interface JPADiaryCommentRepository: JpaRepository { +interface JPADiaryCommentRepository : JpaRepository { fun findAllByDiaryId(diaryId: String): List } diff --git a/src/main/kotlin/co/bearus/magcloud/domain/repository/QUserFeedRepository.kt b/src/main/kotlin/co/bearus/magcloud/domain/repository/QUserFeedRepository.kt index 5b5ee09..d2cac18 100644 --- a/src/main/kotlin/co/bearus/magcloud/domain/repository/QUserFeedRepository.kt +++ b/src/main/kotlin/co/bearus/magcloud/domain/repository/QUserFeedRepository.kt @@ -15,11 +15,12 @@ import org.springframework.stereotype.Repository class QUserFeedRepository( private val queryFactory: JPAQueryFactory, ) { - fun getFeedByDiaryId(diaryId: String, userId: String,): FeedProjection? { + fun getFeedByDiaryId(diaryId: String, userId: String): FeedProjection? { return queryFactory .selectFrom(diaryEntity) .leftJoin(userEntity).on(diaryEntity.userId.eq(userEntity.userId)) - .leftJoin(diaryLikeEntity).on(diaryEntity.diaryId.eq(diaryLikeEntity.diaryId).and(diaryLikeEntity.userId.eq(userId))) + .leftJoin(diaryLikeEntity) + .on(diaryEntity.diaryId.eq(diaryLikeEntity.diaryId).and(diaryLikeEntity.userId.eq(userId))) .leftJoin(diaryCommentEntity).on(diaryEntity.diaryId.eq(diaryCommentEntity.diaryId)) .where(diaryEntity.diaryId.eq(diaryId)) .select( @@ -64,7 +65,8 @@ class QUserFeedRepository( return queryFactory .selectFrom(diaryEntity) .leftJoin(userEntity).on(diaryEntity.userId.eq(userEntity.userId)) - .leftJoin(diaryLikeEntity).on(diaryEntity.diaryId.eq(diaryLikeEntity.diaryId).and(diaryLikeEntity.userId.eq(userId))) + .leftJoin(diaryLikeEntity) + .on(diaryEntity.diaryId.eq(diaryLikeEntity.diaryId).and(diaryLikeEntity.userId.eq(userId))) .leftJoin(diaryCommentEntity).on(diaryEntity.diaryId.eq(diaryCommentEntity.diaryId)) .where(predicate) .select( diff --git a/src/main/kotlin/co/bearus/magcloud/domain/repository/QUserFriendRepository.kt b/src/main/kotlin/co/bearus/magcloud/domain/repository/QUserFriendRepository.kt index 8bfa83a..7d41ca8 100644 --- a/src/main/kotlin/co/bearus/magcloud/domain/repository/QUserFriendRepository.kt +++ b/src/main/kotlin/co/bearus/magcloud/domain/repository/QUserFriendRepository.kt @@ -1,9 +1,9 @@ package co.bearus.magcloud.domain.repository -import co.bearus.magcloud.domain.entity.user.QUserEntity.Companion.userEntity import co.bearus.magcloud.domain.entity.diary.QDiaryEntity.Companion.diaryEntity import co.bearus.magcloud.domain.entity.friend.QFriendEntity.Companion.friendEntity import co.bearus.magcloud.domain.entity.friend.QFriendRequestEntity.Companion.friendRequestEntity +import co.bearus.magcloud.domain.entity.user.QUserEntity.Companion.userEntity import co.bearus.magcloud.domain.entity.user.QUserNotificationConfigEntity.Companion.userNotificationConfigEntity import co.bearus.magcloud.domain.projection.QDailyUserProjection import co.bearus.magcloud.domain.projection.QFriendUserProjection diff --git a/src/main/kotlin/co/bearus/magcloud/domain/service/diary/UserDiaryService.kt b/src/main/kotlin/co/bearus/magcloud/domain/service/diary/UserDiaryService.kt index 3642eb2..ee0e23f 100644 --- a/src/main/kotlin/co/bearus/magcloud/domain/service/diary/UserDiaryService.kt +++ b/src/main/kotlin/co/bearus/magcloud/domain/service/diary/UserDiaryService.kt @@ -98,7 +98,7 @@ class UserDiaryService( ) diary.likeCount = diaryLikeRepository.countByDiaryId(diaryId).toInt() - if(userId != diary.userId) notificationService.sendDiaryLikedNotification(diaryId) + if (userId != diary.userId) notificationService.sendDiaryLikedNotification(diaryId) return diaryRepository.save(diary).toDto() } return diary.toDto() diff --git a/src/main/kotlin/co/bearus/magcloud/domain/service/notification/NotificationService.kt b/src/main/kotlin/co/bearus/magcloud/domain/service/notification/NotificationService.kt index 95e2c16..282d91a 100644 --- a/src/main/kotlin/co/bearus/magcloud/domain/service/notification/NotificationService.kt +++ b/src/main/kotlin/co/bearus/magcloud/domain/service/notification/NotificationService.kt @@ -34,10 +34,6 @@ class NotificationService( FirebaseApp.initializeApp(options) } - fun broadcastMessage(title: String, description: String) { - this.sendMessageToTopic("all", title, description) - } - fun sendMessageToTopic(topic: String, title: String, description: String) { try { val message = Message.builder() @@ -80,7 +76,7 @@ class NotificationService( fun sendCommentCreateNotification(comment: DiaryCommentDTO) { val diary = diaryRepository.findByIdOrNull(comment.diaryId) ?: return val writer = userRepository.findByIdOrNull(comment.userId) ?: return - if(comment.userId != diary.userId) + if (comment.userId != diary.userId) sendMessageToUser( notificationType = NotificationType.SOCIAL, userId = diary.userId, @@ -112,7 +108,12 @@ class NotificationService( } @Async - fun sendMessageToUser(notificationType: NotificationType, userId: String, description: String, routePath: String = "") { + fun sendMessageToUser( + notificationType: NotificationType, + userId: String, + description: String, + routePath: String = "", + ) { val devices = userDeviceRepository.findAllByUserId(userId) if (devices.isEmpty()) return @@ -130,7 +131,9 @@ class NotificationService( .build() ) .addAllTokens(devices.map { it.deviceToken }) - .setApnsConfig(ApnsConfig.builder().setAps(Aps.builder().setSound("default").setContentAvailable(true).build()).build()) + .setApnsConfig( + ApnsConfig.builder().setAps(Aps.builder().setSound("default").setContentAvailable(true).build()).build() + ) .build() try { FirebaseMessaging.getInstance().sendMulticastAsync(message) diff --git a/src/main/kotlin/co/bearus/magcloud/domain/service/notification/UserDeviceService.kt b/src/main/kotlin/co/bearus/magcloud/domain/service/notification/UserDeviceService.kt index 2c67a59..812323a 100644 --- a/src/main/kotlin/co/bearus/magcloud/domain/service/notification/UserDeviceService.kt +++ b/src/main/kotlin/co/bearus/magcloud/domain/service/notification/UserDeviceService.kt @@ -1,10 +1,8 @@ package co.bearus.magcloud.domain.service.notification import co.bearus.magcloud.controller.dto.request.DeviceRegisterDTO -import co.bearus.magcloud.controller.dto.response.APIResponse import co.bearus.magcloud.domain.entity.user.UserDeviceEntity import co.bearus.magcloud.domain.entity.user.UserDeviceKey -import co.bearus.magcloud.domain.exception.DomainException import co.bearus.magcloud.domain.exception.UserNotFoundException import co.bearus.magcloud.domain.repository.JPAUserDeviceRepository import co.bearus.magcloud.domain.repository.JPAUserRepository diff --git a/src/main/kotlin/co/bearus/magcloud/domain/service/user/UserService.kt b/src/main/kotlin/co/bearus/magcloud/domain/service/user/UserService.kt index 0f49acf..e29c355 100644 --- a/src/main/kotlin/co/bearus/magcloud/domain/service/user/UserService.kt +++ b/src/main/kotlin/co/bearus/magcloud/domain/service/user/UserService.kt @@ -6,7 +6,6 @@ import co.bearus.magcloud.controller.dto.response.UserDTO import co.bearus.magcloud.domain.entity.user.UserEntity import co.bearus.magcloud.domain.entity.user.UserNotificationConfigEntity import co.bearus.magcloud.domain.entity.user.UserTokenEntity -import co.bearus.magcloud.domain.exception.DomainException import co.bearus.magcloud.domain.exception.TokenExpiredException import co.bearus.magcloud.domain.exception.UserNotFoundException import co.bearus.magcloud.domain.repository.* diff --git a/src/main/kotlin/co/bearus/magcloud/domain/service/user/social/AppleNativeProviderService.kt b/src/main/kotlin/co/bearus/magcloud/domain/service/user/social/AppleNativeProviderService.kt index af2db3e..176aed2 100644 --- a/src/main/kotlin/co/bearus/magcloud/domain/service/user/social/AppleNativeProviderService.kt +++ b/src/main/kotlin/co/bearus/magcloud/domain/service/user/social/AppleNativeProviderService.kt @@ -4,7 +4,6 @@ import co.bearus.magcloud.controller.dto.SocialInfoDTO import co.bearus.magcloud.controller.dto.request.SocialLoginDTO import co.bearus.magcloud.controller.dto.response.LoginResponseDTO import co.bearus.magcloud.domain.exception.AuthFailedException -import co.bearus.magcloud.domain.exception.DomainException import co.bearus.magcloud.domain.type.LoginProvider import co.bearus.magcloud.util.MockNickGenerator import com.fasterxml.jackson.databind.ObjectMapper diff --git a/src/main/kotlin/co/bearus/magcloud/domain/service/user/social/AppleProviderService.kt b/src/main/kotlin/co/bearus/magcloud/domain/service/user/social/AppleProviderService.kt index 18a9d59..e3f8a3b 100644 --- a/src/main/kotlin/co/bearus/magcloud/domain/service/user/social/AppleProviderService.kt +++ b/src/main/kotlin/co/bearus/magcloud/domain/service/user/social/AppleProviderService.kt @@ -1,6 +1,5 @@ package co.bearus.magcloud.domain.service.user.social -import co.bearus.magcloud.domain.exception.DomainException import co.bearus.magcloud.domain.type.LoginProvider import com.google.gson.Gson import io.jsonwebtoken.JwsHeader diff --git a/src/main/kotlin/co/bearus/magcloud/domain/service/user/social/GoogleNativeProviderService.kt b/src/main/kotlin/co/bearus/magcloud/domain/service/user/social/GoogleNativeProviderService.kt index faf1a17..5bc8c2e 100644 --- a/src/main/kotlin/co/bearus/magcloud/domain/service/user/social/GoogleNativeProviderService.kt +++ b/src/main/kotlin/co/bearus/magcloud/domain/service/user/social/GoogleNativeProviderService.kt @@ -4,7 +4,6 @@ import co.bearus.magcloud.controller.dto.SocialInfoDTO import co.bearus.magcloud.controller.dto.request.SocialLoginDTO import co.bearus.magcloud.controller.dto.response.LoginResponseDTO import co.bearus.magcloud.domain.exception.AuthFailedException -import co.bearus.magcloud.domain.exception.DomainException import co.bearus.magcloud.domain.type.LoginProvider import co.bearus.magcloud.util.MockNickGenerator import org.springframework.beans.factory.annotation.Qualifier diff --git a/src/main/kotlin/co/bearus/magcloud/domain/service/user/social/KakaoNativeProviderService.kt b/src/main/kotlin/co/bearus/magcloud/domain/service/user/social/KakaoNativeProviderService.kt index db294f1..6f98880 100644 --- a/src/main/kotlin/co/bearus/magcloud/domain/service/user/social/KakaoNativeProviderService.kt +++ b/src/main/kotlin/co/bearus/magcloud/domain/service/user/social/KakaoNativeProviderService.kt @@ -1,6 +1,5 @@ package co.bearus.magcloud.domain.service.user.social -import co.bearus.magcloud.domain.exception.DomainException import co.bearus.magcloud.domain.type.LoginProvider import com.google.gson.Gson import org.springframework.http.HttpEntity diff --git a/src/main/kotlin/co/bearus/magcloud/domain/service/user/social/KakaoProviderService.kt b/src/main/kotlin/co/bearus/magcloud/domain/service/user/social/KakaoProviderService.kt index 9ddbb86..551ce37 100644 --- a/src/main/kotlin/co/bearus/magcloud/domain/service/user/social/KakaoProviderService.kt +++ b/src/main/kotlin/co/bearus/magcloud/domain/service/user/social/KakaoProviderService.kt @@ -1,6 +1,5 @@ package co.bearus.magcloud.domain.service.user.social -import co.bearus.magcloud.domain.exception.DomainException import co.bearus.magcloud.domain.type.LoginProvider import com.fasterxml.jackson.databind.JsonNode import com.fasterxml.jackson.databind.ObjectMapper diff --git a/src/main/kotlin/co/bearus/magcloud/util/MockNickGenerator.kt b/src/main/kotlin/co/bearus/magcloud/util/MockNickGenerator.kt index 432a5c8..dd9e6bc 100644 --- a/src/main/kotlin/co/bearus/magcloud/util/MockNickGenerator.kt +++ b/src/main/kotlin/co/bearus/magcloud/util/MockNickGenerator.kt @@ -1,7 +1,7 @@ package co.bearus.magcloud.util object MockNickGenerator { - val prefix = listOf("멋있는", "맛있는", "대단한", "엄청난", "위대한", "행복한", "즐거운", "새로운") + val prefix = listOf("멋있는", "맛있는", "대단한", "엄청난", "위대한", "행복한", "즐거운", "새로운", "작은", "신기한", "재밌는") val suffix = listOf( "식사", "과일", @@ -29,7 +29,8 @@ object MockNickGenerator { "프로그래밍", "개발", "코딩", - "테스트" + "테스트", + "보안" ) fun generate() = "${prefix.random()}${suffix.random()}"