forked from codesquad-members-2021/sidedish
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from swing-park/feature-create-controller
Feat: controller를 만들어라
- Loading branch information
Showing
6 changed files
with
130 additions
and
0 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
...nd/sidedish/src/main/java/codsquad/team17/sidedish/controller/BestCategoryController.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,31 @@ | ||
package codsquad.team17.sidedish.controller; | ||
|
||
import codsquad.team17.sidedish.domain.Item; | ||
import codsquad.team17.sidedish.repository.ItemRepository; | ||
import org.springframework.http.HttpStatus; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
import java.util.List; | ||
|
||
@RestController | ||
@RequestMapping("/best") | ||
public class BestCategoryController { | ||
|
||
private final ItemRepository itemRepository; | ||
|
||
public BestCategoryController (ItemRepository itemRepository){ | ||
this.itemRepository = itemRepository; | ||
} | ||
|
||
|
||
@GetMapping | ||
public ResponseEntity getBestCategoryList(){ | ||
|
||
|
||
|
||
return new ResponseEntity("", HttpStatus.OK); | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
backend/sidedish/src/main/java/codsquad/team17/sidedish/dto/BestCategoryDto.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,19 @@ | ||
package codsquad.team17.sidedish.dto; | ||
|
||
import java.util.List; | ||
|
||
public class BestCategoryDto { | ||
private Long bestCategoryId; | ||
private String bestCategoryName; | ||
private List<ItemDto> items; | ||
|
||
private BestCategoryDto(){ | ||
|
||
} | ||
|
||
public BestCategoryDto(Long bestCategoryId, String bestCategoryName, List<ItemDto> items) { | ||
this.bestCategoryId = bestCategoryId; | ||
this.bestCategoryName = bestCategoryName; | ||
this.items = items; | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
backend/sidedish/src/main/java/codsquad/team17/sidedish/dto/ItemDto.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,35 @@ | ||
package codsquad.team17.sidedish.dto; | ||
|
||
import java.math.BigDecimal; | ||
import java.util.List; | ||
|
||
public class ItemDto { | ||
private Long itemId; | ||
private String title; | ||
private String discription; | ||
|
||
private BigDecimal n_price; | ||
private BigDecimal s_price; | ||
|
||
private List<String> badge; | ||
private String image; | ||
|
||
private Long dishCategory; | ||
|
||
public ItemDto(){ | ||
|
||
} | ||
|
||
public ItemDto(Long itemId, String title, String discription, BigDecimal n_price, BigDecimal s_price, List<String> badge, String image, Long dishCategory) { | ||
this.itemId = itemId; | ||
this.title = title; | ||
this.discription = discription; | ||
this.n_price = n_price; | ||
this.s_price = s_price; | ||
this.badge = badge; | ||
this.image = image; | ||
this.dishCategory = dishCategory; | ||
} | ||
|
||
|
||
} |
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
4 changes: 4 additions & 0 deletions
4
backend/sidedish/src/main/java/codsquad/team17/sidedish/service/BestCategoryService.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,4 @@ | ||
package codsquad.team17.sidedish.service; | ||
|
||
public class BestCategoryService { | ||
} |
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