Skip to content

Commit

Permalink
Refactor: 더미데이터 수정 및 Swagger 조회 편의성을 위한 개선 (#225)
Browse files Browse the repository at this point in the history
* feat: getAssignedMemberId가 null일때 nullpointException 방지

* refactor: 더미데이터 구조 변경 및 추가

* refactor: 코드 자동 리팩터링
  • Loading branch information
GitJIHO authored Nov 12, 2024
1 parent 169f884 commit 4d21f97
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 36 deletions.
20 changes: 20 additions & 0 deletions src/main/java/com/example/sinitto/common/dummy/InitialData.java
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,26 @@ protected void initial() {
callbackRepository.save(new Callback(Callback.Status.COMPLETE, senior11));
callbackRepository.save(new Callback(Callback.Status.WAITING, senior11));

callbackRepository.save(new Callback(Callback.Status.WAITING, senior12));
callbackRepository.save(new Callback(Callback.Status.WAITING, senior13));
callbackRepository.save(new Callback(Callback.Status.WAITING, senior14));
callbackRepository.save(new Callback(Callback.Status.WAITING, senior15));
callbackRepository.save(new Callback(Callback.Status.WAITING, senior16));
callbackRepository.save(new Callback(Callback.Status.WAITING, senior17));
callbackRepository.save(new Callback(Callback.Status.WAITING, senior18));
callbackRepository.save(new Callback(Callback.Status.WAITING, senior19));
callbackRepository.save(new Callback(Callback.Status.WAITING, senior20));
callbackRepository.save(new Callback(Callback.Status.WAITING, senior21));
callbackRepository.save(new Callback(Callback.Status.WAITING, senior22));
callbackRepository.save(new Callback(Callback.Status.WAITING, senior23));
callbackRepository.save(new Callback(Callback.Status.WAITING, senior24));
callbackRepository.save(new Callback(Callback.Status.WAITING, senior25));
callbackRepository.save(new Callback(Callback.Status.WAITING, senior26));
callbackRepository.save(new Callback(Callback.Status.WAITING, senior27));
callbackRepository.save(new Callback(Callback.Status.WAITING, senior28));
callbackRepository.save(new Callback(Callback.Status.WAITING, senior29));
callbackRepository.save(new Callback(Callback.Status.WAITING, senior30));

//리뷰
reviewRepository.save(new Review(5, 4, 5, "테스트용 리뷰 1", guard1));
reviewRepository.save(new Review(5, 2, 2, "테스트용 리뷰 2", guard2));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public List<GuardGuidelineResponse> readAllGuardGuidelinesByCategoryAndCallback(
Callback callback = callbackRepository.findById(callbackId)
.orElseThrow(() -> new NotFoundException("존재하지 않는 콜백입니다"));

if (!callback.getStatus().equals(Callback.Status.WAITING.name()) && !callback.getAssignedMemberId().equals(memberId)) {
if (!callback.getStatus().equals(Callback.Status.WAITING.name()) && (callback.getAssignedMemberId() == null || !callback.getAssignedMemberId().equals(memberId))) {
throw new BadRequestException("해당 콜백은 대기 상태가 아니고, 배정된 시니또가 아닙니다.");
}

Expand Down
70 changes: 36 additions & 34 deletions src/main/resources/static/css/header.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,39 +16,41 @@ body {
justify-content: space-between;
align-items: center;

.header h1 {
margin: 0;
font-size: 24px;
font-weight: 600;
.header h1 {
margin: 0;
font-size: 24px;
font-weight: 600;
}


nav {
display: flex;
gap: 15px;
justify-content: flex-end;
}

button {
background-color: rgba(52, 87, 217, 0.8);
color: #ffffff;
border: none;
padding: 10px 20px;
font-size: 14px;
cursor: pointer;
border-radius: 4px;
transition: background-color 0.3s, transform 0.2s;
}

button:hover {
background-color: rgba(52, 87, 217, 0.93);
transform: scale(1.03);
}

button:active {
background-color: #00473c;
}

form {
display: inline;
}
}


nav {
display: flex;
gap: 15px;
justify-content: flex-end;
}

button {
background-color: rgba(52, 87, 217, 0.8);
color: #ffffff;
border: none;
padding: 10px 20px;
font-size: 14px;
cursor: pointer;
border-radius: 4px;
transition: background-color 0.3s, transform 0.2s;
}

button:hover {
background-color: rgba(52, 87, 217, 0.93);
transform: scale(1.03);
}

button:active {
background-color: #00473c;
}

form {
display: inline;
}
2 changes: 1 addition & 1 deletion src/main/resources/templates/point/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ <h1>Admin Login</h1>

<script>
// 페이지가 로드되었을 때, 쿼리 파라미터에 'error'가 있으면 오류 메시지 표시
window.onload = function() {
window.onload = function () {
const urlParams = new URLSearchParams(window.location.search);
if (urlParams.has('error')) {
document.getElementById("errorMessage").textContent = '로그인 정보를 다시 확인해주세요';
Expand Down

0 comments on commit 4d21f97

Please sign in to comment.