diff --git a/README.md b/README.md index 226c5998..a038a26c 100644 --- a/README.md +++ b/README.md @@ -1,32 +1,46 @@ ## Bingterpark + [노션 페이지](https://www.notion.so/backend-devcourse/2-BingterPark-4ecfb3943d9c4a8f9bb83f72876b6a80) [ERD](https://www.erdcloud.com/d/ZadArGCaQXFcxZuu8) + ### 모듈 구조 + +![img.png](img.png) + #### api + - api-member -회원 도메인 + 회원 도메인 - api-event -공연 도메인 + 공연 도메인 - api-booking -예매 도메인 + 예매 도메인 + #### batch + 스프링 배치 모듈 + #### core + - core-domain -JPA 엔티티, 리포지토리 + JPA 엔티티, 리포지토리 - core-infra -queryDsl, RDB 설정 파일 + queryDsl, RDB 설정 파일 - core-infra-es -elastic search 설정 파일, document, searchRepository + elastic search 설정 파일, document, searchRepository - core-security -spring security 설정 파일 + spring security 설정 파일 + ## 실행 방법 + 1. git clone 2. RDB, 레디스 실행 ```docker-compose up -d``` 3. api-event 모듈로 이동 ```cd /api/api-event``` 4. 엘라스틱 서치 도커 이미지 빌드 ```docker build -t el:0.1 -f ./Dockerfile .``` 5. ELK 스택 실행 ```docker-compose up -d``` 6. api-booking, api-event, api-member 각 모듈에서 스프링 어플리케이션 실행 + ## 테스트 방법 + - 통합 http 테스트는 /http/bingterpark.http에 있습니다. - 어드민 플로우, 유저 플로우 http 코드를 위에서부터 하나씩 실행하시면 됩니다. diff --git a/api/api-member/src/main/java/com/pgms/apimember/controller/AdminController.java b/api/api-member/src/main/java/com/pgms/apimember/controller/AdminController.java index 46f6a70e..4aff33b4 100644 --- a/api/api-member/src/main/java/com/pgms/apimember/controller/AdminController.java +++ b/api/api-member/src/main/java/com/pgms/apimember/controller/AdminController.java @@ -19,9 +19,12 @@ import com.pgms.coredomain.response.ApiResponse; import com.pgms.coresecurity.security.resolver.CurrentAccount; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.validation.Valid; import lombok.RequiredArgsConstructor; +@Tag(name = "관리자", description = "관리자 관련 API 입니다.") @RestController @RequestMapping("/api/v1/admin") @RequiredArgsConstructor @@ -29,23 +32,27 @@ public class AdminController { private final AdminService adminService; + @Operation(summary = "회원 목록 조회", description = "회원 목록 조회 API 입니다.") @GetMapping("/members") public ResponseEntity>> getMembers( @ModelAttribute @Valid PageCondition pageCondition) { return ResponseEntity.ok(ApiResponse.ok(adminService.getMembers(pageCondition))); } + @Operation(summary = "회원 상세 조회", description = "회원 상세 조회 API 입니다.") @GetMapping("/members/details") public ResponseEntity>> getMemberDetails( @RequestParam List memberIds) { return ResponseEntity.ok(ApiResponse.ok(adminService.getMemberDetails(memberIds))); } + @Operation(summary = "관리자 본인 정보 조회", description = "관리자 본인 정보 조회 API 입니다.") @GetMapping("/me") public ResponseEntity> getMyInfo(@CurrentAccount Long adminId) { return ResponseEntity.ok(ApiResponse.ok(adminService.getAdmin(adminId))); } + @Operation(summary = "관리자 본인 삭제", description = "관리자 본인 삭제 API 입니다.") @DeleteMapping("/me") public ResponseEntity> deleteMyAccount(@CurrentAccount Long adminId) { adminService.deleteAdmins(Collections.singletonList(adminId)); diff --git a/api/api-member/src/main/java/com/pgms/apimember/controller/AdminManagementController.java b/api/api-member/src/main/java/com/pgms/apimember/controller/AdminManagementController.java index 4c06dbec..238f7b94 100644 --- a/api/api-member/src/main/java/com/pgms/apimember/controller/AdminManagementController.java +++ b/api/api-member/src/main/java/com/pgms/apimember/controller/AdminManagementController.java @@ -23,10 +23,13 @@ import com.pgms.apimember.service.AdminService; import com.pgms.coredomain.response.ApiResponse; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.validation.Valid; import jakarta.validation.constraints.NotNull; import lombok.RequiredArgsConstructor; +@Tag(name = "슈퍼관리자", description = "슈퍼관리자 관련 API 입니다.") @RestController @RequestMapping("/api/v1/admin/management") @RequiredArgsConstructor @@ -38,6 +41,7 @@ public class AdminManagementController { // 슈퍼관리자 전용 컨트롤러 * 관리자 CRUD */ + @Operation(summary = "관리자 생성", description = "관리자 생성 API 입니다.") @PostMapping public ResponseEntity> createAdmin(@RequestBody @Valid AdminCreateRequest requestDto) { final Long adminId = adminService.createAdmin(requestDto); @@ -47,12 +51,14 @@ public ResponseEntity> createAdmin(@RequestBody @Valid AdminCr return ResponseEntity.created(uri).body(ApiResponse.created(adminId)); } + @Operation(summary = "관리자 목록 조회", description = "관리자 목록 조회 API 입니다.") @GetMapping public ResponseEntity>> getAdmins( @ModelAttribute @Valid PageCondition pageCondition) { return ResponseEntity.ok(ApiResponse.ok(adminService.getAdmins(pageCondition))); } + @Operation(summary = "관리자 수정", description = "관리자 수정 API 입니다.") @PatchMapping("/{adminId}") public ResponseEntity> updateAdmin( @PathVariable Long adminId, @@ -61,6 +67,7 @@ public ResponseEntity> updateAdmin( return ResponseEntity.noContent().build(); } + @Operation(summary = "관리자 삭제", description = "관리자 삭제 API 입니다.") @DeleteMapping public ResponseEntity> deleteAdmins(@RequestParam List adminIds) { adminService.deleteAdmins(adminIds); diff --git a/api/api-member/src/main/java/com/pgms/apimember/controller/AuthController.java b/api/api-member/src/main/java/com/pgms/apimember/controller/AuthController.java index fd8c985f..9f2b17a2 100644 --- a/api/api-member/src/main/java/com/pgms/apimember/controller/AuthController.java +++ b/api/api-member/src/main/java/com/pgms/apimember/controller/AuthController.java @@ -13,9 +13,12 @@ import com.pgms.coredomain.domain.member.enums.Role; import com.pgms.coredomain.response.ApiResponse; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.validation.Valid; import lombok.RequiredArgsConstructor; +@Tag(name = "인증", description = "인증 관련 API 입니다.") @RestController @RequestMapping("/api/v1/auth") @RequiredArgsConstructor @@ -26,15 +29,16 @@ public class AuthController { /** * 로그인 */ + @Operation(summary = "관리자 로그인", description = "관리자 로그인 API 입니다.") @PostMapping("/admin/login") public ResponseEntity> adminLogin(@Valid @RequestBody LoginRequest request) { AuthResponse response = authService.login(request, Role.ROLE_ADMIN); return ResponseEntity.ok(ApiResponse.ok(response)); } + @Operation(summary = "회원 로그인", description = "회원 로그인 API 입니다.") @PostMapping("/members/login") public ResponseEntity> memberLogin(@Valid @RequestBody LoginRequest request) { - // TODO: 나중에 enum으로..? AuthResponse response = authService.login(request, Role.ROLE_USER); return ResponseEntity.ok(ApiResponse.ok(response)); } @@ -42,6 +46,7 @@ public ResponseEntity> memberLogin(@Valid @RequestBody /** * 토큰 재발급 */ + @Operation(summary = "토큰 재발급", description = "토큰 재발급 API 입니다.") @PostMapping("/refresh") public ResponseEntity> refresh(@RequestBody RefreshTokenRequest request) { AuthResponse response = authService.refresh(request); diff --git a/api/api-member/src/main/java/com/pgms/apimember/controller/MemberController.java b/api/api-member/src/main/java/com/pgms/apimember/controller/MemberController.java index 2bf0d1e5..fb7f06d5 100644 --- a/api/api-member/src/main/java/com/pgms/apimember/controller/MemberController.java +++ b/api/api-member/src/main/java/com/pgms/apimember/controller/MemberController.java @@ -20,9 +20,12 @@ import com.pgms.coredomain.response.ApiResponse; import com.pgms.coresecurity.security.resolver.CurrentAccount; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.validation.Valid; import lombok.RequiredArgsConstructor; +@Tag(name = "회원", description = "회원 관련 API 입니다.") @RestController @RequestMapping("/api/v1/members") @RequiredArgsConstructor @@ -30,16 +33,19 @@ public class MemberController { private final MemberService memberService; + @Operation(summary = "회원가입", description = "회원가입 API 입니다.") @PostMapping("/signup") public ResponseEntity> signUp(@RequestBody @Valid MemberSignUpRequest requestDto) { return ResponseEntity.ok(ApiResponse.ok(memberService.signUp(requestDto))); } + @Operation(summary = "회원 정보 조회", description = "회원 정보 조회 API 입니다.") @GetMapping("/me") public ResponseEntity> getMyInfo(@CurrentAccount Long memberId) { return ResponseEntity.ok(ApiResponse.ok(memberService.getMemberDetail(memberId))); } + @Operation(summary = "회원 수정", description = "회원 수정 API 입니다.") @PatchMapping("/me") public ResponseEntity updateMyInfo( @CurrentAccount Long memberId, @@ -48,6 +54,7 @@ public ResponseEntity updateMyInfo( return ResponseEntity.noContent().build(); } + @Operation(summary = "비밀번호 수정", description = "비밀번호 수정 API 입니다.") @PatchMapping("/me/password") public ResponseEntity updatePassword( @CurrentAccount Long memberId, @@ -56,6 +63,7 @@ public ResponseEntity updatePassword( return ResponseEntity.noContent().build(); } + @Operation(summary = "비밀번호 확인", description = "비밀번호 확인 API 입니다.") @PostMapping("/me/verify-password") public ResponseEntity verifyPassword(@CurrentAccount Long memberId, @RequestBody MemberPasswordVerifyRequest requestDto) { @@ -63,18 +71,21 @@ public ResponseEntity verifyPassword(@CurrentAccount Long memberId, return ResponseEntity.noContent().build(); } + @Operation(summary = "회원 탈퇴", description = "회원 탈퇴 API 입니다.") @DeleteMapping("/me") public ResponseEntity> deleteMyAccount(@CurrentAccount Long memberId) { memberService.deleteMember(memberId); return ResponseEntity.noContent().build(); } - @PostMapping("send-restore-email") + @Operation(summary = "휴면 해제 메일 전송", description = "휴면 해제 메일 전송 API 입니다.") + @PostMapping("/send-restore-email") public ResponseEntity> sendRestoreEmail(@RequestBody @Valid MemberRestoreRequest requestDto) { memberService.sendRestoreEmail(requestDto); return ResponseEntity.noContent().build(); } + @Operation(summary = "휴면 해제 본인 인증", description = "휴면 해제 본인 인증 API 입니다.") @PatchMapping("/confirm-restore") public ResponseEntity> confirmRestore(@RequestBody @Valid ConfirmRestoreRequest requestDto) { memberService.confirmRestoreMember(requestDto); diff --git a/core/core-domain/src/main/java/com/pgms/coredomain/domain/event/EventHall.java b/core/core-domain/src/main/java/com/pgms/coredomain/domain/event/EventHall.java index 1968a63b..fde71288 100644 --- a/core/core-domain/src/main/java/com/pgms/coredomain/domain/event/EventHall.java +++ b/core/core-domain/src/main/java/com/pgms/coredomain/domain/event/EventHall.java @@ -1,12 +1,24 @@ package com.pgms.coredomain.domain.event; -import com.pgms.coredomain.domain.common.BaseEntity; -import jakarta.persistence.*; -import lombok.*; - import java.util.ArrayList; import java.util.List; +import com.pgms.coredomain.domain.common.BaseEntity; + +import jakarta.persistence.CascadeType; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.persistence.OneToMany; +import jakarta.persistence.Table; +import lombok.AccessLevel; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Getter; +import lombok.NoArgsConstructor; + @Entity @Getter @AllArgsConstructor @@ -14,36 +26,37 @@ @Table(name = "event_hall") public class EventHall extends BaseEntity { - @Id - @Column(name = "id") - @GeneratedValue(strategy = GenerationType.IDENTITY) - private Long id; - - @Column(name = "event_name") - private String name; - - @Column(name = "address") - private String address; - - @OneToMany(mappedBy = "eventHall", cascade = CascadeType.ALL, orphanRemoval = true) - private List eventHallSeats = new ArrayList<>(); - - @Builder - public EventHall(String name, String address, List eventHallSeats) { - this.name = name; - this.address = address; - this.eventHallSeats = eventHallSeats; - setEventHallSeatsEventHall(); - } - - public void setEventHallSeatsEventHall(){ - if(this.eventHallSeats == null) return; - this.eventHallSeats.forEach(eventHallSeat -> eventHallSeat.setEventHall(this)); - } - - public void updateEventHall(EventHallEdit eventHallEdit){ - this.name = eventHallEdit.getName(); - this.address = eventHallEdit.getAddress(); - this.eventHallSeats = eventHallEdit.getEventHallSeats(); - } + @Id + @Column(name = "id") + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + @Column(name = "name") + private String name; + + @Column(name = "address") + private String address; + + @OneToMany(mappedBy = "eventHall", cascade = CascadeType.ALL, orphanRemoval = true) + private List eventHallSeats = new ArrayList<>(); + + @Builder + public EventHall(String name, String address, List eventHallSeats) { + this.name = name; + this.address = address; + this.eventHallSeats = eventHallSeats; + setEventHallSeatsEventHall(); + } + + public void setEventHallSeatsEventHall() { + if (this.eventHallSeats == null) + return; + this.eventHallSeats.forEach(eventHallSeat -> eventHallSeat.setEventHall(this)); + } + + public void updateEventHall(EventHallEdit eventHallEdit) { + this.name = eventHallEdit.getName(); + this.address = eventHallEdit.getAddress(); + this.eventHallSeats = eventHallEdit.getEventHallSeats(); + } } diff --git a/core/core-infra/src/main/resources/application-infra.yml b/core/core-infra/src/main/resources/application-infra.yml index 6150fc0d..44338181 100644 --- a/core/core-infra/src/main/resources/application-infra.yml +++ b/core/core-infra/src/main/resources/application-infra.yml @@ -30,7 +30,7 @@ spring: on-profile: prod datasource: driver-class-name: com.mysql.cj.jdbc.Driver - url: jdbc:mysql://localhost:3307/bingterpark?useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Seoul&characterEncoding=UTF-8 + url: jdbc:mysql://localhost:3307/bingterpark?useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Seoul&characterEncoding=UTF-8c:mysql://localhost:3307/bingterpark?useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Seoul&characterEncoding=UTF-8 username: root password: root1234! jpa: @@ -42,3 +42,7 @@ spring: sql: init: mode: never + +logging: + level: + org.hibernate.SQL: INFO diff --git a/core/core-infra/src/main/resources/data.sql b/core/core-infra/src/main/resources/data.sql index 11d9b3b2..3e53dc8a 100644 --- a/core/core-infra/src/main/resources/data.sql +++ b/core/core-infra/src/main/resources/data.sql @@ -1,5 +1,5 @@ -- EventHall -INSERT INTO event_hall (event_name, address) +INSERT INTO event_hall (name, address) VALUES ('고척스카이돔', '서울 구로구 경인로 430'); -- Event @@ -95,7 +95,8 @@ INSERT INTO payment (booking_id, approved_at, created_at, updated_at) -VALUES ('bookingTestId', 180000, 'CARD', 'HYUNDAI', '11111111****111*', 0, false, 'paymentkey', 'CANCELED', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP); +VALUES ('bookingTestId', 180000, 'CARD', 'HYUNDAI', '11111111****111*', 0, false, 'paymentkey', 'CANCELED', + CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP); -- Booking Cancel INSERT INTO booking_cancel (booking_id, amount, reason, created_by, created_at, updated_at) diff --git a/core/core-security/src/main/java/com/pgms/coresecurity/security/config/WebSecurityConfig.java b/core/core-security/src/main/java/com/pgms/coresecurity/security/config/WebSecurityConfig.java index c72eadb1..c8958999 100644 --- a/core/core-security/src/main/java/com/pgms/coresecurity/security/config/WebSecurityConfig.java +++ b/core/core-security/src/main/java/com/pgms/coresecurity/security/config/WebSecurityConfig.java @@ -93,8 +93,12 @@ private RequestMatcher[] requestPermitAll() { antMatcher(GET, "/api/*/events/*/seat-area"), // 공연 좌석 구역 목록 조회 // DOCS - antMatcher("/v3/api-docs/**"), - antMatcher("/swagger-ui/**") + antMatcher("/swagger-ui/**"), + antMatcher("/swagger-ui"), + antMatcher("/swagger-ui.html"), + antMatcher("/v2/api-docs"), + antMatcher("/v3/api-docs"), + antMatcher("/webjars/**") ); return requestMatchers.toArray(RequestMatcher[]::new); } @@ -217,13 +221,13 @@ public SecurityFilterChain securityFilterChainDefault(HttpSecurity http) throws configureCommonSecuritySettings(http); http .authorizeHttpRequests() - .anyRequest().authenticated() - .and() - .addFilterAfter(jwtAuthenticationFilter, ExceptionTranslationFilter.class) - .exceptionHandling(exception -> { - exception.authenticationEntryPoint(jwtAuthenticationEntryPoint); - exception.accessDeniedHandler(jwtAccessDeniedHandler); - }); + .anyRequest().permitAll(); + // .and() + // .addFilterAfter(jwtAuthenticationFilter, ExceptionTranslationFilter.class) + // .exceptionHandling(exception -> { + // exception.authenticationEntryPoint(jwtAuthenticationEntryPoint); + // exception.accessDeniedHandler(jwtAccessDeniedHandler); + // }); return http.build(); } diff --git a/db/conf.d/schema.sql b/db/initdb.d/1-schema.sql similarity index 68% rename from db/conf.d/schema.sql rename to db/initdb.d/1-schema.sql index 7e56580b..1c7c6ce3 100644 --- a/db/conf.d/schema.sql +++ b/db/initdb.d/1-schema.sql @@ -5,69 +5,90 @@ CREATE TABLE admin updated_at TIMESTAMP(6), last_login_at TIMESTAMP(6) NOT NULL, last_password_updated_at TIMESTAMP(6) NOT NULL, - email VARCHAR(255) NOT NULL, - name VARCHAR(255) NOT NULL, - password VARCHAR(255) NOT NULL, - phone_number VARCHAR(255) NOT NULL, - role VARCHAR(255), - status VARCHAR(255) NOT NULL + email VARCHAR(50) NOT NULL, + name VARCHAR(20) NOT NULL, + password VARCHAR(100) NOT NULL, + phone_number VARCHAR(20) NOT NULL, + role VARCHAR(20), + status VARCHAR(10) NOT NULL +); + +CREATE TABLE member +( + id BIGINT AUTO_INCREMENT PRIMARY KEY, + created_at TIMESTAMP(6), + updated_at TIMESTAMP(6), + last_login_at TIMESTAMP(6) NOT NULL, + last_password_updated_at TIMESTAMP(6) NOT NULL, + birth_date DATE, + detail_address VARCHAR(50), + email VARCHAR(50) NOT NULL, + gender VARCHAR(10), + name VARCHAR(20) NOT NULL, + password VARCHAR(100), + phone_number VARCHAR(20), + provider VARCHAR(10), + role VARCHAR(20), + status VARCHAR(10) NOT NULL, + street_address VARCHAR(50), + zip_code VARCHAR(5) ); CREATE TABLE event ( - id BIGINT AUTO_INCREMENT PRIMARY KEY, + id BIGINT AUTO_INCREMENT PRIMARY KEY, -- 공연 id created_at TIMESTAMP(6), updated_at TIMESTAMP(6), - average_score FLOAT(53), - booking_ended_at TIMESTAMP(6), - booking_started_at TIMESTAMP(6), - description TEXT, - ended_at TIMESTAMP(6), - genre VARCHAR(255), - running_time INT, - started_at TIMESTAMP(6), - thumbnail TEXT, - title VARCHAR(255), - rating VARCHAR(255), + average_score FLOAT(53), -- 공연 평점 평균 + booking_ended_at TIMESTAMP(6), -- 예매 시작일 + booking_started_at TIMESTAMP(6), -- 예매 종료일 + description TEXT, -- 공연 상세 설명 + ended_at TIMESTAMP(6), -- 공연 종료일 + genre VARCHAR(50), -- 장르 + running_time INT, -- 상영 시간 + started_at TIMESTAMP(6), -- 공연 시작일 + thumbnail TEXT, -- 공연 썸네일 + title VARCHAR(100), -- 공연 제목 + rating VARCHAR(50), -- 관람 등급 event_hall_id BIGINT ); CREATE TABLE event_hall ( - id BIGINT AUTO_INCREMENT PRIMARY KEY, + id BIGINT AUTO_INCREMENT PRIMARY KEY, -- 공연장 id created_at TIMESTAMP(6), updated_at TIMESTAMP(6), - address VARCHAR(255), - event_name VARCHAR(255) + address VARCHAR(255), -- 공연장 주소 + name VARCHAR(50) -- 공연장 이름 ); CREATE TABLE event_hall_seat ( - id BIGINT AUTO_INCREMENT PRIMARY KEY, + id BIGINT AUTO_INCREMENT PRIMARY KEY, -- 공연장 좌석 id created_at TIMESTAMP(6), updated_at TIMESTAMP(6), - name VARCHAR(255), + name VARCHAR(20), -- 공연장 좌석 이름 eventhall_id BIGINT, FOREIGN KEY (eventhall_id) REFERENCES event_hall (id) ); CREATE TABLE event_image ( - id BIGINT AUTO_INCREMENT PRIMARY KEY, + id BIGINT AUTO_INCREMENT PRIMARY KEY, -- 공연 이미지 id created_at TIMESTAMP(6), updated_at TIMESTAMP(6), - url TEXT, + url TEXT, -- 이미지 url event_id BIGINT, FOREIGN KEY (event_id) REFERENCES event (id) ); CREATE TABLE event_review ( - id BIGINT AUTO_INCREMENT PRIMARY KEY, + id BIGINT AUTO_INCREMENT PRIMARY KEY, -- 공연 후기 id created_at TIMESTAMP(6), updated_at TIMESTAMP(6), - content TEXT, - score INT, + content TEXT, -- 공연 후기 내용 + score INT, -- 공연 후기 점수 event_id BIGINT, member_id BIGINT, FOREIGN KEY (event_id) REFERENCES event (id), @@ -76,60 +97,38 @@ CREATE TABLE event_review CREATE TABLE event_seat ( - id BIGINT AUTO_INCREMENT PRIMARY KEY, + id BIGINT AUTO_INCREMENT PRIMARY KEY, -- 공연 좌석 id created_at TIMESTAMP(6), updated_at TIMESTAMP(6), - name VARCHAR(255), - status VARCHAR(255), + name VARCHAR(20), -- 좌석 이름 + status VARCHAR(50), -- 좌석 상태 event_seat_area_id BIGINT, event_time_id BIGINT ); CREATE TABLE event_seat_area ( - id BIGINT AUTO_INCREMENT PRIMARY KEY, + id BIGINT AUTO_INCREMENT PRIMARY KEY, -- 공연 좌석 구역 id created_at TIMESTAMP(6), updated_at TIMESTAMP(6), - price INT, - area_type VARCHAR(255), + price INT, -- 구역별 가격 + area_type VARCHAR(50), -- 구역 타입 event_id BIGINT, FOREIGN KEY (event_id) REFERENCES event (id) ); CREATE TABLE event_time ( - id BIGINT AUTO_INCREMENT PRIMARY KEY, + id BIGINT AUTO_INCREMENT PRIMARY KEY, -- 공연 회차 id created_at TIMESTAMP(6), updated_at TIMESTAMP(6), - ended_at TIMESTAMP(6), - round INT, - started_at TIMESTAMP(6), + ended_at TIMESTAMP(6), -- 회차 종료 시간 + round INT, -- 회차 + started_at TIMESTAMP(6), -- 회차 시작 시간 event_id BIGINT, FOREIGN KEY (event_id) REFERENCES event (id) ); -CREATE TABLE member -( - id BIGINT AUTO_INCREMENT PRIMARY KEY, - created_at TIMESTAMP(6), - updated_at TIMESTAMP(6), - last_login_at TIMESTAMP(6) NOT NULL, - last_password_updated_at TIMESTAMP(6) NOT NULL, - birth_date VARCHAR(255), - detail_address VARCHAR(255), - email VARCHAR(255) NOT NULL, - gender VARCHAR(255), - name VARCHAR(255) NOT NULL, - password VARCHAR(255), - phone_number VARCHAR(255), - provider VARCHAR(255), - role VARCHAR(255), - status VARCHAR(255) NOT NULL, - street_address VARCHAR(255), - zip_code VARCHAR(255) -); - - -- 예매 CREATE TABLE IF NOT EXISTS booking diff --git a/db/initdb.d/data.sql b/db/initdb.d/2-data.sql similarity index 98% rename from db/initdb.d/data.sql rename to db/initdb.d/2-data.sql index 4c85e874..02156cbc 100644 --- a/db/initdb.d/data.sql +++ b/db/initdb.d/2-data.sql @@ -1,5 +1,5 @@ -- EventHall -INSERT INTO event_hall (event_name, address) +INSERT INTO event_hall (name, address) VALUES ('고척스카이돔', '서울 구로구 경인로 430'); -- Event diff --git a/docker-compose.yml b/docker-compose.yml index 01ef5165..7145b80c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,6 +4,7 @@ services: mysql: image: mysql:latest container_name: bingterpark + restart: always environment: MYSQL_ROOT_PASSWORD: root1234! MYSQL_DATABASE: bingterpark diff --git a/http/bingterpark.http b/http/bingterpark.http index 3171ecc9..4481b668 100644 --- a/http/bingterpark.http +++ b/http/bingterpark.http @@ -12,6 +12,7 @@ Content-Type: application/json ### 공연장 등록 POST http://localhost:8080/api/v1/event-halls Content-Type: application/json +Authorization: Bearer {{adminToken}} { "name": "잠실 종합운동장", @@ -35,6 +36,7 @@ Content-Type: application/json ### 공연 등록 POST http://localhost:8080/api/v1/events Content-Type: application/json +Authorization: Bearer {{adminToken}} { "title": "히사이시 조 영화음악 콘서트", @@ -52,6 +54,7 @@ Content-Type: application/json ### 공연 회차 생성 POST http://localhost:8080/api/v1/event-times/2 Content-Type: application/json +Authorization: Bearer {{adminToken}} { "round": 1, @@ -62,6 +65,7 @@ Content-Type: application/json ### 공연 좌석 구역 생성 POST http://localhost:8080/api/v1/events/2/seat-area Content-Type: application/json +Authorization: Bearer {{adminToken}} { "requests": [ @@ -79,6 +83,7 @@ Content-Type: application/json ### 공연 좌석 생성 POST http://localhost:8080/api/v1/event-seats/events/2 Content-Type: application/json +Authorization: Bearer {{adminToken}} [ { @@ -146,7 +151,7 @@ http://localhost:8081/login ### 내 정보 확인 GET http://localhost:8081/api/v1/members/me -Authorization: Bearer {{accessToken}} +Authorization: Bearer {{token}} ### 공연 목록 - 리뷰순 GET http://localhost:8080/api/v1/events/sort/ranking?page=1&size=10&genreType=CONCERT&dateOffset=7 diff --git a/img.png b/img.png new file mode 100644 index 00000000..aa74979f Binary files /dev/null and b/img.png differ