Skip to content

Commit 5ebaf66

Browse files
committed
fix(manito): UI/UX 개선에 따른 변경사항 반영
1 parent e2133cb commit 5ebaf66

File tree

3 files changed

+15
-14
lines changed

3 files changed

+15
-14
lines changed

src/main/java/inha/gdgoc/domain/manito/controller/ManitoVerifyController.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import inha.gdgoc.domain.manito.dto.request.ManitoVerifyRequest;
44
import inha.gdgoc.domain.manito.dto.response.ManitoVerifyResponse;
5+
import inha.gdgoc.domain.manito.entity.ManitoAssignment;
56
import inha.gdgoc.domain.manito.service.ManitoUserService;
67
import inha.gdgoc.global.dto.response.ApiResponse;
78
import jakarta.validation.Valid;
@@ -21,8 +22,13 @@ public class ManitoVerifyController {
2122

2223
@PostMapping("/verify")
2324
public ResponseEntity<ApiResponse<ManitoVerifyResponse, Void>> verify(@Valid @RequestBody ManitoVerifyRequest request) {
24-
String cipher = manitoUserService.verifyAndGetCipher(request.sessionCode(), request.studentId(), request.pin());
25+
ManitoAssignment assignment = manitoUserService.verifyAndGetAssignment(request.sessionCode(), request.studentId(), request.pin());
2526

26-
return ResponseEntity.ok(ApiResponse.ok("마니또 정보 조회 성공", new ManitoVerifyResponse(cipher)));
27+
String cipher = assignment.getEncryptedManitto();
28+
String ownerName = assignment.getName();
29+
30+
ManitoVerifyResponse response = new ManitoVerifyResponse(cipher, ownerName);
31+
32+
return ResponseEntity.ok(ApiResponse.ok("마니또 정보 조회 성공", response));
2733
}
28-
}
34+
}
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
package inha.gdgoc.domain.manito.dto.response;
22

33
/**
4-
* 마니또 검증 성공 시, 클라이언트에서 복호화할 암호문을 내려주는 DTO
4+
* 마니또 검증 성공 시, 클라이언트에서 복호화할 암호문과
5+
* 요청자(=giver)의 이름을 내려주는 DTO
56
*/
67
public record ManitoVerifyResponse(
7-
8-
String encryptedManito
8+
String encryptedManito,
9+
String ownerName
910
) {
1011
}

src/main/java/inha/gdgoc/domain/manito/service/ManitoUserService.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,8 @@ public class ManitoUserService {
2222
private final PasswordEncoder passwordEncoder;
2323
private final ManitoPinPolicy manitoPinPolicy;
2424

25-
/**
26-
* pin 검증 후 암호문 반환
27-
*/
2825
@Transactional(readOnly = true)
29-
public String verifyAndGetCipher(String sessionCode, String studentId, String pinPlain) {
30-
31-
log.info("[MANITO] >>> verifyAndGetCipher CALLED (sessionCode={}, studentId={})", sessionCode, studentId);
26+
public ManitoAssignment verifyAndGetAssignment(String sessionCode, String studentId, String pinPlain) {
3227

3328
ManitoSession session = sessionRepository.findByCode(sessionCode)
3429
.orElseThrow(() -> new BusinessException(GlobalErrorCode.RESOURCE_NOT_FOUND, "세션 코드가 올바르지 않습니다."));
@@ -48,7 +43,6 @@ public String verifyAndGetCipher(String sessionCode, String studentId, String pi
4843
if (assignment.getEncryptedManitto() == null || assignment.getEncryptedManitto().isBlank()) {
4944
throw new BusinessException(GlobalErrorCode.RESOURCE_NOT_FOUND, "아직 마니또 암호문이 업로드되지 않았습니다. 관리자에게 문의하세요.");
5045
}
51-
52-
return assignment.getEncryptedManitto();
46+
return assignment;
5347
}
5448
}

0 commit comments

Comments
 (0)