Skip to content

Commit

Permalink
Merge branch 'develop' into feature/5
Browse files Browse the repository at this point in the history
  • Loading branch information
hcg0127 authored Jul 4, 2024
2 parents 6c74f12 + 8205d95 commit 08301b8
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ public static TreasureBox toEntity(TreasureBoxRequestDTO.CreateTreasureBoxDTO cr
public static TreasureBoxResponseDTO toDTO(TreasureBox treasureBox) {
return TreasureBoxResponseDTO.builder()
.id(treasureBox.getId())
.userId(treasureBox.getUser().getId())
.createdAt(treasureBox.getCreatedAt())
.deadline(treasureBox.getDeadline())
.status(treasureBox.getStatus())
.title(treasureBox.getTitle())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
import umc_haekathon_4.demo.web.dto.TreasureBoxRequestDTO;
import umc_haekathon_4.demo.web.dto.TreasureBoxResponseDTO;

import java.util.List;

@Service
@RequiredArgsConstructor
public class TreasureBoxService {
Expand Down Expand Up @@ -82,7 +80,6 @@ public TreasureBoxResponseDTO delayDeadline(Long id, TreasureBoxRequestDTO.Updat
return TreasureBoxConverter.toDTO(treasureBox);
}


public List<TreasureBox> getTreasureBoxes() {
return treasureBoxRepository.findAll();
}
Expand Down Expand Up @@ -121,6 +118,5 @@ private double calculateDistance(double lat1, double lon1, double lat2, double l
double c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
double distance = R * c * 1000; // convert to meters
return distance;

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
import umc_haekathon_4.demo.web.dto.TreasureBoxRequestDTO;
import umc_haekathon_4.demo.web.dto.TreasureBoxResponseDTO;

import java.util.List;

@RestController
@RequestMapping("/")
@RequiredArgsConstructor
Expand All @@ -28,7 +26,6 @@ public ApiResponse<TreasureBoxResponseDTO> create(@RequestBody @Valid TreasureBo
return ApiResponse.onSuccess(TreasureBoxConverter.toDTO(treasureBox));
}


//보물상자 리스트
@GetMapping("/treasurebox/list")
@Operation(summary = "보물상자 리스트", description = "보물상자의 목록을 조회하는 API")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@
@AllArgsConstructor
public class TreasureBoxResponseDTO {
private Long id;
private Long userId;
private LocalDateTime createdAt;
private LocalDate deadline;
private String status;
private String title;

private String body;
private double latitude;
private double longitude;
Expand Down

0 comments on commit 08301b8

Please sign in to comment.