Skip to content

[FEAT/#134] 어드민 장소 상태 변경 API 구현#135

Merged
ckkim817 merged 4 commits intodevelopfrom
feat/#134
Sep 23, 2025
Merged

[FEAT/#134] 어드민 장소 상태 변경 API 구현#135
ckkim817 merged 4 commits intodevelopfrom
feat/#134

Conversation

@ckkim817
Copy link
Member

💡 Issue

📄 Description

  • 어드민 장소 상태 변경 API를 구현했습니다.

@ckkim817 ckkim817 requested a review from Copilot September 23, 2025 14:58
@ckkim817 ckkim817 self-assigned this Sep 23, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements an admin API for updating spot status in the system. The implementation includes validation logic to ensure spots have required fields before being activated and prevents duplicate active spots with the same name and address.

  • Added service layer method with business logic validation for spot status changes
  • Created request DTO with validation annotations for API input
  • Updated controller endpoint to use proper request object instead of generic Map

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
Spot.java Added domain method to update spot status
AdminService.java Implemented business logic for spot status updates with validation
UpdateSpotStatusRequest.java Created request DTO with validation for status updates
AdminController.java Updated endpoint to use proper request object and validation

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +668 to +675
@Transactional
public void updateSpotStatus(final Long spotId, final UpdateSpotStatusRequest request) {
// 1. Spot 존재 확인
SpotEntity spotEntity = spotRepository.findByIdOrElseThrow(spotId);
Spot spot = spotMapper.toDomain(spotEntity);

// 2. ACTIVE로 변경하려는 경우 추가 검증
if (request.targetStatus() == SpotStatus.ACTIVE) {
Copy link

Copilot AI Sep 23, 2025

Choose a reason for hiding this comment

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

Use .equals() instead of == when comparing enum values to follow Java best practices and avoid potential issues with enum comparison.

Copilot uses AI. Check for mistakes.
}

// 3. Restaurant인 경우 spotFeatureList와 priceFeature 필수
if (spotType == SpotType.RESTAURANT) {
Copy link

Copilot AI Sep 23, 2025

Choose a reason for hiding this comment

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

Use .equals() instead of == when comparing enum values to follow Java best practices and avoid potential issues with enum comparison.

Suggested change
if (spotType == SpotType.RESTAURANT) {
if (spotType.equals(SpotType.RESTAURANT)) {

Copilot uses AI. Check for mistakes.
@ckkim817 ckkim817 merged commit 24bc462 into develop Sep 23, 2025
1 check passed
@ckkim817 ckkim817 deleted the feat/#134 branch September 23, 2025 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT] 어드민 장소 상태 변경 API 구현

2 participants