Skip to content

Commit a14759c

Browse files
committed
Merge branch 'develop' into feat/PRODUCT-236
# Conflicts: # src/main/resources/db/migration/V1__init.sql
2 parents 882bcbf + 305c348 commit a14759c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+353
-576
lines changed

src/main/java/eatda/controller/article/ArticleController.java

Lines changed: 0 additions & 24 deletions
This file was deleted.

src/main/java/eatda/controller/article/ArticleResponse.java

Lines changed: 0 additions & 9 deletions
This file was deleted.

src/main/java/eatda/controller/article/ArticlesResponse.java

Lines changed: 0 additions & 8 deletions
This file was deleted.

src/main/java/eatda/controller/cheer/CheerController.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,17 @@ public ResponseEntity<CheerResponse> registerCheer(@RequestPart("request") Cheer
4141
}
4242

4343
@GetMapping("/api/cheer")
44-
public ResponseEntity<CheersResponse> getCheers(@RequestParam @Min(1) @Max(50) int size) {
45-
CheersResponse response = cheerService.getCheers(size);
44+
public ResponseEntity<CheersResponse> getCheers(@RequestParam(defaultValue = "0") @Min(0) int page,
45+
@RequestParam(defaultValue = "5") @Min(1) @Max(50) int size) {
46+
CheersResponse response = cheerService.getCheers(page, size);
4647
return ResponseEntity.ok(response);
4748
}
4849

4950
@GetMapping("/api/shops/{storeId}/cheers")
5051
public ResponseEntity<CheersInStoreResponse> getCheersByStoreId(@PathVariable Long storeId,
51-
@RequestParam @Min(1) @Max(50) int size) {
52-
CheersInStoreResponse response = cheerService.getCheersByStoreId(storeId, size);
52+
@RequestParam(defaultValue = "0") @Min(0) int page,
53+
@RequestParam(defaultValue = "5") @Min(1) @Max(50) int size) {
54+
CheersInStoreResponse response = cheerService.getCheersByStoreId(storeId, page, size);
5355
return ResponseEntity.ok(response);
5456
}
5557
}

src/main/java/eatda/controller/store/StoreController.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,11 @@ public ResponseEntity<ImagesResponse> getStoreImages(@PathVariable long storeId)
2929
}
3030

3131
@GetMapping("/api/shops")
32-
public ResponseEntity<StoresResponse> getStores(@RequestParam @Min(1) @Max(50) int size,
32+
public ResponseEntity<StoresResponse> getStores(@RequestParam(defaultValue = "0") @Min(0) int page,
33+
@RequestParam(defaultValue = "5") @Min(1) @Max(50) int size,
3334
@RequestParam(required = false) String category) {
34-
return ResponseEntity.ok(storeService.getStores(size, category));
35+
StoresResponse response = storeService.getStores(page, size, category);
36+
return ResponseEntity.ok(response);
3537
}
3638

3739
@GetMapping("/api/shops/{storeId}")

src/main/java/eatda/domain/Image.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,15 @@
33
import eatda.exception.BusinessErrorCode;
44
import eatda.exception.BusinessException;
55
import java.util.Set;
6-
import lombok.Getter;
76
import org.springframework.lang.Nullable;
87
import org.springframework.web.multipart.MultipartFile;
98

10-
@Getter
11-
public class Image {
9+
public record Image(ImageDomain domain, MultipartFile file) {
1210

1311
private static final Set<String> ALLOWED_CONTENT_TYPES = Set.of("image/jpg", "image/jpeg", "image/png");
1412
private static final String EXTENSION_DELIMITER = ".";
1513
private static final String DEFAULT_CONTENT_TYPE = "bin";
1614

17-
private final ImageDomain domain;
18-
private final MultipartFile file;
19-
2015
public Image(ImageDomain domain, @Nullable MultipartFile file) {
2116
validateContentType(file);
2217
this.domain = domain;

src/main/java/eatda/domain/article/Article.java

Lines changed: 0 additions & 46 deletions
This file was deleted.

src/main/java/eatda/domain/store/Coordinates.java

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,16 @@ public class Coordinates {
1919
private static final double MAX_LATITUDE = 37.715133;
2020
private static final double MIN_LONGITUDE = 126.734086;
2121
private static final double MAX_LONGITUDE = 127.269311;
22+
@Column(nullable = false)
23+
private Double latitude;
24+
@Column(nullable = false)
25+
private Double longitude;
26+
27+
public Coordinates(Double latitude, Double longitude) {
28+
validate(latitude, longitude);
29+
this.latitude = latitude;
30+
this.longitude = longitude;
31+
}
2232

2333
public static double getMinLatitude() {
2434
return MIN_LATITUDE;
@@ -36,18 +46,6 @@ public static double getMaxLongitude() {
3646
return MAX_LONGITUDE;
3747
}
3848

39-
@Column(nullable = false)
40-
private Double latitude;
41-
42-
@Column(nullable = false)
43-
private Double longitude;
44-
45-
public Coordinates(Double latitude, Double longitude) {
46-
validate(latitude, longitude);
47-
this.latitude = latitude;
48-
this.longitude = longitude;
49-
}
50-
5149
private void validate(Double latitude, Double longitude) {
5250
validateNotNull(latitude, longitude);
5351
validateRange(latitude, longitude);

src/main/java/eatda/domain/story/Story.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public class Story extends AuditingEntity {
5454
@Column(name = "store_category", nullable = false)
5555
private StoreCategory storeCategory;
5656

57-
@Column(name = "description", nullable = false)
57+
@Column(name = "description")
5858
private String description;
5959

6060
@NotNull

src/main/java/eatda/repository/article/ArticleRepository.java

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)