Skip to content

Commit

Permalink
Merge pull request #32 from GApple-T/consulting
Browse files Browse the repository at this point in the history
πŸ”€::μƒλ‹΄ν™•μΈμ„œ μ‚­μ œ 둜직 개발
  • Loading branch information
enbraining authored Dec 18, 2023
2 parents ddd3e80 + 07f4342 commit 91df585
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public ResponseEntity<ConsultingShowResponse> showConsulting(){
return consultingService.showConsulting();
}

@GetMapping("/cancle")
@DeleteMapping("/cancle")
public ResponseEntity<ConsultingCancleResponse> cancleConsulting(@Valid @RequestBody ConsultingCancleRequest request){
return consultingService.cancleConsulting(request);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
import jakarta.validation.constraints.NotBlank;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

@Getter
@NoArgsConstructor
@AllArgsConstructor
public class ConsultingCancleRequest {
@NotBlank
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,7 @@

public interface ConsultingRepository extends JpaRepository<Consulting, Long> {

void removeById(UUID consultingId);
void deleteById(UUID id);

Consulting findById(UUID id);
}
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,15 @@ public ResponseEntity<ConsultingShowResponse> showConsulting() {
consulting.getClassTime(),
consulting.getDescription())));

return ResponseEntity.ok().body(new ConsultingShowResponse(consultingResponses, "okay"));
return ResponseEntity.ok().body(new ConsultingShowResponse(consultingResponses, "ok"));
}

@Override
@Transactional
public ResponseEntity<ConsultingCancleResponse> cancleConsulting(ConsultingCancleRequest request) {
consultingRepository.removeById(UUID.fromString(request.getConsultingId()));
// Consulting consulting = consultingRepository.findById(UUID.fromString(request.getConsultingId()));
// consultingRepository.delete(consulting);
consultingRepository.deleteById(UUID.fromString(request.getConsultingId()));
return ResponseEntity.ok().body(new ConsultingCancleResponse("ok"));
}
}
2 changes: 1 addition & 1 deletion src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ spring:
open-in-view: false
hibernate:
dialect: org.hibernate.dialect.PostgreSQLDialect
ddl-auto: create-drop
ddl-auto: update
properties:
hibernate:format_sql: true
show-sql: true
Expand Down

0 comments on commit 91df585

Please sign in to comment.