-
Notifications
You must be signed in to change notification settings - Fork 3
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
[SPS-121] 어드민 API 추가 #114
[SPS-121] 어드민 API 추가 #114
Conversation
- 기본 session 사용
덜덜덜덜덜 |
@ConfigurationProperties(prefix = "kakao.map") | ||
data class KakaoMapProperties( | ||
val restApiKey: String, | ||
val localSearchBaseUrl: String | ||
) |
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.
얘는 왜 global-utils
로 갔나요?? 단순 궁금 포인트
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.
admin 모듈에서 프로퍼티를 사용하게 되는데, admin -> domain <- infra
이러한 의존성을 갖도록 설계할 때 옮겼었는데.. 아래 리뷰해주신 부분 바탕으로 의존 방향을 수정 하려고 합니다..
@Component | ||
class CragAdminAdapter( | ||
private val cragMapper: CragMapper, | ||
private val cragJpaRepository: CragJpaRepository | ||
) : CragAdminRepository { | ||
|
||
override fun save(crag: Crag): Crag { | ||
val entity = cragJpaRepository.save(cragMapper.toEntity(crag)) | ||
return cragMapper.toDomain(entity) | ||
} | ||
|
||
override fun findById(id: Long): Crag? { | ||
val entity = cragJpaRepository.findByIdOrNull(id) | ||
return cragMapper.toDomain(entity!!) | ||
} | ||
|
||
override fun findAll(): List<Crag> { | ||
return cragJpaRepository.findAll().map { cragMapper.toDomain(it) } | ||
} | ||
} |
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.
AdminAdapter
가 따로 분리된 이유가 궁금해요!
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.
어짜피 domain 계층을 공유하니, 기존 repository를 같이 쓰면 되는거 아닌가 싶어서요!
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.
api 머듈에서 사용하지 않는 admin의 연산을 포함하는 것, 그 반대의 경우도 모두 불필요한 경우라고 생각했습니다.. 어쩌면 휴먼 에러를 일으킬 수 있는..
|
||
@Service | ||
class AdminUserDetailsService( | ||
private val userRepository: UserRepository |
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.
어드민 유저 따로 분리해야 합니다...!!!
서비스 유저가 어드민에 접근하면 큰일나죠..!!!!
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.
admin_user 테이블 만들고, 저희가 지정한 id와 비밀번호로 가입하게 함으로써
기존 서비스의 유저 시스템과 완전히 분리해야 해요..!!!!
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.
알겠습니다!!
jwt: | ||
secret: ${JWT_SECRET} | ||
access-token-expiration-millis: 3600000 | ||
refresh-token-expiration-millis: 604800000 No newline at end of file | ||
refresh-token-expiration-millis: 604800000 |
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.
jwt 지워도 됩니다!
@@ -1,6 +1,7 @@ | |||
dependencies { | |||
implementation(project(":clog-global-utils")) | |||
implementation(project(":clog-domain")) | |||
implementation(project(":clog-admin")) |
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.
AdminRepository
때문에 의존성을 가지는 것 같아요.
AdminRepository
를 없애거나, AdminRepository
도 domain
계층에 만들면 될 것 같아요.
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.
옿 죠습니다~
val longitude: String = "", | ||
val latitude: String = "", |
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.
Double로 안받고 String으로 받아 서비스 레이어에서 변환해주는 이유가 따로 있을까요..?
그리고 default가 다 ""로 입력되어 있는데, 밸리데이션을 세팅해서 Blank면 400 떨어지도록 하는게 좋을 것 같아용.
name이나 roadAddress가 빈 스트링인 경우가 존재하면 안되니 말이죠..
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.
이 부분은 고려해서 다시 수정해 보도록 하겠습니다..
import org.springframework.transaction.annotation.Transactional | ||
|
||
@Service | ||
class AdminService( |
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.
이 서비스는 300kg 쯤 되보입니다..
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.
3t 맞습니다.. 우선 이대로 가는건 어떠실까요..
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.
수고하셨습니다!
변경 유형
변경 사항
관련링크 (JIRA, Github, etc)