-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
454 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
src/main/java/com/drinkeg/drinkeg/domain/wine/controller/AdminWineController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package com.drinkeg.drinkeg.domain.wine.controller; | ||
|
||
import com.drinkeg.drinkeg.domain.wine.service.AdminWineService; | ||
import com.drinkeg.drinkeg.global.apipayLoad.ApiResponse; | ||
import com.opencsv.exceptions.CsvException; | ||
import io.swagger.v3.oas.annotations.Operation; | ||
import io.swagger.v3.oas.annotations.tags.Tag; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.web.bind.annotation.PostMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
import java.io.IOException; | ||
|
||
@Tag(name = "Wine Admin", description = "와인 관리자 API") | ||
@RestController | ||
@RequiredArgsConstructor | ||
public class AdminWineController { | ||
private final AdminWineService adminWineService; | ||
|
||
// 와인 이미지 업로드 | ||
@PostMapping("/admin/wine/img/db") | ||
@Operation( | ||
summary = "와인 이미지 업로드 후 데이터베이스에 저장", | ||
description = "와인 이미지 파일은 있지만 데이터베이스에는 없는 와인에 대해 업데이트 하기 위한 API" | ||
) | ||
public ApiResponse<?> uploadWineImageDB() { | ||
try { | ||
adminWineService.uploadWineImage(); | ||
} catch (IOException e) { | ||
throw new RuntimeException(e); | ||
} | ||
return ApiResponse.onSuccess("업로드 후 DB저장 성공"); | ||
} | ||
|
||
// 와인 이미지 업로드 | ||
@PostMapping("/admin/wine/img/csv") | ||
@Operation( | ||
summary = "와인 이미지 업로드 후 csv에 url 저장", | ||
description = "csv에서 받아온 와인들에 대해 와인 이미지 업로드 후 csv에 url 저장" | ||
) | ||
public ApiResponse<?> uploadWineImageCSV() { | ||
try { | ||
adminWineService.uploadWineImageCSV(); | ||
} catch (IOException | CsvException e) { | ||
throw new RuntimeException(e); | ||
} | ||
return ApiResponse.onSuccess("업로드 후 csv저장 성공"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
src/main/java/com/drinkeg/drinkeg/domain/wine/dto/response/HomeWineResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Oops, something went wrong.