Skip to content
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

Merged
merged 11 commits into from
Mar 24, 2025

Conversation

big-cir
Copy link
Member

@big-cir big-cir commented Mar 22, 2025

변경 유형

  • 버그 수정
  • 새로운 기능
  • 리팩토링
  • 문서 업데이트

변경 사항

  • 관리자 API 추가 (암장 생성, 색상 생성, 난이도 생성 및 조회)

관련링크 (JIRA, Github, etc)

@big-cir big-cir self-assigned this Mar 22, 2025
@kkjsw17
Copy link
Collaborator

kkjsw17 commented Mar 23, 2025

덜덜덜덜덜

Comment on lines +5 to +9
@ConfigurationProperties(prefix = "kakao.map")
data class KakaoMapProperties(
val restApiKey: String,
val localSearchBaseUrl: String
)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

얘는 왜 global-utils로 갔나요?? 단순 궁금 포인트

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

admin 모듈에서 프로퍼티를 사용하게 되는데, admin -> domain <- infra 이러한 의존성을 갖도록 설계할 때 옮겼었는데.. 아래 리뷰해주신 부분 바탕으로 의존 방향을 수정 하려고 합니다..

Comment on lines +10 to +29
@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) }
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AdminAdapter가 따로 분리된 이유가 궁금해요!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

어짜피 domain 계층을 공유하니, 기존 repository를 같이 쓰면 되는거 아닌가 싶어서요!

Copy link
Member Author

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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

어드민 유저 따로 분리해야 합니다...!!!
서비스 유저가 어드민에 접근하면 큰일나죠..!!!!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

admin_user 테이블 만들고, 저희가 지정한 id와 비밀번호로 가입하게 함으로써
기존 서비스의 유저 시스템과 완전히 분리해야 해요..!!!!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

알겠습니다!!

Comment on lines 22 to 26
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
Copy link
Collaborator

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"))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AdminRepository때문에 의존성을 가지는 것 같아요.
AdminRepository를 없애거나, AdminRepositorydomain 계층에 만들면 될 것 같아요.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

옿 죠습니다~

Comment on lines +8 to +9
val longitude: String = "",
val latitude: String = "",
Copy link
Collaborator

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가 빈 스트링인 경우가 존재하면 안되니 말이죠..

Copy link
Member Author

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(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이 서비스는 300kg 쯤 되보입니다..

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3t 맞습니다.. 우선 이대로 가는건 어떠실까요..

Copy link
Collaborator

@ghrltjdtprbs ghrltjdtprbs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수고하셨습니다!

@big-cir big-cir merged commit 71a0639 into depromeet:develop Mar 24, 2025
@big-cir big-cir deleted the feature/SPS-121/add_admin_system branch March 24, 2025 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants