code stringlengths 41 34.3k | lang stringclasses 8
values | review stringlengths 1 4.74k |
|---|---|---|
@@ -0,0 +1,75 @@
+package christmas.global.view.io;
+
+import christmas.domain.badge.Enum.EventBadge;
+import christmas.domain.sale.BenefitDetails;
+import christmas.domain.sale.enums.Giveaway;
+import christmas.global.view.output.OutputView;
+
+import static christmas.global.view.message.PriceMessage.getDiscountPriceM... | Java | P5: benefitDetails๋ฅผ ํ๋๋ก ๋๊ณ , ์ด๋ ๊ฒ showResult() ์์์ ์ฌ์ฉํ๋ ์ฝ๋๊ฐ ๊น๋ํด์ง๊ณ ์ข๋ค์ ๐ ๐ |
@@ -0,0 +1,39 @@
+package christmas.domain.badge.Enum;
+
+import static christmas.global.exception.CommonExceptionMessage.UNEXPECTED_EXCEPTION;
+
+public enum EventBadge {
+ NONE("์์", 0)
+ ,STAR("๋ณ", 5_000)
+ ,TREE("ํธ๋ฆฌ", 10_000)
+ ,SANTA("์ฐํ", 20_000)
+ ;
+
+ private final String badge;
+ private ... | Java | P4: ์ ์ ๋ฉ์๋์์ ์ ํจ์ฑ ๊ฒ์ฆ์ ํ๋ฒ ๋ ๊ฑฐ์น๋ ๊ฒ ์ ๋ง ๊ผผ๊ผผํ๊ณ ์ข๋ค์ ๐
P4: 22~31๋ผ์ธ์ ๋ค์ค if ๋ฌธ์ enum์ ๊ธฐ๋ฅ์ ํ์ฉํด์ ํด๊ฒฐ ํ ์ ์์ง ์์๊น์? ๐ |
@@ -0,0 +1,38 @@
+package christmas.global.config;
+
+import christmas.domain.EventController;
+import christmas.domain.calendar.EventCalendar;
+import christmas.domain.order.Orders;
+import christmas.domain.sale.BenefitDetails;
+import christmas.domain.sale.ChristmasDDaySale;
+import christmas.domain.sale.SaleDetails;... | Java | P3: ์ฐ๊ด๊ด๊ณ ์ ๋ณด๊ฐ ์์ ํ ๋ถ๋ฆฌ๋์ง ์์ ๊ฒ ๊ฐ์์..!
์ฝ๋ ์์์๋ง ๋ถ๋ฆฌํ ๊ฑฐ๋ผ๋ฉด Application์ชฝ์ ๋ฉ์๋๋ก๋ง ๋ถ๋ฆฌํด๋ ์ถฉ๋ถํ ๊ฑฐ ๊ฐ๊ณ , ์ง๊ธ์ฒ๋ผ Dependency ํ์ผ์ ์์ ๋ฐ๋ก ๋บ ๊ฑฐ๋ผ๋ฉด, Orders๊ฐ ์์ ์ ์ธ์คํด์ค๊ฐ ๋ฌด์์ธ์ง ์ ํ ์์ง ๋ชปํ๊ฒ ๋ฐ์์ ์ฃผ์
ํ๋๋ก ๋ง๋ค์ด์ฃผ๋๊ฒ ์ข์ ๊ฒ ๊ฐ์์. |
@@ -1,7 +1,16 @@
package christmas;
+import christmas.config.Dependency;
+
public class Application {
public static void main(String[] args) {
- // TODO: ํ๋ก๊ทธ๋จ ๊ตฌํ
+
+ try {
+ EventPlanner eventPlanner = Dependency.eventPlannner();
+ eventPlanner.run();
+ } catch (Excep... | Java | P5: ์๊ตฌ์ฌํญ์ด ๋ค ๊ตฌํ๋์ง ์์ ๊ฒ ๊ฐ์์ ๐ญ ... |
@@ -1,7 +1,16 @@
package christmas;
+import christmas.config.Dependency;
+
public class Application {
public static void main(String[] args) {
- // TODO: ํ๋ก๊ทธ๋จ ๊ตฌํ
+
+ try {
+ EventPlanner eventPlanner = Dependency.eventPlannner();
+ eventPlanner.run();
+ } catch (Excep... | Java | P5: ์ง์ง ์ฌ์ํ ๊ฑด๋ฐ์.
์ด ๊ณต๋ฐฑ ์ถ๋ ฅ์ ์๋ฏธ...๋ ๋ญ๊น์?... ๐ค ... |
@@ -0,0 +1,42 @@
+package christmas.domain;
+
+import christmas.constant.Calendar;
+import christmas.constant.FoodName;
+import christmas.validator.DateValidator;
+import christmas.view.InputView;
+import christmas.view.OutputView;
+
+public class Date {
+ int date;
+
+ public void saveDate(){
+ String inp... | Java | P2: `Date`๊ฐ ๋จ์ ๊ฐํ์
์ ์๋๊ณ ์๊ธฐ๋ง์ ์ญํ ์ ๊ฐ์ง ๊ฐ์ฒด๋ก ๋ณด์ฌ์ง๋๋ฐ์!
๊ทธ๋ ๋ค๋ฉด ์ฌ๊ธฐ์ ๋ทฐ๋ฅผ ํธ์ถํ๊ฒ ๋๋ฉด, ๋ทฐ์ ๋น์ฆ๋์ค ๋ก์ง์ด ๊ฐํ๊ฒ ์ฐ๊ด๋๋ค๋ ์๊ฐ์ด ๋ค์ด์.
์ฐํ
์ฝ ์๊ตฌ์ฌํญ์ ์์๋ฏ์ด ๋ทฐ๋ฅผ ๋ถ๋ฆฌํด์ฃผ๋ ค๋ฉด, ์นํ๋๊ป์ ๊ตฌํํด๋์ผ์ ์ปจํธ๋กค๋ฌ๋, `EventPlanner`๋, ์๋๋ฉด ์๋น์ค ๋ณด๋ค ์์์๋ ์ด๋ค ์ 3์ ๊ฐ์ฒด์์, ๋ทฐ๋ฅผ ์ฒ๋ฆฌํ๊ณ ๊ฐ๋ง `Date`์ชฝ์ผ๋ก ๋๊ฒจ์ฃผ๋ฉด ๋ ๊ฒ ๊ฐ์์..! |
@@ -0,0 +1,33 @@
+package christmas.validator;
+
+import jdk.jshell.spi.ExecutionControl.RunException;
+
+public class DateValidator {
+
+ public static int validateDate(String input) {
+ validateInputType(input);
+
+ try {
+ if (input == null) {
+ throw new IllegalArgumentExc... | Java | P5: ํ์
๊น์ง ๊ฒ์ฆํ์๋ ค๊ณ ๋
ธ๋ ฅํ์ ๋ถ๋ถ์ด ๋ณด์ฌ์ ์ ๋ง ์ข์ ๊ฒ ๊ฐ์์ ๐ ๐
๊ทธ๋ฐ๋ฐ ์์ฒ input์ ํ์
์ ๋ฌด์กฐ๊ฑด String์ด ๋ ์ ๋ฐ์ ์์ด์! ์ผ๋ถ๋ฌ ์์์ ํ์
์ ๋ณํํ์ง ์๋ ์ด์์์(๋ง์ฝ ๊ทธ๋ ๋ค๋ฉด, ์๋์ ๋ฐ๋ผ ๋ฐ๋ ๊ฒ์ด๋ ์์ธ์ ์ธ ์ํฉ์ด ์๋๊ฒ ์ฃ ..!)
๊ทธ๋์ ์ด ๋ถ๋ถ์ ์ฝ๋๋ ์ ๊ฑฐํด๋ ์ข์ ๊ฒ ๊ฐ์ต๋๋ค..! |
@@ -0,0 +1,60 @@
+package christmas.constant;
+
+import java.util.Arrays;
+import java.util.stream.Stream;
+
+public enum FoodName {
+ MUSHROOM_SOUP("์์ก์ด์ํ",6000,"APPITIZER"),
+ TAPAS("ํํ์ค", 6000,"APPITIZER"),
+ CEASAR_SALAD("์์ ์๋ฌ๋", 6000,"APPITIZER"),
+ T_BONE_STAKE("ํฐ๋ณธ์คํ
์ดํฌ", 6000,"MAIN"),
+ BARBECUE_RI... | Java | P4: enum์ผ๋ก ๋ฉ๋ด๋ฅผ ๊ตฌํํ์ ๋ถ๋ถ ์ ๋ง ์ข์ ๊ฒ ๊ฐ์์ ๐
๊ทธ๋ฐ๋ฐ ์ดํ๋ฆฌ์ผ์ด์
์ด ์ ์๋์ ํ์ง ์๋ ์ด์ ์ค ์ผ๋ถ๊ฐ ์ฌ๊ธฐ ์จ์ด์์๊ตฐ์
๊ฐ๊ฒฉ์ด ์ ๋ถ 6000์... ๐ญ
ํ๊ฐ์ง๋ง ์๊ฒฌ์ ๋ด๋ณด์๋ฉด, ์์์ ์นดํ
๊ณ ๋ฆฌ(`sort`)๋ enum์ผ๋ก ๊ด๋ฆฌํด๋ณด๋ฉด ์ข์ ๊ฑฐ ๊ฐ์์! |
@@ -0,0 +1,27 @@
+package christmas;
+
+import christmas.controller.EventController;
+
+public class EventPlanner {
+ private final EventController eventController;
+
+ public EventPlanner(EventController eventController) {
+ this.eventController = eventController;
+ }
+
+ public void run(){
+ ... | Java | P5: ์ง๋ฌธ๋๋ฆฝ๋๋ค..!
EventPlanner์ EventController์ ์ญํ ์ด ๋ค์ ์ค์ฒฉ๋๋ ๊ฒ ๊ฐ์๋ฐ์(๋ค๋ฅด๊ฒ ๋งํ๋ฉด, ํ ๊ฐ์ฒด๋ก ํ ์ ์๋ ์ญํ ์ ๋๋ก ์ชผ๊ฐ ๊ฒ ๊ฐ์๋ฐ์)
๋๋์ ์ด์ ๊ฐ ์ด๋ค๊ฑด์ง ๊ถ๊ธํฉ๋๋ค! |
@@ -0,0 +1,68 @@
+package christmas.domain;
+
+import christmas.view.OutputView;
+import java.util.Map;
+
+public class Price {
+
+ int totalPriceBeforeDiscount;
+ EventPrices eventPrices;
+
+
+ public Price(int totalPrice) {
+ this.totalPriceBeforeDiscount = totalPrice;
+ this.eventPrices = new ... | Java | P5: ์ด ๋ถ๋ถ๋, ๋ทฐ๋ ๋ถ๋ฆฌํ๋๊ฒ ์ข์ ๊ฒ ๊ฐ์์!
๋ค๋ฅธ ๋ถ๋ถ์๋ ์ฝ๋ฉํธ ๋จ๊ฒผ์ง๋ง, ์ด ๊ณณ์ ์์ System.out์ ์ฌ์ฉํ๊ณ ์์ด์ ํ ๋ฒ ๋ ๋จ๊ฒจ๋ณด์์..! ๐
๊ทธ๋ฆฌ๊ณ ์ด ๋ถ๋ถ ๊ธ์ก ํฌ๋งทํ
๋ ์ถ๊ฐ๋๋ฉด ๋ ์ข๊ฒ ๋ค์ฉ..! (๋ค๋ฅธ ๋ถ๋ถ์ ๋์ด์๋๋ฐ ์ฌ๊ธฐ๋ง ๋น ์ ธ์์ด์์) |
@@ -0,0 +1,68 @@
+package christmas.domain;
+
+import christmas.view.OutputView;
+import java.util.Map;
+
+public class Price {
+
+ int totalPriceBeforeDiscount;
+ EventPrices eventPrices;
+
+
+ public Price(int totalPrice) {
+ this.totalPriceBeforeDiscount = totalPrice;
+ this.eventPrices = new ... | Java | P3: ์ฌ๊ธฐ์ if-else๋ก์ง์ด... ๋ญ๊ฐ ์ด์ํ๊ฒ ์จ์ด์๋ ๊ฒ ๊ฐ์๋ฐ์ ๐ต๏ธโโ๏ธ (์ฌ์ฉํ์ง ์๊ธฐ๋ก ํ๋ if-else๊ฐ ์๋ ๊ฒ์ ์ ์ธํ๊ณ ์๋ผ๋...) |
@@ -0,0 +1,90 @@
+package christmas.domain;
+
+import christmas.constant.BenefitList;
+import christmas.view.OutputView;
+import java.text.DecimalFormat;
+import java.util.HashMap;
+import java.util.Map;
+
+public class EventPrices {
+ Map<String,Integer> benefitList;
+ int totalPrice;
+
+ public EventPrices()... | Java | P2: if-else ๋ฌธ์๋ return์ด ํ์ํ์ง ์์์..! ๋๊ตฐ๋ค๋ ๋ฐํํ์
์ด void์ธ ์ํฉ์์๋์!
๋ฌผ๋ก ๋ช
์์ ์ธ return์ ์จ์ ํท๊ฐ๋ฆด๋งํ ์ฝ๋๋ ์ฌ์ด๋์ดํํธ๋ฅผ ๋ง๋ ๊ฒฝ์ฐ๋ ์๋๋ฐ, ์ง๊ธ์ ํด๋น๋์ง ์๋ ์ฝ๋ ๊ฐ์์ ๋ง์๋๋ ค๋ณด์์ต๋๋ค ๐ |
@@ -0,0 +1,25 @@
+package christmas.controller;
+
+import christmas.service.EventService;
+
+public class EventController {
+ private final EventService eventService;
+
+ public EventController(EventService eventRepository) {
+ this.eventService = eventRepository;
+ }
+
+ public void requestInfo() {
... | Java | EventPlanner EventController EventService๋ก ๊ตฌ์กฐ๋ฅผ ๊ฐ์ ธ๊ฐ์ ์ด์ ๊ฐ ๊ถ๊ธํฉ๋๋ค. ์ด๋ค ์ด์ ์ด ์๋ค ์๊ฐ์ด ๋ค์ด์ ์ด๋ ๊ฒ ๊ตฌ์กฐ๋ฅผ ๊ฐ์ ธ๊ฐ์ ๊ฑธ๊น์?
๋ํ ๋ทฐ๋ก์ง์ด ๋๋ฉ์ธ๊ณผ ๊ฐํ๊ฒ ๊ฒฐํฉ๋๋ค ์๊ฐํ๋๋ฐ ์ด๋ป๊ฒ ์๊ฐํ์ค๊น์? |
@@ -0,0 +1,33 @@
+public class Calculator {
+ public double calculate(String expression) {
+ String[] tokens = expression.split(" ");
+ double currentResult = Double.parseDouble(tokens[0]);
+
+ for (int i = 1; i < tokens.length; i += 2) {
+ String operator = tokens[i];
+ do... | Java | Enum์ ์ฌ์ฉํด์ switch๋ฌธ์ ์ฌ์ฉํ์ง ์๋ ๋ฐฉํฅ์ผ๋ก ์ฝ๋๋ฅผ ์์ฑํด๋ด
์๋ค |
@@ -0,0 +1,33 @@
+public class Calculator {
+ public double calculate(String expression) {
+ String[] tokens = expression.split(" ");
+ double currentResult = Double.parseDouble(tokens[0]);
+
+ for (int i = 1; i < tokens.length; i += 2) {
+ String operator = tokens[i];
+ do... | Java | Calculator ํด๋์ค์ ์ฑ
์์ ๋ฌด์์ธ๊ฐ์.
ํ ํด๋์ค์ ์ฌ๋ฌ ๊ฐ์ ์ฑ
์์ด ์๋ ๊ฒ ๊ฐ์ต๋๋ค.
SCP์ ๋ํด์ ๊ณต๋ถํด๋ณด๊ณ ์ฝ๋๋ฅผ ์์ฑํด์ฃผ์ธ์ |
@@ -0,0 +1,34 @@
+public class Validator {
+ public boolean isValid(String expression) {
+ String[] tokens = expression.split(" ");
+
+ if (tokens.length % 2 == 0) {
+ return false;
+ }
+
+ if (!isNumeric(tokens[0])) {
+ return false;
+ }
+
+ for (int i... | Java | ํ ๋ฉ์๋๊ฐ ๋ง์ ์ญํ ์ ํด์ฃผ๋ ๊ฒ ๊ฐ์ต๋๋ค.
๊ฐ๊ฐ์ if๋ฌธ์ ์ฌ๋ฌ ๋ฉ์๋๋ก ๋๋์ด๋ณด์ธ์. |
@@ -1,5 +1,22 @@
+import java.util.Scanner;
+
public class Main {
public static void main(String[] args) {
- System.out.println("1 + 1 = 2");
+ Scanner scanner = new Scanner(System.in);
+ System.out.println("๊ณ์ฐํ ์์์ ์
๋ ฅํ์ธ์ (์: 30 + 20 / 2 * 4):");
+ String expression = scanner.nextLine(... | Java | Main ํด๋์ค์ ๋๋ฌด ๋ง์ ์ฑ
์์ด ์์ต๋๋ค.
SCP์ ๋ํด์ ๊ณต๋ถ ํด๋ณด๊ณ ์ฝ๋๋ฅผ ์์ฑํด์ฃผ์ธ์
* ์ฝ์์ ํ๋ฆฐํธํด์ฃผ๋ ๊ฒ๋ ํ๋์ ์ฑ
์์ผ๋ก ๋ด
๋๋ค |
@@ -18,6 +18,7 @@
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
+import java.util.stream.Collectors;
@Slf4j
@RestController
@@ -26,12 +27,24 @@ public class OrderController {
private final OrderService orderService;
private final BasketService basketService;
+
+ /*
... | Java | (C) ๋ถํ์ํ IOException์ธ ๊ฒ ๊ฐ์ต๋๋ค. |
@@ -11,6 +11,7 @@
import java.io.IOException;
+// (Q) Custom deserializer๋ฅผ ๊ตฌํํ ์ด์ ๊ฐ ๋ฌด์์ธ๊ฐ์? Jackson ๋ฑ์ serializer๋ฅผ ์ฌ์ฉํ๊ธฐ ์ด๋ ค์ด ๋ถ๋ถ์ด ์๋์?
public class StoreDeserializer extends StdDeserializer {
public StoreDeserializer(){ | Java | > ๋ค ์ฌ์ค Menu ๋ฐ์ดํฐ์๋ ๋ค๋ฅด๊ฒ Store ๋ฐ์ดํฐ๋ Point๋ผ๋ spring์์ ์ ๊ณตํ๋ ๊ฐ์ฒด๋ฅผ property๋ก ๊ฐ์ง๊ณ ์์ต๋๋ค. ๊ทธ๋ฐ๋ฐ objectMapper์ readValue()๋ก๋ Store.class๋ฅผ ๋ฐ๋ก ์ญ์ง๋ ฌํ์ํค์ง ๋ชปํ๋๋ฐ ๊ทธ๊ฑด ๋ฐ๋ก Point๋ฅผ objectMapper๊ฐ ํด์ํ์ง ๋ชปํ๊ธฐ ๋๋ฌธ์ด๋๋ผ๊ณ ์. JSONObject.get()์ ์ฌ์ฉํด์ ํ๋ํ๋ ๊น์ ์ญ์ง๋ ฌํํด๋ ๋์ง๋ง, convertStoreData() ๋ฉ์๋๊ฐ ๊ธธ์ด์ง๋ ๊ฒ ๋ณด๊ธฐ ์ซ์ด์ Custom deserializer๋ฅผ ์ฌ์ฉํด์ ํ๋ฐฉ์ ์ฒ๋ฆฌ๋๊ฒ๋ ๋ณด์ด๋๋ก(?) ํ์ต๋๋ค. ์ฌ์ค D... |
@@ -5,27 +5,32 @@
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.EnumSet;
import java.util.List;
+import java.util.stream.Collectors;
@RestController
-@RequestMapping("/customer")
+@RequestMapping("/customer") // (R) HomeController์์ url... | Java | >HomeController์ home()์ ํน๋ณํ ์ด์ ์์ด ์ด๊ธฐ์ ์๋ฒ๊ฐ ์ ๋์๊ฐ๋์ง ํ
์คํธ ํ๋ ค๊ณ ๋ฃ์ด๋์ ํ
์คํธ ์ฉ๋์ ์ฝ๋์
๋๋ค. Customer, Restaurant, Rider ์ธ๊ฐ์ง ์๋ฒ๋ฅผ ๋์ฐ๋ค๋ณด๋ White Error ํ์ด์ง๋ก๋ ํท๊ฐ๋ ค์ ์์๋ก ์์ฑํ๋ ์ฝ๋์ธ๋ฐ, ํ
์คํธ ์ฉ๋๊ธฐ ๋๋ฌธ์ ์์ด๋ ๋ฌธ์ ๊ฐ ์์ต๋๋ค. ํด๋น ์ฝ๋์๋ ์ฃผ์์ ๋ฃ์ด์ผ ํ์๋ค์.
> customer, restaurant, rider ์๋ฒ ๋ชจ๋ home controller๋ฅผ ๊ฐ์ง๊ณ ์๋๋ฐ, ์ฌ์ค ์ฃผ ์ฉ๋๋ ์๋ฒ๊ฐ ๋์๊ฐ๋์ง ๋ณด๋ ค๊ณ ๋ง๋ค์ด๋ ๊ฒ์
๋๋ค. url prefix๋ ์ปจํธ... |
@@ -18,6 +18,7 @@
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
+import java.util.stream.Collectors;
@Slf4j
@RestController
@@ -26,12 +27,24 @@ public class OrderController {
private final OrderService orderService;
private final BasketService basketService;
+
+ /*
... | Java | > Customer๋น Basket์ ํ๋๋ง ๊ฐ์ง๋ค๊ณ ์๊ฐํด์ CustomerId๋ฅผ ๋ฐ๋ก BasketId๋ก ์ฌ์ฉํ์ต๋๋ค.
๋ฌผ๋ก ๋์ผํ ๊ฐ์ id๋ก ์ฌ์ฉํ์๋ ๊ฒ๋ ๊ธฐ๋ฅ ๋์์ ๋ฌธ์ ๊ฐ ์๊ฒ ์ง๋ง, basketId์ customerId๋ฅผ ๊ทธ๋๋ก ์ฌ์ฉํ๋ ๊ฒ์ ์ผ๋จ ์ฝ๋์ ์๋ ํ์
์ด ์ด๋ ต๊ณ , ์ดํ ๋ถ์ฌ๋๋ id๋ฅผ ๊ธฐ๋ฐ์ผ๋ก ๋ฐ์ดํฐ๋ฅผ ๊ฒ์ํ ํ
๋ฐ ๊ทธ ๋๋ ์ค์๋ฅผ ์ ๋ฐํ ์ฌ์ง๊ฐ ์๋ ๊ฒ ๊ฐ์ต๋๋ค.
์ฝ๋ ์์ค์์ ์ค์๋ฅผ ์๋ฐฉํ ์ ์๋ ๋ถ๋ถ์ด ์๋ค๋ฉด ํญ์ ๋ฐฉ์ดํ๋๋ก ์์ฑํ๋ ๊ฒ์ด ์ข์ ๊ฒ ๊ฐ์ต๋๋ค! |
@@ -18,6 +18,7 @@
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
+import java.util.stream.Collectors;
@Slf4j
@RestController
@@ -26,12 +27,24 @@ public class OrderController {
private final OrderService orderService;
private final BasketService basketService;
+
+ /*
... | Java | > Repository์์ ์ต๊ด์ ์ผ๋ก create์ดํ id๋ฅผ ๋ฐํํ๋ ๋ก์ง์ ์ฌ์ฉํ๋ค๋ณด๋ ์ด๋ ๊ฒ ์์ฑํ๋๋ฐ, ์๊ฐํด๋ณด๋ order ์์ฒด๋ฅผ ๊ฐ์ ธ์ค๋ฉด getOrder()๋ ์ฌ์ฉํ์ง ์์๋ ๋๋ ์ฟผ๋ฆฌ ํ ๋ฒ์ ์ ์ฝํ๊ฒ ๊ตฐ์. ์ง์ ํด์ฃผ์
์ ๊ฐ์ฌํฉ๋๋ค.
๋ง์ํด์ฃผ์ ๋ถ๋ถ๋ order ๊ฐ์ฒด๋ก ์ฒ๋ฆฌํ๋ ๊ฒ์ ์ฅ์ ์ผ๋ก ๋ณผ ์ ์์ ๊ฒ ๊ฐ์ต๋๋ค.
๋ค๋ง ์ ๊ฐ ๋ฆฌ๋ทฐ๋๋ฆฐ ๊ด์ ์ ์กฐ๊ธ ๋ค๋ฅธ ๋ถ๋ถ์
๋๋ค.
string ํ์
์ ๋ฒ์ฉ์ ์ธ primitive ํ์
์ด๊ธฐ ๋๋ฌธ์, ํด๋์ค ์์ฒด๋ก์จ๋ ํฐ ์๋ฏธ๋ฅผ ๊ฐ์ง ์์ต๋๋ค. (๋จ์ง string์ ์ญํ ์ ํ๋ ๊ธฐ๋ฅ๋ค์ ์ ๊ณตํ ๋ฟ์ด๊ฒ ์ฃ )
ํ์ง๋ง... |
@@ -11,6 +11,7 @@
import java.io.IOException;
+// (Q) Custom deserializer๋ฅผ ๊ตฌํํ ์ด์ ๊ฐ ๋ฌด์์ธ๊ฐ์? Jackson ๋ฑ์ serializer๋ฅผ ์ฌ์ฉํ๊ธฐ ์ด๋ ค์ด ๋ถ๋ถ์ด ์๋์?
public class StoreDeserializer extends StdDeserializer {
public StoreDeserializer(){ | Java | ๋ค ๋์ผํ ๋ณ์๋ช
์ผ๋ก ์ฒ๋ฆฌํ์ง๋ง, custom deserializer๋ฅผ ์ฌ์ฉํ์ง ์์ผ๋ฉด ๋ค์๊ณผ ๊ฐ์ ์๋ฌ๊ฐ ๋ฐ์ํฉ๋๋ค.
_Cannot construct instance of `org.springframework.data.geo.Point` (no Creators, like default constructor, exist): cannot deserialize from Object value (no delegate- or property-based Creator)_
Point๋ผ๋ ๊ฐ์ฒด๋ฅผ objectMapper๊ฐ ๋ชจ๋ฅด๊ธฐ ๋๋ฌธ์ ๋ฐ์ํ ์ผ์ด๋ผ๊ณ ํ๋๊ตฐ์. ์๋๋ c... |
@@ -11,6 +11,7 @@
import java.io.IOException;
+// (Q) Custom deserializer๋ฅผ ๊ตฌํํ ์ด์ ๊ฐ ๋ฌด์์ธ๊ฐ์? Jackson ๋ฑ์ serializer๋ฅผ ์ฌ์ฉํ๊ธฐ ์ด๋ ค์ด ๋ถ๋ถ์ด ์๋์?
public class StoreDeserializer extends StdDeserializer {
public StoreDeserializer(){ | Java | @millwheel
์ Point๊ฐ ๊ธฐ๋ณธ ์์ฑ์๊ฐ ์๊ตฐ์.
์ ๊ฐ ์๊ณ ์๋ ์ผ๋ฐ์ ์ธ serializer์ deserialize ๋ฐฉ์์, ๋จผ์ ๊ธฐ๋ณธ ์์ฑ์๋ก ๊ฐ์ฒด๋ฅผ ์์ฑํ๊ณ setter๋ฅผ ํตํด ๊ฐ์ฒด ํ๋๋ฅผ settingํ๋ ๋ฐฉ์์ผ๋ก ์๊ณ ์์ต๋๋ค.
๊ทธ๋ฐ๋ฐ ๊ธฐ๋ณธ ์์ฑ์๊ฐ ์๋ค๋ณด๋ ๊ฐ์ฒด๋ฅผ ์์ฑํ๋ ๊ณผ์ ์์ ์๋ฌ๊ฐ ๋๋ ๊ฒ ๊ฐ๋ค์~
์ฌ์ค point ํด๋์ค์ ๊ด๋ จํด์๋ ๋ฆฌ๋ทฐ ๋๋ฆฌ๋ ค๊ณ ํ๋๋ฐ, ์ดํ ๊ด๋ จ ๋ฆฌ๋ทฐ์์ ๋ ์๊ธฐํด๋ณด๊ฒ ์ต๋๋ค~ |
@@ -19,11 +19,16 @@
@RestController
@Slf4j
+/*
+ (C) foodKind๋ QueryParam์ผ๋ก ๋ฐ๋ ๊ฒ์ด ๋ restful ํด๋ณด์
๋๋ค.
+ ๋ํ showStoreInfo์์๋ foodKind๋ฅผ ์ฌ์ฉํ์ง ์๊ธฐ ๋๋ฌธ์, ๊ฐ๋ณ ๋ฉ์๋์์ ๋งตํํ๋ ๊ฒ์ด ์ข์ ๋ณด์
๋๋ค.
+*/
@RequestMapping("/customer/{foodKind}/store")
public class StoreController {
private final MemberService memberService;
priv... | Java | > Q) @RequiredArgConstructor๋ฅผ Entity์์ ์ฌ์ฉํ๋ ๊ฒฝ์ฐ ์
๋ ฅ๋ Property์ ์์๋ฅผ ๋ฐ๊ฟจ์ ๋ ๋ ๊ฐ์ ํ์
์ property๋ผ๋ฉด ๋ฌธ์ ๊ฐ ๋๋ ๊ฒฝ์ฐ๊ฐ ์๋๋ผ๊ณ ์. ์์ฑ์๋ฅผ ์์ฑํ ๋ ๋งค๊ฐ๋ณ์ ์
๋ ฅ ์์๋ฅผ ๋ฐ๊พธ์ง ์์๋ ์ปดํ์ผ ๊ณผ์ ์์ ์๋ฌ๊ฐ ๋ฐ์ํ์ง ์์์ ์๋ชป๋ ๊ฐ์ด ๋ค์ด์๋ ์บ์นํ ์ ์์ด์ ์์ @RequiredArgConstructor๋ฅผ ์ฌ์ฉํ์ง ๋ง์๊ณ ํ๋ ๊ธ๋ ๋ดค์์ต๋๋ค. ๋ฌผ๋ก Controller๋ผ์ ๊ฐ์ ํ์
์ property๊ฐ ์์ผ๋๊น ์ฌ๊ธฐ์ ๋ฌธ์ ๊ฐ ์๊ฒ ์ง๋ง, ์ค์ ๋ก @requiredargsconstructor๋ฅผ ํธ์์ ... |
@@ -0,0 +1,45 @@
+package calculator.model;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.function.BiFunction;
+
+public enum OperatorType {
+ ADDITION("+", (a, b) -> a + b),
+ SUBTRACTION("-", (a, b) -> a - b),
+ MULTIPLICATION("*", (a, b) -> a * b),
+ DIVISION("/", (a, b) -> {
+ ... | Java | ์ด๋ ๊ฒ ๋ฌธ์์ด์ ๋ฆฌํดํด์ค ํ์๊ฐ ์์๊น์? |
@@ -0,0 +1,17 @@
+package calculator.model;
+
+public class Operator {
+
+ public int calculate(String[] values) {
+ int result = Integer.parseInt(values[0]);
+
+ for (int i = 1; i < values.length; i += 2) {
+ String symbol = values[i];
+ int nextNumber = Integer.parseInt(values[i... | Java | Enum ์ฌ์ฉ๋ฒ์ ๋ค์ ๊ณต๋ถํด์ ์ ์ฉํด๋ด
์๋ค. Switch๋ฌธ์ ์ฌ์ฉํ์ง ์๋ ๋ฐฉ์์ผ๋ก์. |
@@ -0,0 +1,11 @@
+package calculator.view;
+
+import java.util.Scanner;
+
+public class InputView {
+ public String formulaInput() {
+ Scanner scanner = new Scanner(System.in);
+ System.out.print("์์์ ์
๋ ฅํ์ธ์ : ");
+ return scanner.nextLine();
+ }
+}
\ No newline at end of file | Java | ํด๋์ค์ ์ญํ ์ด ๋ ๊ฐ์ง ์กด์ฌํฉ๋๋ค
1. ๋ฌธ์์ด์ ๋ฐ๋๋ค
2. ๋ฌธ์์ด์ ๋๋๋ค
ํด๋์ค์ ์ฑ
์๊ณผ ์ญํ ์ ๋ํด์ ์๊ฐํด๋ด
์๋ค |
@@ -0,0 +1,27 @@
+package calculator.controller;
+
+import calculator.model.Operator;
+import calculator.util.FormulaParser;
+import calculator.view.InputView;
+import calculator.view.OutputView;
+
+public class CalculatorController {
+ private final Operator operator;
+ private final InputView inputView;
+ pr... | Java | ์ด ๋ณ์๊ฐ ์ด๋ค ์ญํ ์ ํ๋ ๋ณ์์ธ์ง ๋ณ์๋ช
๋ง ๋ณด๊ณ ์ ์ ์๊ฒ ๋ง๋ค์ด์ฃผ์ธ์ |
@@ -0,0 +1,17 @@
+package calculator.model;
+
+public class Operator {
+
+ public int calculate(String[] values) {
+ int result = Integer.parseInt(values[0]);
+
+ for (int i = 1; i < values.length; i += 2) {
+ String symbol = values[i];
+ int nextNumber = Integer.parseInt(values[i... | Java | ์ด๋ ๊ฒ ํด์ค ๊ฑฐ๋ฉด ํ๋์์ ์ง์ ์ ์ผ๋ก ์ ์ธํด์ฃผ๋ ๊ฒ์ด ๋ ๊น๋ํฉ๋๋ค |
@@ -0,0 +1,45 @@
+package calculator.model;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.function.BiFunction;
+
+public enum OperatorType {
+ ADDITION("+", (a, b) -> a + b),
+ SUBTRACTION("-", (a, b) -> a - b),
+ MULTIPLICATION("*", (a, b) -> a * b),
+ DIVISION("/", (a, b) -> {
+ ... | Java | ์ด ๋ฉ์๋๊ฐ static ๋ฉ์๋์ฌ์ผ๋ง ํ๋ ์ด์ ๊ฐ ์๋์? |
@@ -0,0 +1,11 @@
+package calculator.view;
+
+import java.util.Scanner;
+
+public class InputView {
+ public String formulaInput() {
+ Scanner scanner = new Scanner(System.in);
+ System.out.print("์์์ ์
๋ ฅํ์ธ์ : ");
+ return scanner.nextLine();
+ }
+}
\ No newline at end of file | Java | FormulaParser ํด๋์ค์ ๋ฌธ์์ด์ ๋๋๋ ์ญํ ์ ๋ถํ ํ์ต๋๋ค. |
@@ -0,0 +1,27 @@
+package calculator.controller;
+
+import calculator.model.Operator;
+import calculator.util.FormulaParser;
+import calculator.view.InputView;
+import calculator.view.OutputView;
+
+public class CalculatorController {
+ private final Operator operator;
+ private final InputView inputView;
+ pr... | Java | calculatorRun์ผ๋ก ์์ ํ์ต๋๋ค. |
@@ -0,0 +1,45 @@
+package calculator.model;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.function.BiFunction;
+
+public enum OperatorType {
+ ADDITION("+", (a, b) -> a + b),
+ SUBTRACTION("-", (a, b) -> a - b),
+ MULTIPLICATION("*", (a, b) -> a * b),
+ DIVISION("/", (a, b) -> {
+ ... | Java | ์ง์ ๋ ์ฐ์ฐ์๋ฅผ ์ ์ธํ ๋ค๋ฅธ ๊ธฐํธ๋ฅผ ์
๋ ฅํ์ ๊ฒฝ์ฐ์ ์ถ๋ ฅํ๋๋ก ํ์ง๋ง
๊ณ์ฐ๊ธฐ์ ๊ฒฝ์ฐ ๋ฐ๋ก ์์ด๋ ๋ ๊ฒ ๊ฐ์ต๋๋ค. |
@@ -0,0 +1,17 @@
+package calculator.model;
+
+public class Operator {
+
+ public int calculate(String[] values) {
+ int result = Integer.parseInt(values[0]);
+
+ for (int i = 1; i < values.length; i += 2) {
+ String symbol = values[i];
+ int nextNumber = Integer.parseInt(values[i... | Java | OperatorType์ ๊ธฐ๋ฅ์ ์์ ํ๋ฉด์ Operator์ ๊ธฐ๋ฅ๊ณผ ์ค๋ณต๋๊ธฐ์ ์ญ์ ํ์ต๋๋ค. |
@@ -0,0 +1,45 @@
+package calculator.model;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.function.BiFunction;
+
+public enum OperatorType {
+ ADDITION("+", (a, b) -> a + b),
+ SUBTRACTION("-", (a, b) -> a - b),
+ MULTIPLICATION("*", (a, b) -> a * b),
+ DIVISION("/", (a, b) -> {
+ ... | Java | ๊ฐ์ฒด๋ฅผ ๋ณ๊ฒฝํ์ง ์์์ ์ธ์คํด์ค๋ฅผ ์์ฑํ์ง ์์๋ ๋๋ค๊ณ ์๊ฐํ๊ณ
static๋ฉ์๋๋ก ์ ์ธํ๋ฉด ์ธ์คํด์ค ์์ฑ์์ด ํธ์ถ ํ ์ ์์ด์ ์ฌ์ฉํ์ต๋๋ค. |
@@ -0,0 +1,17 @@
+package calculator.model;
+
+public class Operator {
+
+ public int calculate(String[] values) {
+ int result = Integer.parseInt(values[0]);
+
+ for (int i = 1; i < values.length; i += 2) {
+ String symbol = values[i];
+ int nextNumber = Integer.parseInt(values[i... | Java | BiFunction ํ๋๋ฅผ ํ์ฉํ์ฌ Switch๋ฌธ ์์ด ์ฐ์ฐ์ ์ฒ๋ฆฌ ํ ์ ์๊ฒ ์์ ํ์ต๋๋ค. |
@@ -0,0 +1,27 @@
+package calculator.controller;
+
+import calculator.model.Operator;
+import calculator.util.FormulaParser;
+import calculator.view.InputView;
+import calculator.view.OutputView;
+
+public class CalculatorController {
+ private final Operator operator;
+ private final InputView inputView;
+ pr... | Java | values๋ ์ด๋ค ์ฉ๋๋ก ์ฌ์ฉ๋๋ ๋ณ์์ธ๊ฐ์ |
@@ -0,0 +1,17 @@
+package calculator.model;
+
+public class Operator {
+
+ public int calculate(String[] values) {
+ int result = Integer.parseInt(values[0]);
+
+ for (int i = 1; i < values.length; i += 2) {
+ String symbol = values[i];
+ int nextNumber = Integer.parseInt(values[i... | Java | ์ด๋ค ๋งค๊ฐ๋ณ์๋ฅผ ๋ฐ์์ค๋ ๊ฑด๊ฐ์.
๋งค๊ฐ๋ณ์๊ฐ ๋ฉ์๋ ๋ด์์ ์ด๋ค ์ญํ ์ ํ๋์ง ์ ์ ์๋๋ก ์ง์ด์ฃผ์ธ์ |
@@ -0,0 +1,17 @@
+package calculator.model;
+
+public class Operator {
+
+ public int calculate(String[] values) {
+ int result = Integer.parseInt(values[0]);
+
+ for (int i = 1; i < values.length; i += 2) {
+ String symbol = values[i];
+ int nextNumber = Integer.parseInt(values[i... | Java | static ๋ฉ์๋๋ฅผ ์ฌ์ฉํด์ผํ ์ด์ ๊ฐ ์์๊น์? |
@@ -0,0 +1,45 @@
+package calculator.model;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.function.BiFunction;
+
+public enum OperatorType {
+ ADDITION("+", (a, b) -> a + b),
+ SUBTRACTION("-", (a, b) -> a - b),
+ MULTIPLICATION("*", (a, b) -> a * b),
+ DIVISION("/", (a, b) -> {
+ ... | Java | ์ด๊ฑธ ํ๋๋ก ์ ์ธํ ์ด์ ๊ฐ ์์๊น์?
๋ฐ์ดํฐ ์ฃผ๋ ์ค๊ณ๊ฐ ์๋ ๋๋ฉ์ธ ์ฃผ๋ ์ค๊ณ๋ฅผ ๊ณต๋ถํด๋ณด์ธ |
@@ -0,0 +1,17 @@
+package calculator.model;
+
+public class Operator {
+
+ public int calculate(String[] values) {
+ int result = Integer.parseInt(values[0]);
+
+ for (int i = 1; i < values.length; i += 2) {
+ String symbol = values[i];
+ int nextNumber = Integer.parseInt(values[i... | Java | ํ์ฌ ํธ์ฌํ ์ฝ๋์ ์กด์ฌํ์ง ์๋ ์ฝ๋์
๋๋ค. |
@@ -0,0 +1,17 @@
+package calculator.model;
+
+public class Operator {
+
+ public int calculate(String[] values) {
+ int result = Integer.parseInt(values[0]);
+
+ for (int i = 1; i < values.length; i += 2) {
+ String symbol = values[i];
+ int nextNumber = Integer.parseInt(values[i... | Java | values ๋งํ ๊ฑฐ์์ |
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Bucket
+ uuid = "F89D4C7C-1180-42EB-AF20-BEE64400FB01"
+ type = "1"
+ version = "2.0">
+</Bucket> | Unknown | ์ด ํ์ผ์ ๋ฌด์์ธ๊ฐ์ . .?
gitignore ๋ก ์์ฌ๋ฆฌ๋๊ฒ ์ข์๊ฒ๊ฐํธ์ |
@@ -10,11 +10,11 @@ import UIKit
class HomeViewController: UIViewController {
private var feeds: [Feed] = [
- Feed(username: "Woody", profileImage: "profileImage", title: "์ฐ๋ญ๋จน๋ค ๋ฐ์ ์๊ฐ", hashTags: [HashTag(hashTag: "#Guitar"), HashTag(hashTag: "#Jazz")]),
- Feed(username: "Woody", profileImage: ... | Swift | 550์ ์๋ฏธ๋ ๋ฌด์์ธ๊ฐ์ !
์๋ฏธ๊ฐ ์๋ค๋ฉด let์ผ๋ก ๋ช
๋ช
ํด์ ์ถํ์ ์ ์ง๋ณด์ ๋ ์์๋ณด๊ธฐ ์ฝ๊ฒํ๋๊ฒ์ด ์ข์ ๋ฏํฉ๋๋ค ~ |
@@ -21,3 +21,25 @@ extension UICollectionViewCell {
NSStringFromClass(self.classForCoder()).components(separatedBy: ".").last!
}
}
+
+extension UIImage {
+
+ func applyBlur_usingClamp(radius: CGFloat) -> UIImage {
+ let context = CIContext()
+ guard let ciImage = CIImage(image: self),
+... | Swift | Swift๋ ์นด๋ฉ์ผ์ด์ค ~ ๐ซ |
@@ -21,3 +21,25 @@ extension UICollectionViewCell {
NSStringFromClass(self.classForCoder()).components(separatedBy: ".").last!
}
}
+
+extension UIImage {
+
+ func applyBlur_usingClamp(radius: CGFloat) -> UIImage {
+ let context = CIContext()
+ guard let ciImage = CIImage(image: self),
+... | Swift | ๊ณ์ extension์ด ๋์ด๋ ์์ ์ด๋ผ๋ฉด UIImage+.swift ๋ก ๋ณ๋๋ก ๋นผ๋ฉด์ด๋จ๊น์ฅ |
@@ -20,27 +20,106 @@ class FeedCollectionViewCell: UICollectionViewCell {
return stackView
}()
- // ์๋จ
+ // UpperBar
private let feedUpperBar: UIStackView = {
let stackView = UIStackView()
stackView.axis = .horizontal
stackView.distribution = .fill
... | Swift | ```suggestion
private let feedUpperBarStackView: UIStackView = {
```
class๊ฐ StackView์ธ๊ฑด ๋ฐ๋ก ์์๋ณด๋ฉด ์ฝ๊ธฐ ํธํ ๊ฑฐ๊ฐ์์ฉ |
@@ -20,27 +20,106 @@ class FeedCollectionViewCell: UICollectionViewCell {
return stackView
}()
- // ์๋จ
+ // UpperBar
private let feedUpperBar: UIStackView = {
let stackView = UIStackView()
stackView.axis = .horizontal
stackView.distribution = .fill
... | Swift | ```suggestion
```
์ฌ์ฉํ์ง ์๊ฒ๋์๋ค๋ฉด ์ญ์ |
@@ -20,27 +20,106 @@ class FeedCollectionViewCell: UICollectionViewCell {
return stackView
}()
- // ์๋จ
+ // UpperBar
private let feedUpperBar: UIStackView = {
let stackView = UIStackView()
stackView.axis = .horizontal
stackView.distribution = .fill
... | Swift | ์ฌ๊ธฐ์ ํ์ค์ฉ ๋ฃ๋๊ฑด ์ฐ๋๋ง์ ์คํ์ผ์ธ๊ฑด๊ฐ์?
๊ทธ์ ๊ถ๊ธ์ฐ |
@@ -20,27 +20,106 @@ class FeedCollectionViewCell: UICollectionViewCell {
return stackView
}()
- // ์๋จ
+ // UpperBar
private let feedUpperBar: UIStackView = {
let stackView = UIStackView()
stackView.axis = .horizontal
stackView.distribution = .fill
... | Swift | property์ด๋ฆ๊ณผ ์ฃผ์์ด ๊ฐ๋ค๋ฉด ๊ฐ ์ฃผ์์ด ์ฌ๋ผ์ ธ๋ ๋์ง ์์๊น์ ..? |
@@ -10,11 +10,11 @@ import UIKit
class HomeViewController: UIViewController {
private var feeds: [Feed] = [
- Feed(username: "Woody", profileImage: "profileImage", title: "์ฐ๋ญ๋จน๋ค ๋ฐ์ ์๊ฐ", hashTags: [HashTag(hashTag: "#Guitar"), HashTag(hashTag: "#Jazz")]),
- Feed(username: "Woody", profileImage: ... | Swift | ์๋ฏธ๋ ์์๋๋ค.. ๋์ผ๋ก ๋๊ฐ height ์์ต๋๋ค let์ผ๋ก ๋ณ์ ์ ์ธํ๋๊ฒ์ ํด๋น func ๋ด๋ถ์ ์ ์ธํ๋ ๊ฒ์ด ์ข๊ฒ ์ฃ ? |
@@ -20,27 +20,106 @@ class FeedCollectionViewCell: UICollectionViewCell {
return stackView
}()
- // ์๋จ
+ // UpperBar
private let feedUpperBar: UIStackView = {
let stackView = UIStackView()
stackView.axis = .horizontal
stackView.distribution = .fill
... | Swift | ์์ ์ฃผ์ ๋ง์์ด์ ๊ฐ์? |
@@ -20,27 +20,106 @@ class FeedCollectionViewCell: UICollectionViewCell {
return stackView
}()
- // ์๋จ
+ // UpperBar
private let feedUpperBar: UIStackView = {
let stackView = UIStackView()
stackView.axis = .horizontal
stackView.distribution = .fill
... | Swift | ์ฃผ์์ ์ ์๊ฒ ์ผ์ข
์ ์์ญ ํ์์ ๊ฐ์ต๋๋ค
๊ตณ์ด ์กด์ฌํ์ง ์์๋ ๋ ์๋ ์์ง๋ง ์ฌ๊ธฐ ๋ญ๊ฐ๊ฐ ์๋ค๋ผ๋ ๋๋์ ์ธ ๋๋์ด๋๊น์ |
@@ -20,27 +20,106 @@ class FeedCollectionViewCell: UICollectionViewCell {
return stackView
}()
- // ์๋จ
+ // UpperBar
private let feedUpperBar: UIStackView = {
let stackView = UIStackView()
stackView.axis = .horizontal
stackView.distribution = .fill
... | Swift | ํค์๋๋ฅผ ์ฌ๋ฌ๊ฐ ๋ถ์ฌ๋ ๋๋๊ตฐ์? ์๊ฐ๋ ์ํด๋ดค์ต๋๋ค |
@@ -10,11 +10,11 @@ import UIKit
class HomeViewController: UIViewController {
private var feeds: [Feed] = [
- Feed(username: "Woody", profileImage: "profileImage", title: "์ฐ๋ญ๋จน๋ค ๋ฐ์ ์๊ฐ", hashTags: [HashTag(hashTag: "#Guitar"), HashTag(hashTag: "#Jazz")]),
- Feed(username: "Woody", profileImage: ... | Swift | > ๋์ผ๋ก ๋๊ฐ height ์์ต๋๋ค
๐ค ..?????
> let์ผ๋ก ๋ณ์ ์ ์ธํ๋๊ฒ์ ํด๋น func ๋ด๋ถ์ ์ ์ธํ๋ ๊ฒ์ด ์ข๊ฒ ์ฃ ?
๋ฌผ๋ก ์ด์ฃ ! |
@@ -20,27 +20,106 @@ class FeedCollectionViewCell: UICollectionViewCell {
return stackView
}()
- // ์๋จ
+ // UpperBar
private let feedUpperBar: UIStackView = {
let stackView = UIStackView()
stackView.axis = .horizontal
stackView.distribution = .fill
... | Swift | L60๊ณผ ๊ฐ์ ๊ฐํ ์ด์ผ๊ธฐ๋๋ฆฐ๊ฑฐ์์ด์ ! |
@@ -20,27 +20,106 @@ class FeedCollectionViewCell: UICollectionViewCell {
return stackView
}()
- // ์๋จ
+ // UpperBar
private let feedUpperBar: UIStackView = {
let stackView = UIStackView()
stackView.axis = .horizontal
stackView.distribution = .fill
... | Swift | ๊ฐ์ธ์ ์ธ ์คํ์ผ์ด๋ค์ ! ๐ |
@@ -0,0 +1,29 @@
+import ItemCard from "@/components/ItemCard";
+import styled from "styled-components";
+import { flexCenter } from "@/styles/common";
+import { Product } from "@/types/products";
+import SeaOtterVideo from "@/components/SeaOtterVideo";
+
+const ItemCardList = ({ products, isLoading }: { products: Prod... | Unknown | ์ฌ๊ธฐ์ product.id ๊ฐ key ๊ฐ์ด ์๋๋ผ Math.random ์ผ๋ก ์ฃผ์ ์ด์ ๊ฐ ๋ฐ๋ก ์์ผ์ค๊น์ฉ ?? |
@@ -0,0 +1,15 @@
+import * as S from "@/components/Header/style";
+
+export const HeaderMain = ({ children }: React.PropsWithChildren) => {
+ return <S.Header>{children}</S.Header>;
+};
+
+export const Title = ({ text }: { text: string }) => {
+ return <S.Title>{text}</S.Title>;
+};
+
+const Header = Object.assign(He... | Unknown | ๋๋ฌด ์ข์์~! |
@@ -0,0 +1,29 @@
+import ItemCard from "@/components/ItemCard";
+import styled from "styled-components";
+import { flexCenter } from "@/styles/common";
+import { Product } from "@/types/products";
+import SeaOtterVideo from "@/components/SeaOtterVideo";
+
+const ItemCardList = ({ products, isLoading }: { products: Prod... | Unknown | ์๋ฒ์์ ๊ฐํ์ ์ผ๋ก ์ค๋ณต๋ key ๋ฅผ ๋ฐํํ๋ ๋ฌธ์ ๊ฐ ์์ด์ ํ ๋ฒ์ฉ ๋์ผํ key ๊ฐ์ผ๋ก ์๋ฌ๊ฐ ๋ฐ์ํ๊ธฐ์ random ๊ฐ์ key ๋ก ์ค์ ํด์คฌ์ด์! |
@@ -0,0 +1,172 @@
+package store.domain;
+
+import static store.constants.NumberConstants.FREEBIE_QUANTITY;
+
+import java.util.List;
+import store.dto.BuyGetQuantity;
+import store.dto.PromotionInfo;
+import store.io.InputView;
+
+public class PromotionManager {
+
+ private final List<PromotionInfo> promotionInfos;... | Java | ๋๋ฉ์ธ์์ view์ ์์กดํ๋ ํํ๋ฅผ ๋๊ณ ์์ต๋๋ค.
์ฌ์ฉ์ ์
๋ ฅ ์ฒ๋ฆฌ์ ๋ํ ๋ถ๋ถ์ `MembershipManager` ์ฒ๋ผ ์ปจํธ๋กค๋ฌ๋ก ๊บผ๋ด์ด ์ฒ๋ฆฌํ๋ ๊ฒ์ ์ด๋จ๊น์? |
@@ -0,0 +1,88 @@
+package store.controller;
+
+import static store.constants.InputMessages.PRODUCTS_FILE_NAME;
+import static store.constants.InputMessages.PROMOTIONS_FILE_NAME;
+
+import java.util.List;
+import store.config.IoConfig;
+import store.domain.Choice;
+import store.domain.MembershipManager;
+import store.do... | Java | ์ด ๋ฉ์๋์์, ๊ตฌ๋งคํ ์ํ๊ณผ ์๋์ ๋ฐ์, Receipt๋ฅผ ๋ง๋๋๋ฐ
์ด ๊ณผ์ ์์, ํ๋ก๋ชจ์
์ ๋ํ ๊ธฐ๋ฅ๋ค์ ์ฒ๋ฆฌํ๊ณ ์์ต๋๋ค.
์ด๋ฅผ ๋ถ๋ฆฌํ๋ฉด ์ด๋จ๊น์?
์ฌ์ฉ์๊ฐ ๊ตฌ๋งคํ ์ํ๊ณผ ์๋์ ๋ฐ์ ์ ์ฅํ๊ณ , ์ด ์ ์ฅ๋ ์ ๋ณด๋ฅผ ๋ฐํ์ผ๋ก ํ๋ก๋ชจ์
์ ์ ์ฉํ๋ ์์๋ก์!
์ด๋ ๊ฒ ํ๋ฉด, ํ๋ก๋ชจ์
์์ธ์ฌํญ์ ๋ํ ์ฌ์ฉ์ ์
๋ ฅ์ ์ปจํธ๋กค๋ฌ๋ก ๋บ ์ ์์ ๊ฒ ๊ฐ์ต๋๋ค:) |
@@ -0,0 +1,23 @@
+package store.constants;
+
+import static store.constants.StringConstants.NEW_LINE;
+import static store.constants.StringConstants.ONE_SPACE;
+import static store.constants.StringConstants.TAP;
+
+public class OutputMessages {
+ public static String WELCOME_MESSAGE = "์๋
ํ์ธ์. Wํธ์์ ์
๋๋ค." + NEW_LINE + ... | Java | ์ด๋ ๊ฒ ์์ ํ๋์ฝ๋ฉ ๋ฌธ์์ด ๊ฐ์ ๊ฒฝ์ฐ์ ๋ํด์ ํ๊ณผ ์ ๋ฐฐ๋๊ป ๋ฌผ์ด๋ดค๋๋ฐ, ์ด๋ฐ ์์ ๋ถ๋ถ(๋ฌธ์์ด์ ์กฐ๋ฆฝํด์ผํ๋ ๋ถ๋ถ)์ ๋ง์ง ์์ผ๋ฉด ํด๋์ค ๋ด์์ ์ ์ธํ๊ณ ์ด๋ค๋ ์๊ฒฌ์ ๋ค์์ต๋๋ค! |
@@ -0,0 +1,88 @@
+package store.controller;
+
+import static store.constants.InputMessages.PRODUCTS_FILE_NAME;
+import static store.constants.InputMessages.PROMOTIONS_FILE_NAME;
+
+import java.util.List;
+import store.config.IoConfig;
+import store.domain.Choice;
+import store.domain.MembershipManager;
+import store.do... | Java | ๋์ํฉ๋๋ค! |
@@ -0,0 +1,172 @@
+package store.domain;
+
+import static store.constants.NumberConstants.FREEBIE_QUANTITY;
+
+import java.util.List;
+import store.dto.BuyGetQuantity;
+import store.dto.PromotionInfo;
+import store.io.InputView;
+
+public class PromotionManager {
+
+ private final List<PromotionInfo> promotionInfos;... | Java | ๋๋ฉ์ธํด๋์ค์ ์ฃผ์์ฑ
์์ '๋๋ฉ์ธ์ ์ ํํํด๋ด๋ ๊ฒ'์ด๋ผ๊ณ ์๊ฐํฉ๋๋ค. ํด๋น ๋๋ฉ์ธ ํด๋์ค๋ ๋ง์ ๋น์ฆ๋์ค ๋ก์ง์ ํฌํจํ๊ณ ์์ผ๋ฏ๋ก, ๋จ์ผ์ฑ
์์์น์ด ์๋ฐฐ๋ ๊ฒ ๊ฐ์ต๋๋ค! ์๋น์ค๊ณ์ธต์ ๋์
ํ๊ฑฐ๋ ์ฑ
์์ ๋ถ๋ฆฌํด๋ณด๋๊ฑด ์ด๋จ๊น์? |
@@ -0,0 +1,15 @@
+package store.constants;
+
+public class StringConstants {
+ public static final String COMMA = ",";
+ public static final String DASH = "-";
+ public static final String NEW_LINE = "\n";
+ public static final String TAP = "\t";
+ public static final String OPEN_SQUARE_BRACKETS = "[";
+... | Java | ๊ผผ๊ผผํ ์์ ์ฒ๋ฆฌ! ๋ณผ ๋๋ง๋ค ๊ฐํ์ ์์๋
๋๋ค! |
@@ -0,0 +1,88 @@
+package store.controller;
+
+import static store.constants.InputMessages.PRODUCTS_FILE_NAME;
+import static store.constants.InputMessages.PROMOTIONS_FILE_NAME;
+
+import java.util.List;
+import store.config.IoConfig;
+import store.domain.Choice;
+import store.domain.MembershipManager;
+import store.do... | Java | ์๋ฌ ๋ฉ์์ง ์ถ๋ ฅ ๋ถ๋ถ๋ OutputView ๋ก ๋นผ์ฃผ์๋ฉด ์ข์ ๊ฒ ๊ฐ์ต๋๋ค! |
@@ -0,0 +1,172 @@
+package store.domain;
+
+import static store.constants.NumberConstants.FREEBIE_QUANTITY;
+
+import java.util.List;
+import store.dto.BuyGetQuantity;
+import store.dto.PromotionInfo;
+import store.io.InputView;
+
+public class PromotionManager {
+
+ private final List<PromotionInfo> promotionInfos;... | Java | setQuantity์ setPromotionPeriods ๋ฉ์๋๊ฐ ์ ์ ๋ฉ์๋๋ก ๋ณด์ด๋๋ฐ ์ ์ ๋ฉ์๋๋ ์ํ ๋ณ๊ฒฝ์ ์ฌ์ฉ๋๋ฉด ๊ฐ์ฒด์งํฅ์์น์ ๋ง์ง ์์ ์ ์ข๋ค๊ณ ์๊ณ ์์ต๋๋ค Promotion ๊ฐ์ฒด๋ฅผ ์ธ์คํด์คํํ์ฌ ๊ด๋ฆฌํ๋ ๊ฒ์ด ์ข์ ๊ฒ ๊ฐ์์! |
@@ -0,0 +1,172 @@
+package store.domain;
+
+import static store.constants.NumberConstants.FREEBIE_QUANTITY;
+
+import java.util.List;
+import store.dto.BuyGetQuantity;
+import store.dto.PromotionInfo;
+import store.io.InputView;
+
+public class PromotionManager {
+
+ private final List<PromotionInfo> promotionInfos;... | Java | ๋๋ฉ์ธ์์ ๋ทฐ์ ์์กดํ๋ ํํ๋ ์ข์ง ์์ ๊ฒ ๊ฐ์ต๋๋ค! |
@@ -0,0 +1,60 @@
+package store.domain;
+
+import static camp.nextstep.edu.missionutils.DateTimes.now;
+
+import java.time.LocalDateTime;
+
+public enum Promotion {
+
+ NULL(""),
+ SPARKLING_BUY_TWO_GET_ONE_FREE("ํ์ฐ2+1"),
+ MD_RECOMMENDATION("MD์ถ์ฒ์ํ"),
+ FLASH_SALE("๋ฐ์งํ ์ธ");
+
+ private final String promo... | Java | ์ ๋ ํ๋ก๋ชจ์
์ด ๋์ ์ผ๋ก ๊ฐ์ด ๋ฐ๋ ์ ์๋ค๋ ์กฐ๊ฑด ๋๋ฌธ์ ํ๋ก๋ชจ์
๊ฐ์ด ๋ฐ๋๋ค๋ฉด ์ฝ๋๋ฅผ ์น ๋ค ๋ฐ๊ฟ์ค์ผ ํด์ enum์๋ ๋ง์ง ์๋ค๊ณ ์๊ฐํ์ต๋๋ค ์ง์ฐ๋์ ์ด๋ป๊ฒ ์๊ฐํ์๋์? |
@@ -0,0 +1,48 @@
+package store.domain;
+
+import static store.constants.NumberConstants.SINGLE_PRODUCT_QUANTITY;
+
+import java.util.ArrayList;
+import java.util.List;
+import store.exception.ProductNotExistException;
+
+public class StoreHouse {
+
+ private final List<Product> productList = new ArrayList<>();
+
+
... | Java | ์ด๋ฆ์ผ๋ก product๋ฅผ ์ฐพ์๊ฑฐ๋ผ๋ฉด List<Product>๋ณด๋ค Map<String, Product>๋ ์ด๋จ๊น์? |
@@ -0,0 +1,172 @@
+package store.domain;
+
+import static store.constants.NumberConstants.FREEBIE_QUANTITY;
+
+import java.util.List;
+import store.dto.BuyGetQuantity;
+import store.dto.PromotionInfo;
+import store.io.InputView;
+
+public class PromotionManager {
+
+ private final List<PromotionInfo> promotionInfos;... | Java | ๋์ํฉ๋๋ค |
@@ -0,0 +1,88 @@
+package store.controller;
+
+import static store.constants.InputMessages.PRODUCTS_FILE_NAME;
+import static store.constants.InputMessages.PROMOTIONS_FILE_NAME;
+
+import java.util.List;
+import store.config.IoConfig;
+import store.domain.Choice;
+import store.domain.MembershipManager;
+import store.do... | Java | ๋์ํฉ๋๋ค! |
@@ -0,0 +1,115 @@
+package store.io;
+
+import static store.constants.InputMessages.ADDITIONAL_PURCHASE_MESSAGE;
+import static store.constants.InputMessages.FREEBIE_ADDITION_MESSAGE;
+import static store.constants.InputMessages.INPUT_PRODUCT_NAME_AND_QUANTITY;
+import static store.constants.InputMessages.MEMBERSHIP_DI... | Java | inputView๋ ์ฌ์ฉ์๋ก๋ถํฐ ์
๋ ฅ์ ๋ฐ๋ UI ์ญํ ๋ก, ํ์ผ์ ์ฝ๊ณ ๋ฐ์ดํฐ๋ฅผ ์ฒ๋ฆฌํ๋ ๊ณผ์ ์ parser๋ก ๋นผ์ฃผ์๋ฉด ์ข์ ๊ฒ ๊ฐ์ต๋๋ค! (ํ์ผ ์ฝ๊ธฐ๋ FileReader๋ก, ํด๋น ํ์ผ์ ๋ฐ์ดํฐ ์ฒ๋ฆฌ๋ parser๋ก!)
์๋๋ฉด setup service๋ฅผ ๋ง๋ค์ด์ ๊ทธ๊ณณ์์ setup์ ์งํํ๊ณ controller์์ ๋ถ๋ฌ์ค๋ ๊ฒ๋ ์ข์ ๊ฒ ๊ฐ์ต๋๋ค!
๊ทธ๋ฆฌ๊ณ ํ์ผ ์ฝ๊ธฐ ๊ธฐ๋ฅ์ ์ค ๋จ์๋ก ์ฝ์ด์ ์ฒ๋ฆฌํ๋ ๊ฒ๋ ์ข์ ๋ฐฉ๋ฒ์ด์ง๋ง, readAllLines (์ง์ฐ๋๊ป์ ๋ฆฌ๋ทฐ ํด์ฃผ์
จ๋!) ๋ฉ์๋๋ฅผ ์ฌ์ฉํ๋ฉด ํ๋ฒ์ ์ฝ์ด์์ ์ฝ๋๋ฅผ ์ฝ์ด์ค๋ ๋ถ๋ถ์ ๋จ์ถ ์ํฌ ์ ์๋ต๋๋ค! |
@@ -0,0 +1,115 @@
+package store.io;
+
+import static store.constants.InputMessages.ADDITIONAL_PURCHASE_MESSAGE;
+import static store.constants.InputMessages.FREEBIE_ADDITION_MESSAGE;
+import static store.constants.InputMessages.INPUT_PRODUCT_NAME_AND_QUANTITY;
+import static store.constants.InputMessages.MEMBERSHIP_DI... | Java | ์ถ๊ฐ๋ก validator์ empty input์ ๊ฒ์ฌํ๋ ๋ฉ์๋์ ๊ฒฝ์ฐ, parser์ ํฌํจ ์ํค๋ ๊ฒ์ด ์ด๋จ๊น์?
parser๋ ์
๋ ฅ ๊ฐ์ ํด์ํ๊ณ , ์ ์ ํ ํ์์ผ๋ก ๋ณํํ๋ ์ฑ
์์ ๊ฐ์ง๋ฏ๋ก ์
๋ ฅ ๊ฐ์ ์ ํจ์ฑ ๊ฒ์ฌ๋ฅผ ํ๋ ๊ฒ๋ ๊ทธ ์ฑ
์์ ๋ง๋ค๊ณ ์๊ฐํฉ๋๋ค! |
@@ -0,0 +1,88 @@
+package store.controller;
+
+import static store.constants.InputMessages.PRODUCTS_FILE_NAME;
+import static store.constants.InputMessages.PROMOTIONS_FILE_NAME;
+
+import java.util.List;
+import store.config.IoConfig;
+import store.domain.Choice;
+import store.domain.MembershipManager;
+import store.do... | Java | ๋์ํฉ๋๋ค! |
@@ -0,0 +1,172 @@
+package store.domain;
+
+import static store.constants.NumberConstants.FREEBIE_QUANTITY;
+
+import java.util.List;
+import store.dto.BuyGetQuantity;
+import store.dto.PromotionInfo;
+import store.io.InputView;
+
+public class PromotionManager {
+
+ private final List<PromotionInfo> promotionInfos;... | Java | ๋์ํฉ๋๋ค! |
@@ -0,0 +1,23 @@
+package store.constants;
+
+import static store.constants.StringConstants.NEW_LINE;
+import static store.constants.StringConstants.ONE_SPACE;
+import static store.constants.StringConstants.TAP;
+
+public class OutputMessages {
+ public static String WELCOME_MESSAGE = "์๋
ํ์ธ์. Wํธ์์ ์
๋๋ค." + NEW_LINE + ... | Java | ์ค ๊ทธ๋ ๊ตฐ์. ์ฐธ๊ณ ํ๊ฒ ์ต๋๋ค! |
@@ -0,0 +1,15 @@
+package store.constants;
+
+public class StringConstants {
+ public static final String COMMA = ",";
+ public static final String DASH = "-";
+ public static final String NEW_LINE = "\n";
+ public static final String TAP = "\t";
+ public static final String OPEN_SQUARE_BRACKETS = "[";
+... | Java | ์นญ์ฐฌ,,, ๊ฐ์ฌํฉ๋๋ค ๐ฅน |
@@ -0,0 +1,88 @@
+package store.controller;
+
+import static store.constants.InputMessages.PRODUCTS_FILE_NAME;
+import static store.constants.InputMessages.PROMOTIONS_FILE_NAME;
+
+import java.util.List;
+import store.config.IoConfig;
+import store.domain.Choice;
+import store.domain.MembershipManager;
+import store.do... | Java | ๋์น ๋ถ๋ถ ์ง์ด์ฃผ์
์ ๊ฐ์ฌํฉ๋๋ค :) |
@@ -0,0 +1,88 @@
+package store.controller;
+
+import static store.constants.InputMessages.PRODUCTS_FILE_NAME;
+import static store.constants.InputMessages.PROMOTIONS_FILE_NAME;
+
+import java.util.List;
+import store.config.IoConfig;
+import store.domain.Choice;
+import store.domain.MembershipManager;
+import store.do... | Java | ์ข์ ์๊ฒฌ ๊ฐ์ฌํฉ๋๋ค.
์ฌ์ฉ์๋ก๋ถํฐ ์
๋ ฅ์ ๋ฐ๊ณ ํ๋ฒ์ ๋ชจ๋ ๊ฑธ ์ฒ๋ฆฌํ๋ ค๊ณ ํ๋ ๊ฒ ์ค์์๋ค์.. ์ฑ
์ ๋ถ๋ฆฌ๊ฐ ๋ถ์กฑํ๋ ๊ฒ ๊ฐ์ต๋๋ค.
๋ฆฌํฉํ ๋ง์ ์ ์ฉํด ๋ณด๋๋ก ํ๊ฒ ์ต๋๋ค :) |
@@ -0,0 +1,60 @@
+package store.domain;
+
+import static camp.nextstep.edu.missionutils.DateTimes.now;
+
+import java.time.LocalDateTime;
+
+public enum Promotion {
+
+ NULL(""),
+ SPARKLING_BUY_TWO_GET_ONE_FREE("ํ์ฐ2+1"),
+ MD_RECOMMENDATION("MD์ถ์ฒ์ํ"),
+ FLASH_SALE("๋ฐ์งํ ์ธ");
+
+ private final String promo... | Java | ์ข์ ์๊ฒฌ ๊ฐ์ฌํฉ๋๋ค.
@slay1379๋ ๋ฆฌ๋ทฐ์๋ ์งง๊ฒ ์์ฑํ๊ธด ํ์ง๋ง ์ถ๊ฐ๋ก ๋ง์๋๋ฆฌ์๋ฉด
ํ์ฌ null์ ์ ์ธํ๊ณ ๋ ์ฝ๋์์ ์ง์ ์ฌ์ฉํ๋ ๋ถ๋ถ์ด ์์ง๋ง, ๋ณ๋ ๊ฐ๋ฅ์ฑ์ด ๋๊ธฐ ๋๋ฌธ์ ๋ฌธ์์ด ํ์
์ผ๋ก ๊ด๋ฆฌํ๋ ํธ์ด ๋ ์ข์ ๊ฒ ๊ฐ์ต๋๋ค. (๋ผ๊ณ ์์ฑํ๊ณ ๋ค์ ์๊ฐํด๋ณด๋ ํ
์คํธ ์ฝ๋๊ฐ ์์๋ค์...! ^^;; ํํ) |
@@ -0,0 +1,172 @@
+package store.domain;
+
+import static store.constants.NumberConstants.FREEBIE_QUANTITY;
+
+import java.util.List;
+import store.dto.BuyGetQuantity;
+import store.dto.PromotionInfo;
+import store.io.InputView;
+
+public class PromotionManager {
+
+ private final List<PromotionInfo> promotionInfos;... | Java | ์ข์ ์๊ฒฌ ๊ฐ์ฌํฉ๋๋ค. ์ด๋ฒ ๋ฏธ์
์์๋ ์ฑ
์ ๋ถ๋ฆฌ์ ๋ฏธํกํ๋ ๊ฒ ๊ฐ์์.
PromotionManager์ ์ฌ์ค์ ์๋น์ค์ฒ๋ผ ์ฌ์ฉํ๊ณ ์์๋ ๊ฒ ๊ฐ๊ณ , ์๊ฒฌ ์ฐธ๊ณ ํด์ ๋ฆฌํฉํ ๋งํด๋ณด๋ ค๊ณ ํฉ๋๋ค! ๊ฐ์ฌํฉ๋๋ค :) |
@@ -0,0 +1,172 @@
+package store.domain;
+
+import static store.constants.NumberConstants.FREEBIE_QUANTITY;
+
+import java.util.List;
+import store.dto.BuyGetQuantity;
+import store.dto.PromotionInfo;
+import store.io.InputView;
+
+public class PromotionManager {
+
+ private final List<PromotionInfo> promotionInfos;... | Java | ๋ง์ต๋๋ค... ์ธ์งํ๊ณ ์์ผ๋ฉด์๋ ๋น์ฅ ๋์๊ฐ๋ ๊ฒ ์ฐ์ ์ด์๊ธฐ์ ์ฐ๋ ๊ธฐ๋ฅผ ๋ง๋ค์๋ค์ใ
ใ
ใ
ใ
ใ
์
๋ ฅ ๋ฐ๋ ๋ถ๋ถ์ ์ ๋ถ ๋ฐ์ผ๋ก ๋นผ์ ๋ฆฌํฉํ ๋งํ ์์ ์
๋๋ค!
ํผ๋๋ฐฑ ๊ฐ์ฌํฉ๋๋ค. |
@@ -0,0 +1,172 @@
+package store.domain;
+
+import static store.constants.NumberConstants.FREEBIE_QUANTITY;
+
+import java.util.List;
+import store.dto.BuyGetQuantity;
+import store.dto.PromotionInfo;
+import store.io.InputView;
+
+public class PromotionManager {
+
+ private final List<PromotionInfo> promotionInfos;... | Java | ๊ทธ๋ ๊ตฐ์..! ํผ๋๋ฐฑ ๊ฐ์ฌํฉ๋๋ค. ๋ ๊ณต๋ถํด๋ณด๊ณ , ์ฐธ๊ณ ํด์ ๋ฆฌํฉํ ๋งํด๋ณด๊ฒ ์ต๋๋ค. |
@@ -0,0 +1,172 @@
+package store.domain;
+
+import static store.constants.NumberConstants.FREEBIE_QUANTITY;
+
+import java.util.List;
+import store.dto.BuyGetQuantity;
+import store.dto.PromotionInfo;
+import store.io.InputView;
+
+public class PromotionManager {
+
+ private final List<PromotionInfo> promotionInfos;... | Java | ๋ต ํผ๋๋ฐฑ ๊ฐ์ฌํฉ๋๋ค :)
์ผ๋จ ๋์๊ฐ๊ฒ ๋ง๋๋ ๊ฒ ๋ชฉ์ ์ด์๊ธฐ์ ์ด๋ฐ ๊ตฌ์กฐ๊ฐ ๋์๋ฒ๋ ธ๋ค์,, ใ
ใ
์
๋ ฅ ๋ฐ๋ ๋ถ๋ถ์ ์ปจํธ๋กค๋ฌ๋ก ๋นผ์ ๋ฆฌํฉํ ๋งํ ์์ ์
๋๋ค! |
@@ -0,0 +1,48 @@
+package store.domain;
+
+import static store.constants.NumberConstants.SINGLE_PRODUCT_QUANTITY;
+
+import java.util.ArrayList;
+import java.util.List;
+import store.exception.ProductNotExistException;
+
+public class StoreHouse {
+
+ private final List<Product> productList = new ArrayList<>();
+
+
... | Java | ์ ๊ทธ ๋ฐฉ๋ฒ๋ ์ข์ ๊ฒ ๊ฐ์ง๋ง, ๋์ผํ ์ด๋ฆ์ ๊ฐ์ง ์ํ์ ๋ชจ๋ ๊ฐ์ ธ์์ ๊ฐ ์ํฉ์ ๋ง๊ฒ ์ฒ๋ฆฌํ๋ ๋ก์ง์๋ List๊ฐ ๋ ์ ์ ํ ๊ฒ ๊ฐ์ต๋๋ค! ๋ค์ํ ์๋ฃ๊ตฌ์กฐ๋ฅผ ๊ณ ๋ฏผํด ๋ณผ ์ ์๊ฒ ํด์ฃผ์
์ ๊ฐ์ฌํฉ๋๋ค :) |
@@ -0,0 +1,115 @@
+package store.io;
+
+import static store.constants.InputMessages.ADDITIONAL_PURCHASE_MESSAGE;
+import static store.constants.InputMessages.FREEBIE_ADDITION_MESSAGE;
+import static store.constants.InputMessages.INPUT_PRODUCT_NAME_AND_QUANTITY;
+import static store.constants.InputMessages.MEMBERSHIP_DI... | Java | ๋ค์ํ ์๊ฒฌ ์ ์ํด ์ฃผ์
์ ๊ฐ์ฌํฉ๋๋ค!!
์ง๊ธ ๋ณด๋ ๊ทธ๋ ๋ค์,, ํ์ผ์ ๋ํ ์ฒ๋ฆฌ๋ ์์ฐํ ๋ทฐ์๋ ๋ค๋ฅธ ์ฑ
์์ธ๋ฐ (๊ฐ์ ์ฝ์ด๋ค์ธ๋ค๋ ๋ถ๋ถ์ ๊ฝํ) ์ด ๋ถ๋ถ์ ๊ฐ๊ณผํ๋ ๊ฒ ๊ฐ์ต๋๋ค.์๋น์ค๋ก ๋ถ๋ฆฌํ๋ ๋ฐฉ๋ฒ๋ ์ข์ ๊ฒ ๊ฐ์์!
ํ๋ ์๊ฒฌ์ ์ฌ์ญ๊ณ ์ถ์ ๊ฒ ์๋๋ฐ, **๋ทฐ์์ ์
๋ ฅ๊ฐ์ ๋ํ ํ์ฑ์ ํ๋ ๊ฒ์ ์ด๋ป๊ฒ ์๊ฐํ์๋์ง** ๊ถ๊ธํฉ๋๋ค!
ํ์ฌ๋ ์
๋ ฅ ๋ฐ๊ธฐ+๊ฒ์ฆ+ํ์ฑ์ ๋ชจ๋ ์ํํ๊ณ ์์ด ์ฑ
์ ๋ถ๋ฆฌ๊ฐ ์ ์ด๋ฃจ์ด์ง์ง ์์ ๊ฒ ๊ฐ๋ค๊ณ ๋๊ปด์ง๋๋ค...
๋ง์ํด ์ฃผ์ ๊ฒ์ฒ๋ผ ๋น ๊ฐ์ ๊ฒ์ฆํ๋ ๋ก์ง์ parser๋ก ํฌํจ์ํจ๋ค๊ณ ํ๋ฉด, ๋ทฐ์์๋ ์
๋ ฅ์ ๋ฐ๋ ๊ธฐ๋ฅ๋ง ์... |
@@ -0,0 +1,138 @@
+name: CI
+
+on:
+ pull_request:
+ types:
+ - closed
+
+env:
+ IMAGE: ${{ vars.NCR_REGISTRY }}/follow-app
+ IMAGE_LATEST: ${{ vars.NCR_REGISTRY }}/follow-app:latest
+
+jobs:
+ lint-test:
+ name: lint and test
+ uses: ./.github/workflows/DRF-test.yaml
+
+ send-discord-fail-message:
+... | Unknown | ๋ค๋ฅธ yaml ํ์ผ์ ์๋ workflow ๋ฅผ ๊ฐ์ ธ์์ ์ฌ์ฉํ์๋๊ฑฐ ๊ฐ์๋ฐ, ์์
๋ด์ ์๋ ๋ณ์๋ ๋ฐ๋ก ๊บผ๋ด์ ์ธ ์ ์๋์ ?? |
@@ -0,0 +1,49 @@
+name: DRF Test
+
+on:
+ push:
+ workflow_call:
+
+jobs:
+ lint:
+ name: black check
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ - uses: actions/setup-python@v4
+ with:
+ python-version: "3.11"
+ - name: install black
+ run: pip in... | Unknown | DB๊ด๋ จ ๋ณ์๋ค๋ secret์ผ๋ก ์ถ๊ฐํด์ฃผ์
์ ์ฒ๋ฆฌํด์ฃผ์๋ฉด ๋ ์ข์๊ฑฐ ๊ฐ์ต๋๋ค :) |
@@ -0,0 +1,138 @@
+name: CI
+
+on:
+ pull_request:
+ types:
+ - closed
+
+env:
+ IMAGE: ${{ vars.NCR_REGISTRY }}/follow-app
+ IMAGE_LATEST: ${{ vars.NCR_REGISTRY }}/follow-app:latest
+
+jobs:
+ lint-test:
+ name: lint and test
+ uses: ./.github/workflows/DRF-test.yaml
+
+ send-discord-fail-message:
+... | Unknown | health-check๋ ์ด๋ค์์ผ๋ก ํ์ธํ๊ฒ ๋๋๊ฑด์ง ๊ถ๊ธํฉ๋๋ค! |
@@ -0,0 +1,33 @@
+from django.core.management.base import BaseCommand
+from django.contrib.auth.models import User
+from tweet.models import Follow, Post
+
+
+class Command(BaseCommand):
+ def handle(self, **options):
+ # if db has user script doesn't work
+ if User.objects.filter(username="user0").exi... | Python | ์ด๋ฐ๋ฐฉ๋ฒ์ด ์๋ค๋ ๋ง์ด ๋ฐฐ์ฐ๊ณ ๊ฐ๋๋ค ๊ฐ์ฌํฉ๋๋ค |
@@ -0,0 +1,138 @@
+name: CI
+
+on:
+ pull_request:
+ types:
+ - closed
+
+env:
+ IMAGE: ${{ vars.NCR_REGISTRY }}/follow-app
+ IMAGE_LATEST: ${{ vars.NCR_REGISTRY }}/follow-app:latest
+
+jobs:
+ lint-test:
+ name: lint and test
+ uses: ./.github/workflows/DRF-test.yaml
+
+ send-discord-fail-message:
+... | Unknown | test๋ง ํ๊ธฐ ์ํด ๋ถ๋ฌ์ค๋ workflow๋ผ ๋ณ์๋ฅผ ๊ฐ์ ธ์ฌ ์๊ฐ์ ๋ชปํ๋ค์.
job๋ผ๋ฆฌ์ ๋ณ์ ๊ณต์ ๋ฐฉ๋ฒ์ผ๋ก ๊บผ๋ผ ์ ์์ ๊ฒ ๊ฐ๊ธด ํ๋ฐ ์๋๋ ์ํด๋ดค์ด์ |
@@ -0,0 +1,49 @@
+name: DRF Test
+
+on:
+ push:
+ workflow_call:
+
+jobs:
+ lint:
+ name: black check
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ - uses: actions/setup-python@v4
+ with:
+ python-version: "3.11"
+ - name: install black
+ run: pip in... | Unknown | ๋ง์์ ๋ค๋ง ์ ๋ถ๋ถ์ด ์์ ํ ํ
์คํธ๋ง์ ์ํ ๋ถ๋ถ์ด๋ผ ๊ด์ฐฎ์ ๊ฑฐ๋ผ๊ณ ์๊ฐํ์ด์
์๋ test์ฉ envํ์ผ์ git์ ๊ทธ๋๋ก ์ฌ๋ ค์ actions์์ ์ฌ์ฉํ์๋๋ฐ ์ ๊ฐ ์ค์๋ก ncp key๋ฅผ ๋ฃ์ด์ ์ฌ๋ฆฌ๋ ๋ฐ๋์ ๊ธํ๊ฒ ์์ ๊ฐ์ด ๋ณ๊ฒฝ๋ ๊ฑฐ์์.
์ ๋ ์ ๋ฐ์์ผ๋ก ์์ฑํ๊ธฐ์ ๋ณด๊ธฐ ์์ข์ ๋ณด์ฌ์ ์กฐ๊ธ ๋ ์ธ๋ จ๋ ๋ฐฉ์์ผ๋ก ๋ณ๊ฒฝํด ๋ณด๊ฒ ์ต๋๋ค |
@@ -0,0 +1,138 @@
+name: CI
+
+on:
+ pull_request:
+ types:
+ - closed
+
+env:
+ IMAGE: ${{ vars.NCR_REGISTRY }}/follow-app
+ IMAGE_LATEST: ${{ vars.NCR_REGISTRY }}/follow-app:latest
+
+jobs:
+ lint-test:
+ name: lint and test
+ uses: ./.github/workflows/DRF-test.yaml
+
+ send-discord-fail-message:
+... | Unknown | health-check๋ฅผ ํ์ธํ๋ ๋ถ๋ถ์ ์์ง ๋ง๋ค์ง ์์์ด์ ๋์ ์ DRF test๋ฅผ ํต๊ณผํ๋ฉด ์ ์ ๋์์ธ ๊ฑฐ๋ก ๊ฐ์ฃผํ๊ณ ๋ง๋ค๊ธด ํ์ด์
์ฌ์ค actions์์ health-check๋ฅผ ๊ตฌํํ๊ธฐ ์กฐ๊ธ ๊น๋ค๋ก์์ k8s ์ ์ฉํ๋ฉด์ health-check๋ ๊ตฌํ ํ ๊ณํ์
๋๋ค. |
@@ -0,0 +1,41 @@
+import { useState, useCallback } from 'react';
+import APIError from '../../api/apiError';
+
+interface UseFetchProps<TData> {
+ queryFn: () => Promise<TData>;
+ onError?: (error: APIError) => Promise<unknown> | unknown;
+}
+
+interface UseFetchResult<TData> {
+ query: () => Promise<void>;
+ isLoa... | TypeScript | hooks ๋๋ ํ ๋ฆฌ๋ฅผ components ๋๋ ํ ๋ฆฌ ๋ฐ์ผ๋ก ์ด๋์์ผ์ผ ํ์ง ์์๊น์~? |
@@ -0,0 +1,80 @@
+import { useEffect, useRef, useState } from 'react';
+import { LowerArrow, UpperArrow } from './Arrows';
+import * as S from './style';
+
+interface Option {
+ content: string;
+ value: string;
+}
+
+interface DropdownProps {
+ size: S.Size;
+ options: Option[];
+ defaultContent: string;
+ onSel... | Unknown | select ํ๊ทธ๋ฅผ ์ฌ์ฉํ์ง ์๊ณ ์ง์ ๋ฆฌ์คํธ๋ก ๋ง๋๋ ์ ์ฑ์ด ๋๋จํด์ :> |
@@ -0,0 +1,90 @@
+import { useEffect, useState } from 'react';
+import { SortOrder, SortType } from '../../api/types';
+import {
+ INITIAL_PAGE_NUMBER,
+ INITIAL_PAGE_SIZE,
+ PAGE_SIZE,
+} from '../../constants/paginationRules';
+import { Category, Product } from '../../types';
+import { productQueries } from './que... | TypeScript | ๋ฆฌ๋ทฐ ๊ฐ์ด๋์ ๋ฐ๋ผ ๋ฐ์ดํฐ ํ์นญ ๋ก์ง ๋ถ๋ถ์ ์กฐ๊ธ ๋ ๊ฐ์ ํ๋ค๋ฉด ์ข๊ฒ ๋๋ฐ์,
์ฌ์ค ์ ๋ ๋ชจ๋ฅด๊ฒ ์ด์ ๊ฐ์ด ๊ณ ๋ฏผํด๋ณด์์~~ |
@@ -0,0 +1,519 @@
+import React, { Component } from 'react';
+import * as d3 from 'd3';
+import drawData from './Module/loadHandle';
+import FilterContainer from './Components/FilterContainer';
+import LoginModal from './Components/LoginModal';
+import DrawContainer from './Components/DrawContainer';
+import './l... | JavaScript | ์์๋ก ๋นผ๋๋๊ฒ ์ข์๋ฏ.
`server/categories.js`์๋ ์ ์๋์ด์๊ณ server๋ client๋ ๊ฐ์ด ์ฐ๊ฒ ๋ ํ
๋ฐ ์ด๋ป๊ฒ ์ฒ๋ฆฌํ ์ง ์ ํ๋๊ฒ ์ข์๋ฏ |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.