Skip to content

Commit

Permalink
[REFACTOR]: 폴더 구조 및 코드 위치 변경 (#81)
Browse files Browse the repository at this point in the history
  • Loading branch information
sejineer authored Aug 15, 2024
1 parent c941ff9 commit 7b2d405
Show file tree
Hide file tree
Showing 105 changed files with 519 additions and 514 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,15 @@ import com.amazonaws.services.iot.client.AWSIotQos
import com.amazonaws.services.iot.client.AWSIotTopic
import com.fasterxml.jackson.databind.JsonNode
import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
import com.myongjiway.buslocation.BusLocation
import com.myongjiway.buslocation.BusLocationService
import com.myongjiway.clientmqtt.util.AwsIotUtil
import com.myongjiway.core.domain.buslocation.BusLocation
import org.springframework.beans.factory.annotation.Value
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration

@Configuration
class MqttClientConfig(
private val busLocationService: BusLocationService,
private val busLocationService: com.myongjiway.core.domain.buslocation.BusLocationService,

This comment has been minimized.

Copy link
@sejineer

sejineer Aug 15, 2024

Author Contributor

수정 필요

) {

@Value("\${aws.iot.endpoint}")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package com.myongjiway.core.auth.controller
package com.myongjiway.core.api.auth.controller

import com.myongjiway.core.api.auth.controller.v1.request.KakaoLoginRequest
import com.myongjiway.core.api.auth.security.domain.AuthService
import com.myongjiway.core.api.controller.v1.request.RefreshRequest
import com.myongjiway.core.api.support.response.ApiResponse
import com.myongjiway.core.auth.controller.v1.request.KakaoLoginRequest
import com.myongjiway.core.auth.security.domain.AuthService
import com.myongjiway.token.RefreshData
import com.myongjiway.token.TokenService
import com.myongjiway.core.domain.token.RefreshData
import com.myongjiway.core.domain.token.TokenService
import jakarta.validation.Valid
import org.springframework.web.bind.annotation.DeleteMapping
import org.springframework.web.bind.annotation.PostMapping
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.myongjiway.core.auth.controller
package com.myongjiway.core.api.auth.controller

import com.myongjiway.core.api.support.response.ApiResponse
import org.springframework.web.bind.annotation.GetMapping
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.myongjiway.core.auth.controller.v1.request
package com.myongjiway.core.api.auth.controller.v1.request

import com.myongjiway.core.auth.security.domain.KakaoLoginData
import com.myongjiway.core.api.auth.security.domain.KakaoLoginData
import jakarta.validation.constraints.NotBlank
import jakarta.validation.constraints.NotNull

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.myongjiway.core.auth.security.config
package com.myongjiway.core.api.auth.security.config

import com.myongjiway.core.auth.security.domain.JwtValidator
import com.myongjiway.core.auth.security.jwt.JwtAuthenticationFilter
import com.myongjiway.core.api.auth.security.domain.JwtValidator
import com.myongjiway.core.api.auth.security.jwt.JwtAuthenticationFilter
import org.springframework.context.annotation.Configuration
import org.springframework.security.config.annotation.SecurityConfigurerAdapter
import org.springframework.security.config.annotation.web.builders.HttpSecurity
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.myongjiway.core.auth.security.config
package com.myongjiway.core.api.auth.security.config

import com.myongjiway.core.auth.security.jwt.JwtAccessDeniedHandler
import com.myongjiway.core.auth.security.jwt.JwtAuthenticationEntryPoint
import com.myongjiway.core.auth.security.jwt.JwtAuthenticationFilter
import com.myongjiway.core.api.auth.security.jwt.JwtAccessDeniedHandler
import com.myongjiway.core.api.auth.security.jwt.JwtAuthenticationEntryPoint
import com.myongjiway.core.api.auth.security.jwt.JwtAuthenticationFilter
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration
import org.springframework.security.config.Customizer
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package com.myongjiway.core.auth.security.domain
package com.myongjiway.core.api.auth.security.domain

import com.myongjiway.token.RefreshData
import com.myongjiway.token.TokenAppender
import com.myongjiway.token.TokenGenerator
import com.myongjiway.token.TokenResult
import com.myongjiway.user.ProviderType
import com.myongjiway.user.Role
import com.myongjiway.user.UserAppender
import com.myongjiway.core.domain.token.RefreshData
import com.myongjiway.core.domain.token.TokenAppender
import com.myongjiway.core.domain.token.TokenGenerator
import com.myongjiway.core.domain.token.TokenResult
import com.myongjiway.core.domain.user.ProviderType
import com.myongjiway.core.domain.user.Role
import com.myongjiway.core.domain.user.UserAppender
import org.springframework.stereotype.Service

@Service
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
@file:Suppress("ktlint:standard:no-wildcard-imports")

package com.myongjiway.core.auth.security.domain
package com.myongjiway.core.api.auth.security.domain

import com.myongjiway.core.api.support.error.CoreApiException
import com.myongjiway.core.api.support.error.ErrorType
import com.myongjiway.token.JwtProperty
import com.myongjiway.user.UserRepository
import com.myongjiway.core.domain.token.JwtProperty
import com.myongjiway.core.domain.user.UserRepository
import io.jsonwebtoken.ExpiredJwtException
import io.jsonwebtoken.Jwts
import io.jsonwebtoken.MalformedJwtException
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.myongjiway.core.auth.security.domain
package com.myongjiway.core.api.auth.security.domain

data class KakaoLoginData(
val providerId: String,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.myongjiway.core.auth.security.jwt
package com.myongjiway.core.api.auth.security.jwt

import com.myongjiway.core.api.support.error.ErrorType
import jakarta.servlet.http.HttpServletRequest
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.myongjiway.core.auth.security.jwt
package com.myongjiway.core.api.auth.security.jwt

import com.myongjiway.core.api.support.error.ErrorType
import jakarta.servlet.http.HttpServletRequest
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.myongjiway.core.auth.security.jwt
package com.myongjiway.core.api.auth.security.jwt

import com.myongjiway.core.auth.security.domain.JwtValidator
import com.myongjiway.core.api.auth.security.domain.JwtValidator
import jakarta.servlet.FilterChain
import jakarta.servlet.http.HttpServletRequest
import jakarta.servlet.http.HttpServletResponse
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.myongjiway.core.auth.security.log
package com.myongjiway.core.api.auth.security.log

import jakarta.servlet.FilterChain
import jakarta.servlet.http.HttpServletRequest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package com.myongjiway.core.api.controller
import com.myongjiway.core.api.support.error.CoreApiException
import com.myongjiway.core.api.support.error.ErrorType
import com.myongjiway.core.api.support.response.ApiResponse
import com.myongjiway.error.CoreException
import com.myongjiway.core.domain.error.CoreException
import org.slf4j.Logger
import org.slf4j.LoggerFactory
import org.springframework.boot.logging.LogLevel
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package com.myongjiway.core.buslocation.controller.v1
package com.myongjiway.core.api.controller

import com.myongjiway.buslocation.BusLocationService
import com.myongjiway.core.api.controller.v1.response.GetBusLocationRes
import com.myongjiway.core.api.support.response.ApiResponse
import com.myongjiway.core.buslocation.controller.v1.response.GetBusLocationRes
import com.myongjiway.core.domain.buslocation.BusLocationService
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RestController

@RequestMapping("api/v1/bus-location")
@RequestMapping("api/v1/bus-locations")
@RestController
class BusLocationController(
private var busLocationService: BusLocationService,
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package com.myongjiway.core.notice.controller
package com.myongjiway.core.api.controller

import com.myongjiway.core.api.controller.v1.request.NoticeRequest
import com.myongjiway.core.api.controller.v1.response.NoticeResponse
import com.myongjiway.core.api.support.error.CoreApiException
import com.myongjiway.core.api.support.error.ErrorType
import com.myongjiway.core.api.support.response.ApiResponse
import com.myongjiway.core.notice.controller.v1.request.NoticeRequest
import com.myongjiway.core.notice.controller.v1.response.NoticeResponse
import com.myongjiway.notice.NoticeService
import com.myongjiway.user.Role
import com.myongjiway.user.User
import com.myongjiway.core.domain.notice.NoticeService
import com.myongjiway.core.domain.user.Role
import com.myongjiway.core.domain.user.User
import org.slf4j.LoggerFactory
import org.springframework.security.core.annotation.AuthenticationPrincipal
import org.springframework.web.bind.annotation.DeleteMapping
Expand All @@ -19,36 +19,36 @@ import org.springframework.web.bind.annotation.RequestBody
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RestController

@RequestMapping("/api/v1/notices")
@RestController
@RequestMapping("/api/v1")
class NoticeController(
private val noticeService: NoticeService,
) {
@PostMapping("/domain/notices")
@PostMapping
fun createNotice(@RequestBody noticeRequest: NoticeRequest, @AuthenticationPrincipal user: User): ApiResponse<Any> {
authenticate(user)
noticeService.createNotice(noticeRequest.toNotice())
return ApiResponse.success()
}

@PutMapping("/domain/notices/{noticeId}")
@PutMapping("/{noticeId}")
fun updateNotice(@PathVariable noticeId: Long, @RequestBody noticeRequest: NoticeRequest, @AuthenticationPrincipal user: User): ApiResponse<Any> {
authenticate(user)
noticeService.updateNotice(noticeRequest.toNotice(), noticeId)
return ApiResponse.success()
}

@DeleteMapping("/domain/notices/{noticeId}")
@DeleteMapping("/{noticeId}")
fun deleteNotice(@PathVariable noticeId: Long, @AuthenticationPrincipal user: User): ApiResponse<Any> {
authenticate(user)
noticeService.deleteNotice(noticeId)
return ApiResponse.success()
}

@GetMapping("/notices/{noticeId}")
@GetMapping("/{noticeId}")
fun getNotice(@PathVariable noticeId: Long, @AuthenticationPrincipal user: User): ApiResponse<NoticeResponse> = ApiResponse.success(NoticeResponse.of(noticeService.getNotice(noticeId, user.id!!)))

@GetMapping("/notices/all")
@GetMapping
fun getAllNotices(@AuthenticationPrincipal user: User): ApiResponse<List<NoticeResponse>> = ApiResponse.success(noticeService.getNotices(user.id!!).map { NoticeResponse.of(it) })

private fun authenticate(user: User) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package com.myongjiway.core.api.controller
import com.myongjiway.client.kakao.KakaoClient
import com.myongjiway.core.api.controller.v1.response.UserInactiveResponseDto
import com.myongjiway.core.api.support.response.ApiResponse
import com.myongjiway.user.User
import com.myongjiway.user.UserService
import com.myongjiway.core.domain.user.User
import com.myongjiway.core.domain.user.UserService
import org.springframework.security.core.annotation.AuthenticationPrincipal
import org.springframework.web.bind.annotation.PatchMapping
import org.springframework.web.bind.annotation.RequestMapping
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.myongjiway.core.notice.controller.v1.request
package com.myongjiway.core.api.controller.v1.request

import com.myongjiway.notice.Notice
import com.myongjiway.core.domain.notice.Notice

data class NoticeRequest(
val title: String,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.myongjiway.core.notice.controller.v1.request
package com.myongjiway.core.api.controller.v1.request

object NoticeValidator {
const val MAX_TITLE_LENGTH = 100
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.myongjiway.core.buslocation.controller.v1.response
package com.myongjiway.core.api.controller.v1.response

import com.myongjiway.buslocation.BusLocation
import com.myongjiway.core.domain.buslocation.BusLocation

data class GetBusLocationRes(
val busId: String,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.myongjiway.core.notice.controller.v1.response
package com.myongjiway.core.api.controller.v1.response

import com.myongjiway.notice.Notice
import com.myongjiway.core.domain.notice.Notice
import java.time.LocalDate

data class NoticeResponse(
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.myongjiway.core.api.support.error

import com.myongjiway.error.CoreErrorType
import com.myongjiway.core.domain.error.CoreErrorType

data class ErrorMessage private constructor(
val code: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package com.myongjiway.core.api.support.response

import com.myongjiway.core.api.support.error.ErrorMessage
import com.myongjiway.core.api.support.error.ErrorType
import com.myongjiway.error.CoreErrorType
import com.myongjiway.core.domain.error.CoreErrorType

data class ApiResponse<T> private constructor(
val result: ResultType,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.myongjiway
package com.myongjiway.core.api

import org.junit.jupiter.api.Tag
import org.springframework.boot.test.context.SpringBootTest
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.myongjiway
package com.myongjiway.core.api

import org.junit.jupiter.api.Tag
import org.springframework.boot.test.context.SpringBootTest
Expand Down
Loading

0 comments on commit 7b2d405

Please sign in to comment.