Skip to content
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

[deploy] merge to main #109

Merged
merged 48 commits into from
Jul 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
87ec61c
[deploy] merge to develop (#27)
hoonyworld Jul 11, 2024
2f62a58
[feat] #28 - 비회원 예매 조회 POST API 구현 (#29)
hoonyworld Jul 11, 2024
b802e51
[feat] #30 - SwaggerConfig 및 WebConfig 구현 (#31)
hoonyworld Jul 11, 2024
b50cec3
HOTFIX(workflows): push 이벤트 시 github action이 빌드 되지 않도록 수정
hoonyworld Jul 11, 2024
84e7f8b
Merge branch 'develop' of https://github.com/TEAM-BEAT/BEAT-SERVER in…
hoonyworld Jul 11, 2024
6e279c8
HOTFIX(Jenkinsfile): 포트 수정
hoonyworld Jul 11, 2024
3c3cb9f
[feat] #32 - 티켓 예매 가능 여부 GET API 구현 (#33)
hoonyworld Jul 11, 2024
f4d1c20
[feat] #17 - 카카오 소셜 로그인 API 구현 (#36)
hyerinhwang-sailin Jul 13, 2024
467dab0
[feat] #34 - 비회원 예매 POST API 구현 (#35)
hoonyworld Jul 14, 2024
f55e023
[Refactor] #37 - 카카오 로그인 API response 수정 (#39)
hyerinhwang-sailin Jul 14, 2024
550a64d
[feat] #40 - 소개 관련 공연 정보 조회 GET API 구현 (#41)
hyerinhwang-sailin Jul 14, 2024
295172c
[feat] #42 - 예매 관련 공연 정보 GET API 구현 (#43)
hyerinhwang-sailin Jul 14, 2024
86e4f6d
[feat] #38 - 회원 예매 POST API 구현 (#45)
hoonyworld Jul 14, 2024
911c751
[feat] #44 - 홈페이지 공연 및 홍보 조회 GET API 구현 (#47)
hyerinhwang-sailin Jul 14, 2024
6f28c55
[feat] #46 - 회원 예매 조회 GET API 구현 (#48)
hoonyworld Jul 14, 2024
b90138d
[feat] #49 - 예매자 관리 API 구현 (#51)
hyerinhwang-sailin Jul 15, 2024
f37c9e3
HOTFIX(SecurityConfig): WHITELIST 경로명 수정
hoonyworld Jul 15, 2024
3ab2765
[fix] #52 - auth whitelist 수정 (#53)
hyerinhwang-sailin Jul 15, 2024
ef2d34f
[feat] #54 - 등록한 공연 목록 조회 GET API 구현 (#55)
hyerinhwang-sailin Jul 15, 2024
33e9d39
[fix] #58 - dev-ci.yml, prod-ci.yml 환경변수 추가 (#59)
hoonyworld Jul 15, 2024
3a49335
[refactor] #61 - Performance Entity field 추가 (#62)
hyerinhwang-sailin Jul 15, 2024
9728233
[feat] #63 - healthCheckController 생성 (#64)
hoonyworld Jul 16, 2024
e7b4646
Merge branch 'main' into develop
hoonyworld Jul 16, 2024
8312edb
[feat] #63 - health check URL 화이트리스트에 등록 (#67)
hoonyworld Jul 16, 2024
f199715
[fix] #57 - entity 연관관계 설정 SecurityConfig 수정 (#65)
hyerinhwang-sailin Jul 16, 2024
e37a2ea
Merge branch 'main' into develop
hoonyworld Jul 16, 2024
3a92f78
[fix] #57 - security 관련 에러 대응 (#71)
hyerinhwang-sailin Jul 16, 2024
02becc3
Merge branch 'main' into develop
hoonyworld Jul 16, 2024
4a414f7
[fix] #73 - security 수정 (#74)
hyerinhwang-sailin Jul 16, 2024
d079aec
Merge branch 'main' into develop
hoonyworld Jul 16, 2024
585cea3
[#76] fix(SecurityConfig): Base64 인코딩을 하도록 변경 (#77)
hoonyworld Jul 16, 2024
4c20f1c
Merge branch 'main' into develop
hoonyworld Jul 16, 2024
1b51be8
[fix] #76 - 누락된 코드 추가 (#79)
hoonyworld Jul 16, 2024
6da3238
[#81] fix(JwtTokenProvider): jwtsecret을 인코딩하고 디코딩을 하도록 수정 (#82)
hoonyworld Jul 16, 2024
d692f76
Merge branch 'main' into develop
hoonyworld Jul 16, 2024
e93fc8f
[#85] chore(application.yml): 환경변수 설정 (#86)
hoonyworld Jul 16, 2024
e23659f
[chore] #88 - 레디스 환경변수 추가 (#89)
hoonyworld Jul 16, 2024
f519b0c
[deploy] merge to main (#90)
hoonyworld Jul 16, 2024
ade47e5
Revert "[deploy] merge to main (#90)" (#91)
hoonyworld Jul 16, 2024
53ec218
[fix] #93 - 누락된 어노테이션 및 누락된 경로명 추가 (#94)
hoonyworld Jul 16, 2024
56a98f3
[bug] #84 - actuator/health 의존성 및 설정 추가 (#96)
hyerinhwang-sailin Jul 17, 2024
b43b8d6
Merge branch 'main' into develop
hyerinhwang-sailin Jul 17, 2024
965a53b
[#84] chore: yml 수정 (#99)
hyerinhwang-sailin Jul 17, 2024
350199a
[bug] #101 - yml, s3 수정 (#102)
hyerinhwang-sailin Jul 17, 2024
4a1c7b2
HOTIFX: prod ci-yml 수정
hoonyworld Jul 17, 2024
1eab73f
Merge branch 'main' into develop
hoonyworld Jul 17, 2024
66585cb
Main redis host yml 수정 (#105)
hyerinhwang-sailin Jul 17, 2024
af6a923
[feat] #50 - 공연 생성 POST API 생성 (#108)
hoonyworld Jul 17, 2024
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
2 changes: 2 additions & 0 deletions .github/workflows/prod-CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ name: prod-CI
on:
pull_request:
branches: [ "main" ]
push:
branches: [ "main" ]

jobs:
prod-ci:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.beat.domain.performance.api;

import com.beat.domain.performance.application.PerformanceService;
import com.beat.domain.performance.application.dto.HomeRequest;
import com.beat.domain.performance.application.dto.HomeResponse;
import com.beat.domain.performance.application.dto.home.HomeRequest;
import com.beat.domain.performance.application.dto.home.HomeResponse;
import com.beat.domain.performance.domain.Genre;
import com.beat.domain.performance.exception.PerformanceSuccessCode;
import com.beat.global.common.dto.SuccessResponse;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
package com.beat.domain.performance.api;

import com.beat.domain.performance.application.PerformanceCreateService;
import com.beat.domain.performance.application.dto.BookingPerformanceDetailResponse;
import com.beat.domain.performance.application.dto.MakerPerformanceResponse;
import com.beat.domain.performance.application.dto.PerformanceDetailResponse;
import com.beat.domain.performance.application.dto.create.PerformanceRequest;
import com.beat.domain.performance.application.dto.create.PerformanceResponse;
import com.beat.domain.performance.exception.PerformanceSuccessCode;
import com.beat.domain.performance.application.PerformanceService;
import com.beat.global.auth.annotation.CurrentMember;
import com.beat.global.common.dto.SuccessResponse;
import io.swagger.v3.oas.annotations.Operation;
import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

Expand All @@ -21,6 +27,17 @@
public class PerformanceController {

private final PerformanceService performanceService;
private final PerformanceCreateService performanceCreateService;

@Operation(summary = "공연 생성 API", description = "공연을 생성하는 POST API입니다.")
@PostMapping
public ResponseEntity<SuccessResponse<PerformanceResponse>> createPerformance(
@CurrentMember Long userId,
@RequestBody PerformanceRequest performanceRequest) {
PerformanceResponse response = performanceCreateService.createPerformance(userId, performanceRequest);
return ResponseEntity.status(HttpStatus.CREATED)
.body(SuccessResponse.of(PerformanceSuccessCode.PERFORMANCE_CREATE_SUCCESS, response));
}

@Operation(summary = "공연 상세정보 조회 API", description = "공연 상세페이지의 공연 상세정보를 조회하는 GET API입니다.")
@GetMapping("/detail/{performanceId}")
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
package com.beat.domain.performance.application;

import com.beat.domain.cast.dao.CastRepository;
import com.beat.domain.cast.domain.Cast;
import com.beat.domain.performance.application.dto.create.CastResponse;
import com.beat.domain.performance.application.dto.create.PerformanceRequest;
import com.beat.domain.performance.application.dto.create.PerformanceResponse;
import com.beat.domain.performance.application.dto.create.ScheduleResponse;
import com.beat.domain.performance.application.dto.create.StaffResponse;
import com.beat.domain.performance.dao.PerformanceRepository;
import com.beat.domain.performance.domain.Performance;
import com.beat.domain.schedule.dao.ScheduleRepository;
import com.beat.domain.schedule.domain.Schedule;
import com.beat.domain.staff.dao.StaffRepository;
import com.beat.domain.staff.domain.Staff;
import com.beat.domain.user.dao.UserRepository;
import com.beat.domain.user.domain.Users;
import com.beat.domain.user.exception.UserErrorCode;
import com.beat.global.common.exception.NotFoundException;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.time.LocalDate;
import java.time.temporal.ChronoUnit;
import java.util.List;
import java.util.stream.Collectors;

@Service
@RequiredArgsConstructor
public class PerformanceCreateService {

private final PerformanceRepository performanceRepository;
private final ScheduleRepository scheduleRepository;
private final UserRepository userRepository;
private final CastRepository castRepository;
private final StaffRepository staffRepository;

@Transactional
public PerformanceResponse createPerformance(Long userId, PerformanceRequest request) {
Users user = userRepository.findById(userId)
.orElseThrow(() -> new NotFoundException(UserErrorCode.USER_NOT_FOUND));

Performance performance = Performance.create(
request.performanceTitle(),
request.genre(),
request.runningTime(),
request.performanceDescription(),
request.performanceAttentionNote(),
request.bankName(),
request.accountNumber(),
request.accountHolder(),
request.posterImage(),
request.performanceTeamName(),
request.performanceVenue(),
request.performanceContact(),
request.performancePeriod(),
request.ticketPrice(),
request.totalScheduleCount(),
user
);
performanceRepository.save(performance);

List<Schedule> schedules = request.scheduleList().stream()
.map(scheduleRequest -> Schedule.create(
scheduleRequest.performanceDate(),
scheduleRequest.totalTicketCount(),
0,
true,
scheduleRequest.scheduleNumber(),
performance
))
.collect(Collectors.toList());
scheduleRepository.saveAll(schedules);

List<Cast> casts = request.castList().stream()
.map(castRequest -> Cast.create(
castRequest.castName(),
castRequest.castRole(),
castRequest.castPhoto(),
performance
))
.collect(Collectors.toList());
castRepository.saveAll(casts);

List<Staff> staffs = request.staffList().stream()
.map(staffRequest -> Staff.create(
staffRequest.staffName(),
staffRequest.staffRole(),
staffRequest.staffPhoto(),
performance
))
.collect(Collectors.toList());
staffRepository.saveAll(staffs);

return mapToPerformanceResponse(performance, schedules, casts, staffs);
}

private PerformanceResponse mapToPerformanceResponse(Performance performance, List<Schedule> schedules, List<Cast> casts, List<Staff> staffs) {
List<ScheduleResponse> scheduleResponses = schedules.stream()
.map(schedule -> ScheduleResponse.of(
schedule.getId(),
schedule.getPerformanceDate(),
schedule.getTotalTicketCount(),
calculateDueDate(schedule.getPerformanceDate().toLocalDate()),
schedule.getScheduleNumber()
))
.collect(Collectors.toList());

List<CastResponse> castResponses = casts.stream()
.map(cast -> CastResponse.of(
cast.getId(),
cast.getCastName(),
cast.getCastRole(),
cast.getCastPhoto()
))
.collect(Collectors.toList());

List<StaffResponse> staffResponses = staffs.stream()
.map(staff -> StaffResponse.of(
staff.getId(),
staff.getStaffName(),
staff.getStaffRole(),
staff.getStaffPhoto()
))
.collect(Collectors.toList());

return PerformanceResponse.of(
performance.getUsers().getId(),
performance.getId(),
performance.getPerformanceTitle(),
performance.getGenre(),
performance.getRunningTime(),
performance.getPerformanceDescription(),
performance.getPerformanceAttentionNote(),
performance.getBankName(),
performance.getAccountNumber(),
performance.getAccountHolder(),
performance.getPosterImage(),
performance.getPerformanceTeamName(),
performance.getPerformanceVenue(),
performance.getPerformanceContact(),
performance.getPerformancePeriod(),
performance.getTicketPrice(),
performance.getTotalScheduleCount(),
scheduleResponses,
castResponses,
staffResponses
);
}

private int calculateDueDate(LocalDate performanceDate) {
return (int) ChronoUnit.DAYS.between(LocalDate.now(), performanceDate);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
import com.beat.domain.member.domain.Member;
import com.beat.domain.member.exception.MemberErrorCode;
import com.beat.domain.performance.application.dto.*;
import com.beat.domain.performance.application.dto.home.HomePerformanceDetail;
import com.beat.domain.performance.application.dto.home.HomePromotionDetail;
import com.beat.domain.performance.application.dto.home.HomeRequest;
import com.beat.domain.performance.application.dto.home.HomeResponse;
import com.beat.domain.performance.dao.PerformanceRepository;
import com.beat.domain.performance.domain.Performance;
import com.beat.domain.performance.exception.PerformanceErrorCode;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.beat.domain.performance.application.dto.create;

public record CastRequest(
String castName,
String castRole,
String castPhoto
) {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package com.beat.domain.performance.application.dto.create;

public record CastResponse(
Long castId,
String castName,
String castRole,
String castPhoto
) {
public static CastResponse of(
Long castId,
String castName,
String castRole,
String castPhoto
) {
return new CastResponse(
castId,
castName,
castRole,
castPhoto
);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package com.beat.domain.performance.application.dto.create;

import com.beat.domain.performance.domain.BankName;
import com.beat.domain.performance.domain.Genre;

import java.util.List;

public record PerformanceRequest(
String performanceTitle,
Genre genre,
int runningTime,
String performanceDescription,
String performanceAttentionNote,
BankName bankName,
String accountNumber,
String accountHolder,
String posterImage,
String performanceTeamName,
String performanceVenue,
String performanceContact,
String performancePeriod,
int ticketPrice,
int totalScheduleCount,
List<ScheduleRequest> scheduleList,
List<CastRequest> castList,
List<StaffRequest> staffList
) {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
package com.beat.domain.performance.application.dto.create;

import com.beat.domain.performance.domain.BankName;
import com.beat.domain.performance.domain.Genre;

import java.util.List;

public record PerformanceResponse(
Long userId,
Long performanceId,
String performanceTitle,
Genre genre,
int runningTime,
String performanceDescription,
String performanceAttentionNote,
BankName bankName,
String accountNumber,
String accountHolder,
String posterImage,
String performanceTeamName,
String performanceVenue,
String performanceContact,
String performancePeriod,
int ticketPrice,
int totalScheduleCount,
List<ScheduleResponse> scheduleList,
List<CastResponse> castList,
List<StaffResponse> staffList
) {
public static PerformanceResponse of(
Long userId,
Long performanceId,
String performanceTitle,
Genre genre,
int runningTime,
String performanceDescription,
String performanceAttentionNote,
BankName bankName,
String accountNumber,
String accountHolder,
String posterImage,
String performanceTeamName,
String performanceVenue,
String performanceContact,
String performancePeriod,
int ticketPrice,
int totalScheduleCount,
List<ScheduleResponse> scheduleList,
List<CastResponse> castList,
List<StaffResponse> staffList
) {
return new PerformanceResponse(
userId,
performanceId,
performanceTitle,
genre,
runningTime,
performanceDescription,
performanceAttentionNote,
bankName,
accountNumber,
accountHolder,
posterImage,
performanceTeamName,
performanceVenue,
performanceContact,
performancePeriod,
ticketPrice,
totalScheduleCount,
scheduleList,
castList,
staffList
);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.beat.domain.performance.application.dto.create;

import com.beat.domain.schedule.domain.ScheduleNumber;

import java.time.LocalDateTime;

public record ScheduleRequest(
LocalDateTime performanceDate,
int totalTicketCount,
ScheduleNumber scheduleNumber
) {}
Loading
Loading