Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,24 +33,24 @@ public ResponseEntity<ApiResponse<GardenResponse>> getGarden(@PathVariable Long
@Operation(summary = "내 정원에 물 주기", description = "자신의 정원에 물을 줍니다.")
@PostMapping("/{gardenId}/mywater")
public ResponseEntity<ApiResponse<Void>> waterMyGarden(
@AuthenticationPrincipal Long userId, @PathVariable Long gardenId) {
gardenService.waterGarden(userId, gardenId);
@AuthenticationPrincipal User user, @PathVariable Long gardenId) {
gardenService.waterGarden(user.getId(), gardenId);
return ResponseEntity.ok(ApiResponse.success(null));
}

@Operation(summary = "남의 정원에 물 주기", description = "남의 정원에 물을 줍니다.")
@PostMapping("/{gardenId}/friendwater")
public ResponseEntity<ApiResponse<Void>> waterYourGarden(
@AuthenticationPrincipal Long userId, @PathVariable Long gardenId) {
gardenService.waterGarden(userId, gardenId);
@AuthenticationPrincipal User user, @PathVariable Long gardenId) {
gardenService.waterGarden(user.getId(), gardenId);
return ResponseEntity.ok(ApiResponse.success(null));
}

@Operation(summary = "정원에 햇빛 주기", description = "자신의 정원에 햇빛을 줍니다.")
@PostMapping("/{gardenId}/sunlight")
public ResponseEntity<ApiResponse<Void>> sunlightGarden(
@AuthenticationPrincipal Long userId, @PathVariable Long gardenId) {
gardenService.sunlightGarden(userId, gardenId);
@AuthenticationPrincipal User user, @PathVariable Long gardenId) {
gardenService.sunlightGarden(user.getId(), gardenId);
return ResponseEntity.ok(ApiResponse.success(null));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import jakarta.persistence.*;
import java.time.LocalDateTime;
import lombok.*;
import org.springframework.data.annotation.CreatedDate;

@Entity
@Getter
Expand All @@ -30,6 +31,7 @@ public class DiaryImage {
private User user;

@Column(name = "created_at")
@CreatedDate
private LocalDateTime createdAt;

public void updateImageUrl(String newImageUrl) {
Expand Down