Skip to content

Commit

Permalink
#10/응모 이외 클래스 삭제
Browse files Browse the repository at this point in the history
  • Loading branch information
gugbab2 committed Jan 8, 2025
1 parent d505dbb commit 65ec955
Show file tree
Hide file tree
Showing 23 changed files with 57 additions and 677 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
package com.gugbab2.productdraw.controller;

import com.gugbab2.productdraw.domain.entity.Draw;
import com.gugbab2.productdraw.domain.entity.Entrant;
import com.gugbab2.productdraw.domain.entity.Payment;
import com.gugbab2.productdraw.domain.service.DrawService;
import com.gugbab2.productdraw.dto.DrawDto;
import com.gugbab2.productdraw.dto.PaymentDto;
import com.gugbab2.productdraw.exception.EntrantNotFoundException;
import com.gugbab2.productdraw.exception.ProductNotFoundException;
import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
Expand All @@ -22,21 +17,21 @@ public class DrawController {

private final DrawService drawService;

// 응모 제출
@PostMapping("/submit")
public ResponseEntity<?> createDraw(@RequestBody DrawDto.CreateDrawDto drawDto) {
try {
Draw entry = drawService.createDraw(drawDto.getEntrantId(), drawDto.getProductId());
return new ResponseEntity<>(entry, HttpStatus.CREATED);
} catch (EntrantNotFoundException | ProductNotFoundException e) {
return new ResponseEntity<>(e.getMessage(), HttpStatus.NOT_FOUND);
}
}

// 응모 결과 발표
@PostMapping("/{productId}result")
public ResponseEntity<List<Entrant>> announceWinners(@PathVariable String productId) {
List<Entrant> entrants = drawService.announceResult(productId);
return new ResponseEntity<>(entrants, HttpStatus.OK);
}
// 응모 제출(프론트엔드 서버)
// @PostMapping("/submit")
// public ResponseEntity<?> createDraw(@RequestBody DrawDto.CreateDrawDto drawDto) {
// try {
// Draw entry = drawService.createDraw(drawDto.getEntrantId(), drawDto.getProductId());
// return new ResponseEntity<>(entry, HttpStatus.CREATED);
// } catch (EntrantNotFoundException | ProductNotFoundException e) {
// return new ResponseEntity<>(e.getMessage(), HttpStatus.NOT_FOUND);
// }
// }
//
// // 응모 결과 발표(어드민 서버)
// @PostMapping("/{productId}/result")
// public ResponseEntity<List<Entrant>> announceWinners(@PathVariable String productId) {
// List<Entrant> entrants = drawService.announceResult(productId);
// return new ResponseEntity<>(entrants, HttpStatus.OK);
// }
}

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.gugbab2.productdraw.domain.repository.inmemory;

import com.gugbab2.productdraw.domain.entity.Draw;
import com.gugbab2.productdraw.domain.entity.Entrant;
import com.gugbab2.productdraw.domain.repository.DrawRepository;
import com.gugbab2.productdraw.domain.vo.WinnerStatus;
import org.springframework.stereotype.Repository;
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 65ec955

Please sign in to comment.