Skip to content

Commit

Permalink
Fix: 상담 저장시 consultId가 return되도록 컨트롤러 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
suminiee authored May 10, 2024
2 parents e52234f + 1d43696 commit 5508b49
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
// .requestMatchers("/**").permitAll()
.requestMatchers("/api/login").permitAll()
.requestMatchers("/api/admin/changePw", "/api/admin").hasRole("ADMIN")
.requestMatchers("/api/drug", "/api/findDrug").hasRole("ADMIN")
.requestMatchers("/api/drug", "/api/findDrug", "/api/patient/consultDelete").hasRole("ADMIN")
.requestMatchers("/accountSettings", "/drugs").hasRole("ADMIN")
.anyRequest().authenticated()
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ public class ConsultController {

//주민 상담 내용 추가
@PostMapping("/patient/consult")
public ResponseEntity<?> postConsultInfo(@RequestBody ConsultRequestDto consultRequestDto) {
public ResponseEntity<Long> postConsultInfo(@RequestBody ConsultRequestDto consultRequestDto) {
try {
consultService.save(consultRequestDto);
return ResponseEntity.status(HttpStatus.CREATED).body("consult content 저장 완료");
Long consultId = consultService.save(consultRequestDto);
return ResponseEntity.status(HttpStatus.CREATED).body(consultId);
} catch (Exception e) {
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body("consult content 저장 중 오류 발생 " + e.getMessage());
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(-1L);
}
}

Expand Down

0 comments on commit 5508b49

Please sign in to comment.