Skip to content

Commit

Permalink
feat: 이미지 S3버킷에 업로드하는 API 작성
Browse files Browse the repository at this point in the history
  • Loading branch information
k000927 committed Aug 13, 2024
1 parent 1b0001e commit 9a6a4fb
Showing 1 changed file with 22 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import JGS.CasperEvent.domain.event.dto.RequestDto.AdminRequestDto;
import JGS.CasperEvent.domain.event.dto.RequestDto.lotteryEventDto.LotteryEventRequestDto;
import JGS.CasperEvent.domain.event.dto.RequestDto.rushEventDto.RushEventRequestDto;
import JGS.CasperEvent.domain.event.dto.ResponseDto.ImageUrlResponseDto;
import JGS.CasperEvent.domain.event.dto.ResponseDto.lotteryEventResponseDto.LotteryEventDetailResponseDto;
import JGS.CasperEvent.domain.event.dto.ResponseDto.lotteryEventResponseDto.LotteryEventResponseDto;
import JGS.CasperEvent.domain.event.dto.ResponseDto.lotteryEventResponseDto.LotteryEventParticipantsListResponseDto;
Expand Down Expand Up @@ -36,6 +37,16 @@ public ResponseEntity<ResponseDto> postAdmin(@RequestBody @Valid AdminRequestDto
.body(adminService.postAdmin(adminRequestDto));
}

// 이미지 업로드
@PostMapping("/image")
public ResponseEntity<ImageUrlResponseDto> postImage(
@RequestPart(value = "image") MultipartFile image){
return ResponseEntity
.status(HttpStatus.CREATED)
.body(adminService.postImage(image));

}

// 추첨 이벤트 조회
@GetMapping("/event/lottery")
public ResponseEntity<LotteryEventDetailResponseDto> getLotteryEvent() {
Expand Down Expand Up @@ -84,7 +95,6 @@ public ResponseEntity<List<AdminRushEventResponseDto>> getRushEvents() {
.body(adminService.getRushEvents());
}


// 선착순 이벤트 참여자 조회
@GetMapping("/event/rush/{rushEventId}/participants")
public ResponseEntity<RushEventParticipantsListResponseDto> getRushEventParticipants(
Expand All @@ -98,6 +108,17 @@ public ResponseEntity<RushEventParticipantsListResponseDto> getRushEventParticip
.body(adminService.getRushEventParticipants(rushEventId, size, page, option, phoneNumber));
}

// 선착순 이벤트 수정
@PutMapping("/event/rush")
public ResponseEntity<List<AdminRushEventResponseDto>> updateRushEvent(
@RequestPart(name = "json") List<RushEventRequestDto> rushEventListRequestDto,
@RequestPart(name = "images") List<MultipartFile> images
) {
return ResponseEntity
.status(HttpStatus.OK)
.body(adminService.updateRushEvents(rushEventListRequestDto, images));
}

// 추첨 이벤트 삭제
@DeleteMapping("/event/lottery")
public ResponseEntity<Void> deleteLotteryEvent() {
Expand Down

0 comments on commit 9a6a4fb

Please sign in to comment.