-
Notifications
You must be signed in to change notification settings - Fork 0
[Feat] Admin 매칭 취소 API 추가 및 구장·매칭 상세 정보 필드 확장 #62
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,7 @@ | ||
| package com.be.sportizebe.domain.facility.dto.request; | ||
|
|
||
| import com.be.sportizebe.domain.facility.entity.FacilityType; | ||
| import com.be.sportizebe.domain.facility.entity.ParkingType; | ||
| import io.swagger.v3.oas.annotations.media.Schema; | ||
|
|
||
| @Schema(description = "체육시설 수정 요청 (null 필드는 수정하지 않음)") | ||
|
|
@@ -19,6 +20,27 @@ public record FacilityUpdateRequest( | |
| String thumbnailUrl, | ||
|
|
||
| @Schema(description = "시설 종목 타입", example = "SOCCER") | ||
| FacilityType facilityType | ||
| FacilityType facilityType, | ||
|
|
||
| @Schema(description = "화장실 유무", example = "true") | ||
| Boolean hasToilet, | ||
|
|
||
| @Schema(description = "자판기 유무", example = "false") | ||
| Boolean hasVendingMachine, | ||
|
|
||
| @Schema(description = "샤워실 유무", example = "true") | ||
| Boolean hasShower, | ||
|
|
||
| @Schema(description = "주차 유형 (NONE/FREE/PAID)", example = "FREE") | ||
| ParkingType parkingType, | ||
|
|
||
| @Schema(description = "구장 가로 크기 (m)", example = "40") | ||
| Integer widthMeter, | ||
|
|
||
| @Schema(description = "구장 세로 크기 (m)", example = "20") | ||
| Integer heightMeter, | ||
|
Comment on lines
+37
to
+41
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 구장 크기에 음수/0 값이 들어갈 수 있습니다. Line 37-41은 값 경계 검증이 없어 비정상 규격 데이터가 저장될 수 있습니다. 🧩 제안 수정안+import jakarta.validation.constraints.Min;
@@
`@Schema`(description = "구장 가로 크기 (m)", example = "40")
+ `@Min`(value = 1, message = "구장 가로 크기는 1m 이상이어야 합니다.")
Integer widthMeter,
@@
`@Schema`(description = "구장 세로 크기 (m)", example = "20")
+ `@Min`(value = 1, message = "구장 세로 크기는 1m 이상이어야 합니다.")
Integer heightMeter,🤖 Prompt for AI Agents |
||
|
|
||
| @Schema(description = "휠체어 접근 가능 여부", example = "true") | ||
| Boolean wheelchairAccessible | ||
|
|
||
| ) {} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| package com.be.sportizebe.domain.facility.entity; | ||
|
|
||
| public enum ParkingType { | ||
| NONE, // 주차장 없음 | ||
| FREE, // 무료 주차 | ||
| PAID // 유료 주차 | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,7 +25,7 @@ public class SportsFacility extends BaseTimeEntity { | |
| @Column(columnDefinition = "text") | ||
| private String introduce; | ||
|
|
||
| // 리소스 부담 생각해서 일단 썸네일 이미지 1장으로만 구현하는 방식 | ||
| // 리소스 부담 생각해서 일단 썸네일 이미지 1/치장으로만 구현하는 방식 | ||
| private String thumbnailUrl; | ||
|
|
||
| @Enumerated(EnumType.STRING) | ||
|
|
@@ -35,6 +35,27 @@ public class SportsFacility extends BaseTimeEntity { | |
| @Column(columnDefinition = "geography(Point, 4326)", nullable = false) | ||
| private Point location; | ||
|
|
||
| // 편의시설 | ||
| @Column(nullable = false) | ||
| private boolean hasToilet; | ||
|
|
||
| @Column(nullable = false) | ||
| private boolean hasVendingMachine; | ||
|
|
||
| @Column(nullable = false) | ||
| private boolean hasShower; | ||
|
|
||
| @Enumerated(EnumType.STRING) | ||
| @Column(nullable = false, length = 10) | ||
| private ParkingType parkingType; | ||
|
|
||
| // 구장 크기 (미터) | ||
| private Integer widthMeter; | ||
| private Integer heightMeter; | ||
|
|
||
| @Column(nullable = false) | ||
| private boolean wheelchairAccessible; | ||
|
Comment on lines
+39
to
+57
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: # First, let's explore the repository structure to find migration-related directories
find . -type d \( -name "*migration*" -o -name "*liquibase*" -o -name "*flyway*" -o -name "*sql*" -o -name "db" \) 2>/dev/null | head -20Repository: Sportize/be Length of output: 37 🏁 Script executed: # Search for database migration files with common patterns
git ls-files | grep -E "\.(sql|xml|yaml|yml)$" | grep -iE "(migration|liquibase|flyway|sql)" | head -30Repository: Sportize/be Length of output: 37 🏁 Script executed: # Search for sports_facilities table references in the codebase
rg -i "sports_facilities" --type sql --type xml --type yaml -nRepository: Sportize/be Length of output: 37 🏁 Script executed: # Check for Liquibase or Flyway configuration in Gradle files
rg -i "liquibase|flyway" --type gradle --type text -A 3 -B 1Repository: Sportize/be Length of output: 83 🏁 Script executed: # Search for any DEFAULT or migration-related content related to the new columns
rg -i "(has_toilet|has_vending_machine|has_shower|parking_type|wheelchair_accessible|width_meter|height_meter)" -nRepository: Sportize/be Length of output: 37 🏁 Script executed: # List the overall directory structure
ls -la && echo "---" && find . -type d -maxdepth 3 | head -40Repository: Sportize/be Length of output: 1528 🏁 Script executed: # Look for any SQL files anywhere in the repository
find . -name "*.sql" -o -name "*.ddl" 2>/dev/nullRepository: Sportize/be Length of output: 37 🏁 Script executed: # Check the build.gradle or gradle files for database/migration configuration
find . -name "*.gradle" -o -name "*.gradle.kts" | head -5Repository: Sportize/be Length of output: 87 🏁 Script executed: # Look at the root build.gradle or build.gradle.kts
find . -maxdepth 2 -name "build.gradle*" -exec cat {} \;Repository: Sportize/be Length of output: 1969 🏁 Script executed: # Check if there's any database configuration or JPA/Hibernate setup
rg -i "jpa|hibernate|database|datasource|migration" -A 2 --type gradle --type yaml --type xml | head -50Repository: Sportize/be Length of output: 324 🏁 Script executed: # Look for application configuration files
find ./src -name "application*.properties" -o -name "application*.yml" -o -name "application*.yaml"Repository: Sportize/be Length of output: 37 🏁 Script executed: # Check application.properties content
find ./src -name "application*.properties" -exec cat {} \;Repository: Sportize/be Length of output: 37 🏁 Script executed: # Check application.yml content
find ./src -name "application*.yml" -o -name "application*.yaml" | head -5 | xargs cat 2>/dev/nullRepository: Sportize/be Length of output: 37 🏁 Script executed: # Look for schema.sql or data.sql initialization files
find ./src -name "schema*.sql" -o -name "data.sql" -o -name "init*.sql"Repository: Sportize/be Length of output: 37 🏁 Script executed: # Read the SportsFacility.java entity to check for defaults
cat -n ./src/main/java/com/be/sportizebe/domain/facility/entity/SportsFacility.javaRepository: Sportize/be Length of output: 3494 기존 데이터를 위한 NOT NULL 컬럼 마이그레이션 및 DEFAULT 값 설정이 필요합니다.
현재 저장소에는 Liquibase/Flyway 마이그레이션 프레임워크가 없으며, 데이터베이스 스키마 초기화 파일(schema.sql, data.sql) 또는 DEFAULT 값 정의도 없습니다. 기존 sports_facilities 데이터가 있는 경우, 이 컬럼들을 추가할 때 스키마 적용 실패 또는 제약 조건 위반이 발생할 수 있습니다. 다음 중 하나를 적용하세요:
🤖 Prompt for AI Agents |
||
|
|
||
| // 변경 메서드(Dirty Checking용) | ||
| public void changeInfo(String facilityName, String introduce, String thumbnailUrl, FacilityType facilityType) { | ||
| if (facilityName != null) this.facilityName = facilityName; | ||
|
|
@@ -43,6 +64,18 @@ public void changeInfo(String facilityName, String introduce, String thumbnailUr | |
| if (facilityType != null) this.facilityType = facilityType; | ||
| } | ||
|
|
||
| public void changeAmenity(Boolean hasToilet, Boolean hasVendingMachine, Boolean hasShower, | ||
| ParkingType parkingType, Integer widthMeter, Integer heightMeter, | ||
| Boolean wheelchairAccessible) { | ||
| if (hasToilet != null) this.hasToilet = hasToilet; | ||
| if (hasVendingMachine != null) this.hasVendingMachine = hasVendingMachine; | ||
| if (hasShower != null) this.hasShower = hasShower; | ||
| if (parkingType != null) this.parkingType = parkingType; | ||
| if (widthMeter != null) this.widthMeter = widthMeter; | ||
| if (heightMeter != null) this.heightMeter = heightMeter; | ||
| if (wheelchairAccessible != null) this.wheelchairAccessible = wheelchairAccessible; | ||
| } | ||
|
|
||
| public void changeAddress(String address) { | ||
| this.address = address; | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,6 +1,7 @@ | ||||||||||||
| package com.be.sportizebe.domain.match.dto.request; | ||||||||||||
|
|
||||||||||||
| import com.be.sportizebe.common.enums.SportType; | ||||||||||||
| import com.be.sportizebe.domain.match.entity.UniformPolicy; | ||||||||||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||||||||||
| import jakarta.validation.constraints.Future; | ||||||||||||
| import jakarta.validation.constraints.Max; | ||||||||||||
|
|
@@ -32,6 +33,16 @@ public record MatchCreateRequest( | |||||||||||
| @Schema(description = "매칭 시작 일시", example = "2026-03-07T14:00:00") | ||||||||||||
| @NotNull(message = "매칭 시작 일시는 필수입니다.") | ||||||||||||
| @Future(message = "매칭 시작 일시는 현재 시간 이후여야 합니다.") | ||||||||||||
| LocalDateTime scheduledAt | ||||||||||||
| LocalDateTime scheduledAt, | ||||||||||||
|
|
||||||||||||
| @Schema(description = "유니폼 정책 (BRING_OWN: 흰/검 지참, VEST_PROVIDED: 조끼 제공)", example = "BRING_OWN") | ||||||||||||
| UniformPolicy uniformPolicy, | ||||||||||||
|
|
||||||||||||
| @Schema(description = "몇 파전 (미입력 시 2파전)", example = "2") | ||||||||||||
| @Min(value = 2, message = "파전 수는 2 이상이어야 합니다.") | ||||||||||||
| Integer numberOfTeams, | ||||||||||||
|
|
||||||||||||
| @Schema(description = "남/녀 혼성 허용 여부", example = "false") | ||||||||||||
| boolean mixedGender | ||||||||||||
|
Comment on lines
+45
to
+46
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Line 46은 요청에서 필드가 빠져도 검증 없이 💡 제안 수정안- `@Schema`(description = "남/녀 혼성 허용 여부", example = "false")
- boolean mixedGender
+ `@Schema`(description = "남/녀 혼성 허용 여부", example = "false")
+ `@NotNull`(message = "혼성 허용 여부는 필수입니다.")
+ Boolean mixedGender📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||
|
|
||||||||||||
| ) {} | ||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
구장 크기 필드에 값 범위 검증이 필요합니다.
현재는 음수/0 크기도 통과할 수 있어 잘못된 시설 데이터가 저장될 수 있습니다. 생성 요청에서는 최소 양수 제약을 거는 편이 안전합니다.
제안 수정안
📝 Committable suggestion
🤖 Prompt for AI Agents