From 60ad93a4d5abc8be5eac80e806bd37c9dc0cab0e Mon Sep 17 00:00:00 2001 From: Joung MyeongHee Date: Fri, 20 Dec 2024 12:15:35 +0900 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20=EB=AA=85=EC=96=B8=20=EA=B2=8C?= =?UTF-8?q?=EC=8B=9C=ED=8C=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 + Main.java | 125 ++++++++++++++++++ Quote.java | 32 +++++ db/wiseSaying/1.json | 1 + db/wiseSaying/2.json | 1 + db/wiseSaying/data.json | 1 + db/wiseSaying/lastId.txt | 1 + .../Main.class" | Bin 0 -> 6003 bytes .../Quote.class" | Bin 0 -> 1112 bytes .../db/wiseSaying/1.json" | 1 + .../db/wiseSaying/2.json" | 1 + .../db/wiseSaying/data.json" | 1 + .../db/wiseSaying/lastId.txt" | 1 + 13 files changed, 167 insertions(+) create mode 100644 .gitignore create mode 100644 Main.java create mode 100644 Quote.java create mode 100644 db/wiseSaying/1.json create mode 100644 db/wiseSaying/2.json create mode 100644 db/wiseSaying/data.json create mode 100644 db/wiseSaying/lastId.txt create mode 100644 "out/production/\353\252\205\354\226\270\352\262\214\354\213\234\355\214\220/Main.class" create mode 100644 "out/production/\353\252\205\354\226\270\352\262\214\354\213\234\355\214\220/Quote.class" create mode 100644 "out/production/\353\252\205\354\226\270\352\262\214\354\213\234\355\214\220/db/wiseSaying/1.json" create mode 100644 "out/production/\353\252\205\354\226\270\352\262\214\354\213\234\355\214\220/db/wiseSaying/2.json" create mode 100644 "out/production/\353\252\205\354\226\270\352\262\214\354\213\234\355\214\220/db/wiseSaying/data.json" create mode 100644 "out/production/\353\252\205\354\226\270\352\262\214\354\213\234\355\214\220/db/wiseSaying/lastId.txt" diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..79bee6f --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.idea +.out diff --git a/Main.java b/Main.java new file mode 100644 index 0000000..808c66c --- /dev/null +++ b/Main.java @@ -0,0 +1,125 @@ +import java.util.*; +import java.io.FileWriter; +import java.io.IOException; +import org.json.simple.JSONArray; + +public class Main { + static Map quotes = new HashMap<>(); + static int n = 0; + static Scanner sc = new Scanner(System.in); + static StringBuilder sb = new StringBuilder(); + + public static void main(String[] args) { + System.out.println("== 명언 앱 =="); + boolean continueFlag = true; + + while(continueFlag) { + System.out.printf("명령) "); + String[] command = sc.nextLine().split("\\?"); + int id=0; + if(command.length > 1){ + id = Integer.parseInt(command[1].split("=")[1]); + } + switch (command[0]) { + case "등록": + addQuote(); + break; + case "목록": + showQuote(); + break; + case "삭제": + deleteQuote(id); + break; + case "수정": + modifyQuote(id); + break; + case "종료": + sc.close(); + continueFlag = false; + saveLastId(); + break; + case "빌드": + buildJson(); + break; + default: + System.out.println("알 수 없는 명령어입니다."); + } + } + } + + public static void addQuote() { + n++; + System.out.printf("명언: "); + String quote = sc.nextLine(); + System.out.printf("작가: "); + String author = sc.nextLine(); + Quote q = new Quote(n, quote, author); + quotes.put(n, q); + saveQuoteAsFile(q); + System.out.println(n + "번 명언이 등록되었습니다."); + } + public static void saveQuoteAsFile(Quote q) { + String fileName = String.format("db/wiseSaying/%d.json", q.id); + saveFile(fileName, q.toJson().toJSONString()); + } + public static void deleteQuote(int id) { + if (quotes.get(id) == null) { + System.out.printf("%d번 명언은 존재하지 않습니다. %n", id); + } else { + quotes.remove(id); + System.out.println(id + "번째 명언이 삭제되었습니다."); + } + } + public static void showQuote() { + System.out.println("번호 / 작가 / 명언"); + System.out.println("----------------------"); + for (int i : quotes.keySet()) { + String result = sb.append(quotes.get(i).id).append(" / ").append(quotes.get(i).getAuthor()).append(" / ").append(quotes.get(i).getQuote()).toString(); + System.out.println(result); + sb.setLength(0); + } + } + + public static void modifyQuote(int id) { + if(quotes.get(id) == null) { + System.out.printf("%d번 명언은 존재하지 않습니다. %n", id); + return; + } + + System.out.printf("명언(기존): %s%n", quotes.get(id).getQuote()); + System.out.printf("명언: "); + String quote2 = sc.nextLine(); + System.out.printf("작가(기존): %s%n", quotes.get(id).getAuthor()); + System.out.printf("작가: "); + String author2 = sc.nextLine(); + + quotes.put(id, new Quote(id, quote2, author2)); + System.out.println(id + "번 명언이 수정되었습니다."); + } + + public static void saveLastId() { + String fileName = "db/wiseSaying/lastId.txt"; + saveFile(fileName, String.valueOf(n)); + } + + public static void buildJson() { + String fileName = "db/wiseSaying/data.json"; + JSONArray jsonList = new JSONArray(); + for (int i : quotes.keySet()) { + jsonList.add(quotes.get(i).toJson()); + } + saveFile(fileName, jsonList.toJSONString()); + System.out.println("data.json 파일의 내용이 갱신되었습니다."); + } + + public static void saveFile(String fileName, String content) { + try { + FileWriter file = new FileWriter(fileName); + file.write(content); + file.flush(); + file.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } +} diff --git a/Quote.java b/Quote.java new file mode 100644 index 0000000..841d2ed --- /dev/null +++ b/Quote.java @@ -0,0 +1,32 @@ +import java.util.HashMap; +import java.util.Map; +import org.json.simple.JSONObject; + +public class Quote { + Map quoteMap; + int id; + private String quote; + private String author; + + public Quote(int id, String quote, String author) { + this.id = id; + this.quote = quote; + this.author = author; + } + + public String getQuote() { + return this.quote; + } + + public String getAuthor() { + return this.author; + } + + public JSONObject toJson() { + JSONObject obj = new JSONObject(); + obj.put("id", this.id); + obj.put("quote", this.quote); + obj.put("author", this.author); + return obj; + } +} \ No newline at end of file diff --git a/db/wiseSaying/1.json b/db/wiseSaying/1.json new file mode 100644 index 0000000..f1d8f43 --- /dev/null +++ b/db/wiseSaying/1.json @@ -0,0 +1 @@ +{"quote":"현재를 사랑하라","author":"작자미상","id":1} \ No newline at end of file diff --git a/db/wiseSaying/2.json b/db/wiseSaying/2.json new file mode 100644 index 0000000..b67f41d --- /dev/null +++ b/db/wiseSaying/2.json @@ -0,0 +1 @@ +{"quote":"과거에 집착하지 마라","author":"작자미상","id":2} \ No newline at end of file diff --git a/db/wiseSaying/data.json b/db/wiseSaying/data.json new file mode 100644 index 0000000..0eaa48f --- /dev/null +++ b/db/wiseSaying/data.json @@ -0,0 +1 @@ +[{"quote":"과거에 집착하지 마라","author":"작자미상","id":2}] \ No newline at end of file diff --git a/db/wiseSaying/lastId.txt b/db/wiseSaying/lastId.txt new file mode 100644 index 0000000..d8263ee --- /dev/null +++ b/db/wiseSaying/lastId.txt @@ -0,0 +1 @@ +2 \ No newline at end of file diff --git "a/out/production/\353\252\205\354\226\270\352\262\214\354\213\234\355\214\220/Main.class" "b/out/production/\353\252\205\354\226\270\352\262\214\354\213\234\355\214\220/Main.class" new file mode 100644 index 0000000000000000000000000000000000000000..03bec9551c2303617ccb91138278b9a2d01e2965 GIT binary patch literal 6003 zcmaJ_34Bz=8UN4jCi}8^5Lh52gkw1pa=~KI2qfH!1QI}l!5~#0$s;V;?1tSJAlkz! zSOnVQ0fH3^YMYAMa=8RhtG2~fZELH&?~|4+tvzk)LH{%FCE0{%^4ooHX1@96JO1A> z`^x)go(C{bEbzevw-+8AX-F3sveDRV1j9z8DY$&yMzg^ZNUsb>>llXN0>cK_Dd26De8Lg3F0^?oA;~xtX{soy(~vEok#EVLa!H7i6 zScMN0Fwu)iI`UBG=2ojZ6fp&c7dnTg>ZGBN2dtUvLorIcDAh3qQ~R1+ zDKC%~Zw-fN^vMG#Sd^-vV=WES1O)9~hUs2hspBe?cgv_GsESx-lNqCotwtEU55`!vN<~D5^+d3H?Dt1oqB^;$PRA;>+!AdJ zt#5a>O+dYl)sk6SLpT~&?APe{h@A1ojm>7Y5x1%uC4*aatW~G3YYT-Nm&BtH4eJCZ zB=_zPP?13L!MnS5J|KgEpiS;OnS5k>*RCC1yB?n^(blNL#Ckf4I1{wy2I^$T&8&ci zjT|K(x%a}+J7xvE2vZtIzGg&ZEJprT!k?@Nk5-u@W~9Q^ z@qY@hZbV!@C2ji&9e3c96jPd9sXjlxC=@34e1+9&%%tFFj=M|8Hf$Fd*C`5ZdKaYXJ%EzVl!n6sQ}P?Tj_+`aLGs`of#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6?9J;&PYZ*L`Ol+i%8h^aCzV@|`ojs+|VR8P6P ze&h_DP(VAfz1Z1)C(tyytqJuM(UDwNbX>(UYZ}Ka@rf}3O9VS-J(FB1sEA4tb%CNP z_N6@*s3d`LR!#sg7=Z~S8E612NSC3KssG>}Mn~acrIWm?o zjT!#xT;evpW)hDTtnx-Cr7M&rm1TAfxyi^olv% nJXJ}$F~`o&voi~v!6H*!QmV~_IZe69Y23#H>IytmB|iEEs~Fi9 literal 0 HcmV?d00001 diff --git "a/out/production/\353\252\205\354\226\270\352\262\214\354\213\234\355\214\220/db/wiseSaying/1.json" "b/out/production/\353\252\205\354\226\270\352\262\214\354\213\234\355\214\220/db/wiseSaying/1.json" new file mode 100644 index 0000000..f1d8f43 --- /dev/null +++ "b/out/production/\353\252\205\354\226\270\352\262\214\354\213\234\355\214\220/db/wiseSaying/1.json" @@ -0,0 +1 @@ +{"quote":"현재를 사랑하라","author":"작자미상","id":1} \ No newline at end of file diff --git "a/out/production/\353\252\205\354\226\270\352\262\214\354\213\234\355\214\220/db/wiseSaying/2.json" "b/out/production/\353\252\205\354\226\270\352\262\214\354\213\234\355\214\220/db/wiseSaying/2.json" new file mode 100644 index 0000000..b67f41d --- /dev/null +++ "b/out/production/\353\252\205\354\226\270\352\262\214\354\213\234\355\214\220/db/wiseSaying/2.json" @@ -0,0 +1 @@ +{"quote":"과거에 집착하지 마라","author":"작자미상","id":2} \ No newline at end of file diff --git "a/out/production/\353\252\205\354\226\270\352\262\214\354\213\234\355\214\220/db/wiseSaying/data.json" "b/out/production/\353\252\205\354\226\270\352\262\214\354\213\234\355\214\220/db/wiseSaying/data.json" new file mode 100644 index 0000000..68bfb30 --- /dev/null +++ "b/out/production/\353\252\205\354\226\270\352\262\214\354\213\234\355\214\220/db/wiseSaying/data.json" @@ -0,0 +1 @@ +[{"author":"작자미상","quote":"현재를 사랑하라","id":"1"},{"author":"ㅇㅇㅇㅇ","quote":"현재를 사랑하랑ㅇㅇ","id":"2"}] \ No newline at end of file diff --git "a/out/production/\353\252\205\354\226\270\352\262\214\354\213\234\355\214\220/db/wiseSaying/lastId.txt" "b/out/production/\353\252\205\354\226\270\352\262\214\354\213\234\355\214\220/db/wiseSaying/lastId.txt" new file mode 100644 index 0000000..d8263ee --- /dev/null +++ "b/out/production/\353\252\205\354\226\270\352\262\214\354\213\234\355\214\220/db/wiseSaying/lastId.txt" @@ -0,0 +1 @@ +2 \ No newline at end of file From 58ad347935ad3d2a4cfc90e6eb77bdca420bee3a Mon Sep 17 00:00:00 2001 From: Joung MyeongHee Date: Fri, 20 Dec 2024 17:10:22 +0900 Subject: [PATCH 2/2] =?UTF-8?q?feat:=2011=EB=8B=A8=EA=B3=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- com/ll/wiseSaying/src/App.java | 74 ++++++++++++++++ com/ll/wiseSaying/src/Main.java | 11 +++ com/ll/wiseSaying/src/WiseSaying.java | 23 +++++ .../wiseSaying/src/WiseSayingController.java | 59 +++++++++++++ .../wiseSaying/src/WiseSayingRepository.java | 32 +++++++ com/ll/wiseSaying/src/WiseSayingService.java | 79 ++++++++++++++++++ com/ll/wiseSaying/test/TestUtil.java | 32 +++++++ .../test/WiseSayingControllerTest.java | 75 +++++++++++++++++ db/wiseSaying/1.json | 2 +- db/wiseSaying/data.json | 2 +- db/wiseSaying/lastId.txt | 2 +- .../.gitignore" | 2 + .../Main.class" | Bin 6003 -> 0 bytes .../Quote.class" | Bin 1112 -> 0 bytes .../README.md" | 1 + .../com/ll/wiseSaying/src/App.class" | Bin 0 -> 2668 bytes .../com/ll/wiseSaying/src/Main.class" | Bin 0 -> 721 bytes .../com/ll/wiseSaying/src/WiseSaying.class" | Bin 0 -> 910 bytes .../src/WiseSayingController.class" | Bin 0 -> 2804 bytes .../src/WiseSayingRepository.class" | Bin 0 -> 1782 bytes .../wiseSaying/src/WiseSayingService.class" | Bin 0 -> 4582 bytes .../com/ll/wiseSaying/test/TestUtil.class" | Bin 0 -> 1520 bytes .../test/WiseSayingControllerTest.class" | Bin 0 -> 1865 bytes .../db/wiseSaying/1.json" | 2 +- .../db/wiseSaying/data.json" | 2 +- .../db/wiseSaying/lastId.txt" | 2 +- .../wiseSaying10/Main.class" | Bin 0 -> 6187 bytes .../wiseSaying10/Quote.class" | Bin 0 -> 1151 bytes Main.java => wiseSaying10/Main.java | 9 +- Quote.java => wiseSaying10/Quote.java | 3 +- 30 files changed, 402 insertions(+), 10 deletions(-) create mode 100644 com/ll/wiseSaying/src/App.java create mode 100644 com/ll/wiseSaying/src/Main.java create mode 100644 com/ll/wiseSaying/src/WiseSaying.java create mode 100644 com/ll/wiseSaying/src/WiseSayingController.java create mode 100644 com/ll/wiseSaying/src/WiseSayingRepository.java create mode 100644 com/ll/wiseSaying/src/WiseSayingService.java create mode 100644 com/ll/wiseSaying/test/TestUtil.java create mode 100644 com/ll/wiseSaying/test/WiseSayingControllerTest.java create mode 100644 "out/production/\353\252\205\354\226\270\352\262\214\354\213\234\355\214\220/.gitignore" delete mode 100644 "out/production/\353\252\205\354\226\270\352\262\214\354\213\234\355\214\220/Main.class" delete mode 100644 "out/production/\353\252\205\354\226\270\352\262\214\354\213\234\355\214\220/Quote.class" create mode 100644 "out/production/\353\252\205\354\226\270\352\262\214\354\213\234\355\214\220/README.md" create mode 100644 "out/production/\353\252\205\354\226\270\352\262\214\354\213\234\355\214\220/com/ll/wiseSaying/src/App.class" create mode 100644 "out/production/\353\252\205\354\226\270\352\262\214\354\213\234\355\214\220/com/ll/wiseSaying/src/Main.class" create mode 100644 "out/production/\353\252\205\354\226\270\352\262\214\354\213\234\355\214\220/com/ll/wiseSaying/src/WiseSaying.class" create mode 100644 "out/production/\353\252\205\354\226\270\352\262\214\354\213\234\355\214\220/com/ll/wiseSaying/src/WiseSayingController.class" create mode 100644 "out/production/\353\252\205\354\226\270\352\262\214\354\213\234\355\214\220/com/ll/wiseSaying/src/WiseSayingRepository.class" create mode 100644 "out/production/\353\252\205\354\226\270\352\262\214\354\213\234\355\214\220/com/ll/wiseSaying/src/WiseSayingService.class" create mode 100644 "out/production/\353\252\205\354\226\270\352\262\214\354\213\234\355\214\220/com/ll/wiseSaying/test/TestUtil.class" create mode 100644 "out/production/\353\252\205\354\226\270\352\262\214\354\213\234\355\214\220/com/ll/wiseSaying/test/WiseSayingControllerTest.class" create mode 100644 "out/production/\353\252\205\354\226\270\352\262\214\354\213\234\355\214\220/wiseSaying10/Main.class" create mode 100644 "out/production/\353\252\205\354\226\270\352\262\214\354\213\234\355\214\220/wiseSaying10/Quote.class" rename Main.java => wiseSaying10/Main.java (94%) rename Quote.java => wiseSaying10/Quote.java (96%) diff --git a/com/ll/wiseSaying/src/App.java b/com/ll/wiseSaying/src/App.java new file mode 100644 index 0000000..62093fb --- /dev/null +++ b/com/ll/wiseSaying/src/App.java @@ -0,0 +1,74 @@ +package com.ll.wiseSaying.src; + +import java.util.Scanner; + +public class App { + public Scanner sc; + static String[] commands = {"등록", "목록", "빌드", "종료"}; + static String patternDelete = "삭제\\?id=\\d+"; + static String patternUpdate = "수정\\?id=\\d+"; + + static boolean commandNeedId = false; + + WiseSayingController wiseSayingController; + + public void run(Scanner sc) { + + this.sc = sc; + wiseSayingController = new WiseSayingController(sc); + System.out.println("== 명언 앱 =="); + while (true) { + System.out.printf("명령) "); + String commandInput = sc.nextLine(); + String command = ""; + int id = 0; + if(!validCommand(commandInput)) { + System.out.println("올바른 명령어가 아닙니다."); + continue; + } + if(commandNeedId){ + command = commandInput.split("\\?")[0]; + id = Integer.parseInt(commandInput.split("=")[1]); + }else{ + command = commandInput; + } + switch (command) { + case "등록": + wiseSayingController.addWiseSaying(); + break; + case "목록": + wiseSayingController.showWiseSaying(); + break; + case "빌드": + wiseSayingController.buildJson(); + break; + case "삭제": + wiseSayingController.removeWiseSaying(id); + break; + case "수정": + wiseSayingController.updateWiseSaying(id); + break; + case "종료": + wiseSayingController.terminate(); + sc.close(); + return; + } + } + } + + public boolean validCommand(String command) { + if(command.length() == 2) { + commandNeedId = false; + for (String c : commands) { + if (c.equals(command)) { + return true; + } + } + } else if (command.matches(patternDelete) || command.matches(patternUpdate)) { + commandNeedId = true; + return true; + } + return false; + } + +} diff --git a/com/ll/wiseSaying/src/Main.java b/com/ll/wiseSaying/src/Main.java new file mode 100644 index 0000000..3b5e5df --- /dev/null +++ b/com/ll/wiseSaying/src/Main.java @@ -0,0 +1,11 @@ +package com.ll.wiseSaying.src; + +import java.util.Scanner; + +public class Main { + public static void main(String[] args) { + App app = new App(); + Scanner scanner = new Scanner(System.in); + app.run(scanner); + } +} diff --git a/com/ll/wiseSaying/src/WiseSaying.java b/com/ll/wiseSaying/src/WiseSaying.java new file mode 100644 index 0000000..b25845e --- /dev/null +++ b/com/ll/wiseSaying/src/WiseSaying.java @@ -0,0 +1,23 @@ +package com.ll.wiseSaying.src; + +import org.json.simple.JSONObject; + +public class WiseSaying { + int id; + String content; + String author; + + public WiseSaying(int id, String content, String author) { + this.id = id; + this.content = content; + this.author = author; + } + + public JSONObject toJson() { + JSONObject obj = new JSONObject(); + obj.put("id", this.id); + obj.put("quote", this.content); + obj.put("author", this.author); + return obj; + } +} diff --git a/com/ll/wiseSaying/src/WiseSayingController.java b/com/ll/wiseSaying/src/WiseSayingController.java new file mode 100644 index 0000000..c3814eb --- /dev/null +++ b/com/ll/wiseSaying/src/WiseSayingController.java @@ -0,0 +1,59 @@ +package com.ll.wiseSaying.src; + +import java.util.Scanner; + +public class WiseSayingController { + WiseSayingService wiseSayingService = new WiseSayingService(); + Scanner sc; + + public WiseSayingController(Scanner sc) { + this.sc = sc; + } + public void addWiseSaying() { + System.out.printf("명언 : "); + String content = sc.nextLine(); + System.out.printf("작가 : "); + String author = sc.nextLine(); + int id = wiseSayingService.addWiseSaying(content, author); + System.out.println(id + "번 명언이 등록되었습니다."); + } + + public void removeWiseSaying(int id) { + try { + wiseSayingService.removeWiseSaying(id); + System.out.println(id + "번째 명언이 삭제되었습니다."); + }catch (Exception e){ + System.out.println(e); + } + + } + + public void updateWiseSaying(int id) { + try { + System.out.printf("명언 : "); + String content = sc.nextLine(); + System.out.printf("작가 : "); + String author = sc.nextLine(); + wiseSayingService.updateWiseSaying(id, content, author); + System.out.println(id + "번 명언이 수정되었습니다."); + } catch (Exception e){ + System.out.println(e); + } + + } + + public void showWiseSaying() { + System.out.println("번호 / 작가 / 명언"); + System.out.println("----------------------"); + System.out.println(wiseSayingService.getAllWiseSaying()); + } + + public void buildJson() { + wiseSayingService.buildJson(); + System.out.println("data.json 파일의 내용이 갱신되었습니다."); + } + + public void terminate(){ + wiseSayingService.saveLastId(); + } +} diff --git a/com/ll/wiseSaying/src/WiseSayingRepository.java b/com/ll/wiseSaying/src/WiseSayingRepository.java new file mode 100644 index 0000000..1195290 --- /dev/null +++ b/com/ll/wiseSaying/src/WiseSayingRepository.java @@ -0,0 +1,32 @@ +package com.ll.wiseSaying.src; +import java.util.HashMap; +import java.util.Map; + +public class WiseSayingRepository { + public Map wiseSayingList = new HashMap<>(); + public int lastId = 0; + + public void addWiseSaying(WiseSaying wiseSaying) { + wiseSayingList.put(wiseSaying.id, wiseSaying); + } + + public void removeWiseSaying(int id) { + wiseSayingList.remove(id); + } + + public WiseSaying getWiseSaying(int id) { + return wiseSayingList.get(id); + } + + public Map getAllWiseSayings() { + return wiseSayingList; + } + + public void updateWiseSaying(int id, String quote, String author) { + wiseSayingList.put(id, new WiseSaying(id, quote, author)); + } + + public int getLastId() { + return lastId; + } +} diff --git a/com/ll/wiseSaying/src/WiseSayingService.java b/com/ll/wiseSaying/src/WiseSayingService.java new file mode 100644 index 0000000..09c9a69 --- /dev/null +++ b/com/ll/wiseSaying/src/WiseSayingService.java @@ -0,0 +1,79 @@ +package com.ll.wiseSaying.src; +import java.io.FileWriter; +import java.io.IOException; +import java.util.Map; + +import org.json.simple.JSONArray; +public class WiseSayingService { + WiseSayingRepository wiseSayingRepository = new WiseSayingRepository(); + static String dirName = "db/wiseSaying/"; + + /* + * @return 생성된 명언의 id + * */ + public int addWiseSaying(String content, String author) { + WiseSaying wiseSaying = new WiseSaying(++wiseSayingRepository.lastId, content, author); + wiseSayingRepository.addWiseSaying(wiseSaying); + saveWiseSayingAsFile(wiseSaying); + return wiseSaying.id; + } + + public void removeWiseSaying(int id) { + if(wiseSayingRepository.getWiseSaying(id) != null){ + wiseSayingRepository.removeWiseSaying(id); + } else { + throw new IllegalArgumentException(String.format("%d번 명언은 존재하지 않습니다.", id)); + } + } + + public void updateWiseSaying(int id, String content, String author) { + if(wiseSayingRepository.getWiseSaying(id) != null){ + wiseSayingRepository.updateWiseSaying(id, content, author); + } else { + throw new IllegalArgumentException(String.format("%d번 명언은 존재하지 않습니다.", id)); + } + } + + public String getAllWiseSaying() { + StringBuilder sb = new StringBuilder(); + Map wiseSayingList = wiseSayingRepository.wiseSayingList; + String result = ""; + for (int i : wiseSayingList.keySet()) { + WiseSaying ws = wiseSayingList.get(i); + result = sb.append(ws.id).append(" / ").append(ws.author).append(" / ").append(ws.content).append("\n").toString(); + } + return result; + } + + public void buildJson() { + String fileName = dirName + "data.json"; + Map wiseSayingList = wiseSayingRepository.wiseSayingList; + JSONArray jsonList = new JSONArray(); + for (int i : wiseSayingList.keySet()) { + jsonList.add(wiseSayingList.get(i).toJson()); + } + saveFile(fileName, jsonList.toJSONString()); + } + + + + public void saveWiseSayingAsFile(WiseSaying wiseSaying) { + String fileName = String.format("%s%d.json", dirName, wiseSaying.id); + saveFile(fileName, wiseSaying.toJson().toJSONString()); + } + public void saveFile(String fileName, String content) { + try { + FileWriter file = new FileWriter(fileName); + file.write(content); + file.flush(); + file.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + + public void saveLastId() { + String fileName = dirName + "lastId.txt"; + saveFile(fileName, String.valueOf(wiseSayingRepository.lastId)); + } +} diff --git a/com/ll/wiseSaying/test/TestUtil.java b/com/ll/wiseSaying/test/TestUtil.java new file mode 100644 index 0000000..558b454 --- /dev/null +++ b/com/ll/wiseSaying/test/TestUtil.java @@ -0,0 +1,32 @@ +package com.ll.wiseSaying.test; + +import java.io.*; +import java.util.Scanner; + +public class TestUtil { + // gen == generate 생성하다. + // 테스트용 스캐너 생성 + public static Scanner genScanner(final String input) { + final InputStream in = new ByteArrayInputStream(input.getBytes()); + + return new Scanner(in); + } + + // System.out의 출력을 스트림으로 받기 + public static ByteArrayOutputStream setOutToByteArray() { + final ByteArrayOutputStream output = new ByteArrayOutputStream(); + System.setOut(new PrintStream(output)); + + return output; + } + + // setOutToByteArray 함수의 사용을 완료한 후 정리하는 함수, 출력을 다시 정상화 하는 함수 + public static void clearSetOutToByteArray(final ByteArrayOutputStream output) { + System.setOut(new PrintStream(new FileOutputStream(FileDescriptor.out))); + try { + output.close(); + } catch (IOException e) { + throw new RuntimeException(e); + } + } +} diff --git a/com/ll/wiseSaying/test/WiseSayingControllerTest.java b/com/ll/wiseSaying/test/WiseSayingControllerTest.java new file mode 100644 index 0000000..0e53062 --- /dev/null +++ b/com/ll/wiseSaying/test/WiseSayingControllerTest.java @@ -0,0 +1,75 @@ +package com.ll.wiseSaying.test; + +import com.ll.wiseSaying.src.App; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; + +import static org.assertj.core.api.Assertions.assertThat; +import java.util.*; +import java.io.ByteArrayOutputStream; + +public class WiseSayingControllerTest { + App app; + @BeforeEach + void beforeEach() { + app = new App(); + } + + @Test + @DisplayName("등록 명령 처리") + void addWiseSaying() { + String input = """ + 등록 + 현재를 사랑하라. + 작자미상 + 종료 + """; + + Scanner scanner = TestUtil.genScanner(input); + + ByteArrayOutputStream outputStream = TestUtil.setOutToByteArray(); + + app.run(scanner); + String output = outputStream.toString().trim(); + assertThat(output) + .contains("== 명언 앱 ==") + .contains("명언 :") + .contains("작가 :") + .contains("1번 명언이 등록되었습니다."); + TestUtil.clearSetOutToByteArray(outputStream); + } + + @Test + @DisplayName("목록 명령 처리") + void showWiseSaying() { + String input = """ + 등록 + 현재를 사랑하라. + 작자미상 + 등록 + 과거에 집착하지 마라. + 작자미상 + 목록 + 삭제?id=1 + 삭제?id=1 + """; + + Scanner scanner = TestUtil.genScanner(input); + + ByteArrayOutputStream outputStream = TestUtil.setOutToByteArray(); + + app.run(scanner); + String output = outputStream.toString().trim(); + + assertThat(output) + .contains("== 명언 앱 ==") + .contains("1 / 작자미상 / 현재를 사랑하라.") + .contains("2 / 작자미상 / 과거에 집착하지 마라.") + .contains("1번 명언이 삭제되었습니다.") + .contains("1번 명언은 존재하지 않습니다."); + + TestUtil.clearSetOutToByteArray(outputStream); + } + +} diff --git a/db/wiseSaying/1.json b/db/wiseSaying/1.json index f1d8f43..51cb308 100644 --- a/db/wiseSaying/1.json +++ b/db/wiseSaying/1.json @@ -1 +1 @@ -{"quote":"현재를 사랑하라","author":"작자미상","id":1} \ No newline at end of file +{"quote":"현재를 사랑하라.","author":"작자미상","id":1} \ No newline at end of file diff --git a/db/wiseSaying/data.json b/db/wiseSaying/data.json index 0eaa48f..17b0b4b 100644 --- a/db/wiseSaying/data.json +++ b/db/wiseSaying/data.json @@ -1 +1 @@ -[{"quote":"과거에 집착하지 마라","author":"작자미상","id":2}] \ No newline at end of file +[{"quote":"adfadsf","author":"ㅁㅇㄹㅁㅇ","id":1},{"quote":"과거에 집착하지 마라","author":"작자미상","id":2}] \ No newline at end of file diff --git a/db/wiseSaying/lastId.txt b/db/wiseSaying/lastId.txt index d8263ee..56a6051 100644 --- a/db/wiseSaying/lastId.txt +++ b/db/wiseSaying/lastId.txt @@ -1 +1 @@ -2 \ No newline at end of file +1 \ No newline at end of file diff --git "a/out/production/\353\252\205\354\226\270\352\262\214\354\213\234\355\214\220/.gitignore" "b/out/production/\353\252\205\354\226\270\352\262\214\354\213\234\355\214\220/.gitignore" new file mode 100644 index 0000000..79bee6f --- /dev/null +++ "b/out/production/\353\252\205\354\226\270\352\262\214\354\213\234\355\214\220/.gitignore" @@ -0,0 +1,2 @@ +.idea +.out diff --git "a/out/production/\353\252\205\354\226\270\352\262\214\354\213\234\355\214\220/Main.class" "b/out/production/\353\252\205\354\226\270\352\262\214\354\213\234\355\214\220/Main.class" deleted file mode 100644 index 03bec9551c2303617ccb91138278b9a2d01e2965..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6003 zcmaJ_34Bz=8UN4jCi}8^5Lh52gkw1pa=~KI2qfH!1QI}l!5~#0$s;V;?1tSJAlkz! zSOnVQ0fH3^YMYAMa=8RhtG2~fZELH&?~|4+tvzk)LH{%FCE0{%^4ooHX1@96JO1A> z`^x)go(C{bEbzevw-+8AX-F3sveDRV1j9z8DY$&yMzg^ZNUsb>>llXN0>cK_Dd26De8Lg3F0^?oA;~xtX{soy(~vEok#EVLa!H7i6 zScMN0Fwu)iI`UBG=2ojZ6fp&c7dnTg>ZGBN2dtUvLorIcDAh3qQ~R1+ zDKC%~Zw-fN^vMG#Sd^-vV=WES1O)9~hUs2hspBe?cgv_GsESx-lNqCotwtEU55`!vN<~D5^+d3H?Dt1oqB^;$PRA;>+!AdJ zt#5a>O+dYl)sk6SLpT~&?APe{h@A1ojm>7Y5x1%uC4*aatW~G3YYT-Nm&BtH4eJCZ zB=_zPP?13L!MnS5J|KgEpiS;OnS5k>*RCC1yB?n^(blNL#Ckf4I1{wy2I^$T&8&ci zjT|K(x%a}+J7xvE2vZtIzGg&ZEJprT!k?@Nk5-u@W~9Q^ z@qY@hZbV!@C2ji&9e3c96jPd9sXjlxC=@34e1+9&%%tFFj=M|8Hf$Fd*C`5ZdKaYXJ%EzVl!n6sQ}P?Tj_+`aLGs`of#hMvz*86Z?oW1buy<#2 z=QB<~1o9*DtjBabF3(DjnJv-HrXK=#Y3LBhA)|}?I|IRh9Ta@AV@1OgMCp_P|0KsJ zbv%Wq$+6jNuayc6?asw^wl*z-`71c;#W5YnaiR~H)dnqOnK8qPGF@i(*<0nzlfg4c zcyUTcCr%6ad!wP7gdxS`xr_xt<<8Y|$5|cE;yLCcStt6}h#tR};j21cQ0bTTu};RN z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~_IZe69Y23#H>IytmB|iEEs~Fi9 diff --git "a/out/production/\353\252\205\354\226\270\352\262\214\354\213\234\355\214\220/README.md" "b/out/production/\353\252\205\354\226\270\352\262\214\354\213\234\355\214\220/README.md" new file mode 100644 index 0000000..4444cb9 --- /dev/null +++ "b/out/production/\353\252\205\354\226\270\352\262\214\354\213\234\355\214\220/README.md" @@ -0,0 +1 @@ +# code-review \ No newline at end of file diff --git "a/out/production/\353\252\205\354\226\270\352\262\214\354\213\234\355\214\220/com/ll/wiseSaying/src/App.class" "b/out/production/\353\252\205\354\226\270\352\262\214\354\213\234\355\214\220/com/ll/wiseSaying/src/App.class" new file mode 100644 index 0000000000000000000000000000000000000000..e6fb679127559edd842707df93809800d01e1fef GIT binary patch literal 2668 zcma)8>vI!T6#w14c2l;LrnXSASYM@01A&SWXiKTBXt9J!v{D_zIz4x4Z&hMOaPk*}b z?GFGp;@ui};8oz$;734U(QbWOk6OAt8QnUu+ekVBfgaN~oecus_KwjYR0I{&XjlME zpgEaIM=dM5*UTFUeV<9Od@dR7&t?TY`J_O@u&c1(m{v5A)NR|ybt_mX5T0Lh`#*{X zGPaY;SeB8iK`j^=MUa zgN7S%6OnO&xl&R<$x1zzP1RLT-B?gDvF+{{RdI`eO1qk~~`C3gw* z%ph`LZxkjp3Er1#(%B>pK z;5GqmTDQ#9Kqj5m?bKB~+o9riftzQKpDus#cKMU@5DlK$pFK(XK}jDxK6~=0iiair;eql;hh>538YbieP^+g>my1yDq%;_E zXJLLSv-iraNexqSD>zXwt<>gx#+CxRH9QK7kmrnaX4<$cBH(Ku>KK)0Yz-OrOd*@n zojGUZ<{k|>SFK~@(x%OQnU;=*f?V|{txTRPeb}qvF^OQnGVDobO6JAm8lJ$D1htwM z#H(SRP|BlEYj_6F(&Mb|@FIKAundPm2+gULYUJf*&ue%=CbN>(o#d2}mnsfucyX?Z z`(0;L93)y5$jAH4RPT7IQ^hNC&4vEb8sVsfy-rqBypWzSa`)*ImTN;MsavCZ&Xjz0 z(dSH=^k?Z+9x^_i(609 zsy_EMiA*7vG&Y&iAeGuz%EtgV&~FcWM*u?h08*-i+?|Q1I};RlW{Gl!e3$w4QG!i| z-$Uf0ocT_`AO0HR3<(bo^DDQxh*$a5s`P7kot(fMsOOi$9*fEpE)~L^UqK0fhuX2u zuTl3ELTAwwx~_y}a=zL7Jv=3}ZSO20yd|_M?v44vkrKL2V4>WP@m%rZuV=A#2G>PG zJtb`LcEuy1K@z^M^Vk&g72%J>SFHDYVu5CV3B#Y!5dLO30%-a`THJ%h+kW9ZjKx1L z;yjKeEp?nNEV=tH&QGElzjHp^><^8Uux$pT-dLcB5%QxhzsV>0jpQG2`IukwtH|$g z`L=-MTgi{Re3K&iMdTlH`G6V=GzL!bj!6#r^K;z75#?CNF~G5vV`unFgi3g%i0%rN zEMj$q+Ev7INj3UPFpF4viB1<$S2>X-jQKOg3q>mOy1|-83+Z}Z7vi^pjy9qVO)S>M z>>o?8nk(zrLi@24gFL$#%aCBtN-~QKHo;ZwX1AkFtVg@(XA>Jlr?>|Z5ywigo&9GA zTS*dKVi(qkG>dN!Vj_pNZgQ;Qt)1d7yvbbi@cba&BITt-KaSvSCJ565mDG`x%vFJ- zv^R=S^96(z^zlzD6MtcoB z2!M?Iwo7i4lAu)Fu1DYkniRYvMAM(}dm8+_;P^lF7?+6g7goMU-pTmCXwJciU=0V7nRTyQJ#sryq3%DbT#Df!m1Nby@!vFvP literal 0 HcmV?d00001 diff --git "a/out/production/\353\252\205\354\226\270\352\262\214\354\213\234\355\214\220/com/ll/wiseSaying/src/Main.class" "b/out/production/\353\252\205\354\226\270\352\262\214\354\213\234\355\214\220/com/ll/wiseSaying/src/Main.class" new file mode 100644 index 0000000000000000000000000000000000000000..e9b913ac5117ffcbb3e08169e6bc241c0b2761cb GIT binary patch literal 721 zcmZ{i?P?Q26o%hP(r&Y^wn=PE+N!nnBWcCGfQTr9AZ+!=N}%-DWF6|1{bD~_dRh9z zKnq@g7bU*48_+_!12cQ(oO#ZB&dl#WSHA$f#et0mnig6PR0`+GdRxz_g$LWung^vK&Jwgg$`Xmka4WC zHtyn{g>?rT=-kNUU*?611R6RP*z~HCI&nY7X<7J1rerj+VWVd>-WM2*mWGU{CVSt( z0}LoOD+%i_LjTt>F;#2{Y%QNv*%?GV5disEK}=os!a9;$}TEO$D}Z$-ve#ftA;tCZo=9 zqig}&Ps%J%AG9f?Z3=y5dW|O-@)ek`0b$+&=WSXpSHX4VU=H!Ua_?|9Zf@csXJ_&M z2#;yCu}fHeI6#vF7+%9Vo}=wu!#@52XO8aC;me=c{0Ho!#XvqSjvgTcUbcbn)&T5b YpVk^Wc#3Dl_bA~xUQ}vF^fWO33y2DzIRF3v literal 0 HcmV?d00001 diff --git "a/out/production/\353\252\205\354\226\270\352\262\214\354\213\234\355\214\220/com/ll/wiseSaying/src/WiseSaying.class" "b/out/production/\353\252\205\354\226\270\352\262\214\354\213\234\355\214\220/com/ll/wiseSaying/src/WiseSaying.class" new file mode 100644 index 0000000000000000000000000000000000000000..6c06e97c560f1050294de2150546b6808a13f169 GIT binary patch literal 910 zcmah{VQ|Zg;HQZhq}$V%}q<$sD3lS7!wl{mS%ilVew<>o~)$w&C<^JuQU;7 zH1P-cqm1{JMo1Qwg!k^fJ@=mT?!7;Meft66C7!CtAgds!VGVhP^@(%sSiTdCt^R1j z-H0Lo+zY(u1w+&e85 zhAP$>6juZh52$wCUh)m1kn+0{Sl7^yz`PSjmm*ZK!LTX9u{D{Az?yl}E1z2@gZ}A4 zqY53_0!k|GVN=1DhHczus4Z*vh;Ph8qP}+gnD^f@G>u+sg*`=dWvvGqcCkkfzKTiX zGh+p|Ane|btkz0F1w3R}dl!p{7tmlZjNVFK`rO-*){r6hN?dS;s_g~*G@g!lc;<|J ziqvi4I{wfJJ?W>xTy*Kp820V|O`}UKjl>BxkzvPZ*?(^-A+usMVc7mRNF9hcbopyf zimNW?-jTh>9?ddCdzPg??F*fd8<5;IV7fD)7U7W2N96hB=jhhW8!&Tg4#hm0qii0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(3DLL54b`?a zTSlHc>vU}-my9bC`v2dQwN%m;J9u~a*v!O-_ZCNpi-e=hwz2_J9M5xh9)8!REBXLZ z^jF9i9-!qug3+P-=vbwJ57X|}CXOv=LNmdF=p_6MSGr4^@is1S2Hr)&2@9BQxY=`Y zi!Q|OV|URR+UoxuzBN2I6TOFyHSA1?#mKtFNxlpY4X+`3gs-A^s-V>{5%CoO;x{Na!70B&8^N@GhTxv~I){sBI8Web;O3%fidsI-#dn~@P0X&Nh&`isE`4PCj`YbY4iX?Vt^KfHGhM@s=5 zZydl;jF$t5GP7Xmv{KM6-p@NRK)H5NsNIxxkd}LJ91-^NAvd5=7E%|Vg|I$acDus* zX;TR@Q4TUu6=Vy1e`DMWbGBS6Q-l$!_KS#4Fy-R=_0qS9XAKiIbr5nz8KL4aR=_^$ zyx%3Jlu$g^lDJ>EBIaWd{`x#LH$`6kF!2aC9h-hTmciNt9D literal 0 HcmV?d00001 diff --git "a/out/production/\353\252\205\354\226\270\352\262\214\354\213\234\355\214\220/com/ll/wiseSaying/src/WiseSayingRepository.class" "b/out/production/\353\252\205\354\226\270\352\262\214\354\213\234\355\214\220/com/ll/wiseSaying/src/WiseSayingRepository.class" new file mode 100644 index 0000000000000000000000000000000000000000..00c9a77d637e8145dee51fc553d4af36ff0dcfeb GIT binary patch literal 1782 zcmbW1YfsZq7{~u-8`O=CZs4Y4ihzRMxXim~5kcg#I3;lg!ppMNQBu~~wHUsWFEoK5 zk{Dn6p^VRI%UT7q#5c`3r_cZQT+jLW>)Uq#3n(WLK~z9YL=SoyQoHKDS~ApTqqM%g ztJQ3V-Z{Og+w%-jxv(MN5<}WGa%|lwt*Pyu*J>*P0ns@6APPu|=!e8mteJZy!zg{! z+gepU&AqNVFr$r24kRmeFwq33>uyPz3 zWCdIiah3lW>E@FmqSq4`LSDc%5!W$%mX4cqxoK++&0-MtRm0KN-!o+8a>0uwY@zgF z1fv4RMBKzJhU6d7QmtAJB{3_9lwLiR^Cw}vZ^Y>nB5p&bY%Oii+}9W;E};EGTNE+L zwb6!VC#XczyuC9FvRn@Nui6%MB^;4|QrKXKSM^3ywH=E*uXrN2a%oHS3+aZP3X;#jL5uhHB}2?;pnO9lgyk)s-Dg68T7~^?ER5 z4C8WFy}}bt1S7~W)?GuF#p_JiS&XKISV^jT_;{QTQP&F5D3Wf`Fajy1pO*b5pOv3- zT>Ja%|67uBT6NXd0+$Ru9~{$mn-aVR{$$WNs*b&5(iMqQtQG$v($i3;3RX?Ws%a}a z?`SR{2JM;QK#bB|j?nWH0bP7Z^ewr&JG7z;PHTZy^d8aoF6~wkr4^7V9)lH6A#5EZ zeuP9ZdW6&$S9*`W{bUA`#YiX-;y&#}PlyM2NIQl{c0?Y?T+1PfB=5qDp0E>R&X18`c!4FihB>^X c74QBsR(zM?xKp3VcR2mw3*u%pK-_BWHy0{~8~^|S literal 0 HcmV?d00001 diff --git "a/out/production/\353\252\205\354\226\270\352\262\214\354\213\234\355\214\220/com/ll/wiseSaying/src/WiseSayingService.class" "b/out/production/\353\252\205\354\226\270\352\262\214\354\213\234\355\214\220/com/ll/wiseSaying/src/WiseSayingService.class" new file mode 100644 index 0000000000000000000000000000000000000000..16fe4a8122459730889ff3767a728e4cfc0fc8d5 GIT binary patch literal 4582 zcmb7H>thsG9X&U@$!s5DhZT8$ZJVUX(1^XQYcH4U>h15>Z6n0AsMpSS!ZSg zsg~9%ilEl2RH|*YwVK+Z78(*Dw)I)HKI{Aa_)Po<{2-n?Gua0TMn7bB=01Lp^ERYSE;Y8jS86IIPDVfs%G3WjNaf0`(jF6odpC z;^s&+nT#GWY`s?-Gq~8c;?V=y&wKQ=X&a7djfJ5gP>M3B3KpqYjBRQM`Zgrc2B?7ezZ75}&OI0kxaweSAY$uiw5V0^SutGw!QlP#*)|Er2 z*Rhy)+uV_jeKO}&DyngVz#=V?$l)STSHEEFZPG#+R;#Fy7M9uCsGc*?VedAQdMV>t zqhhTLx5!9HkLy&_VLd$#>P~LC^cdT?uuo~BUd2Whc%cP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?0tz5jH0Ix#ovGJMbh4P5CV0k11>dVr-`U z^(aRI-~i!TYEn13=Hxx!UEvvPZ2Z4#)B6mJrWz98*l!Zil6N)z!EptPx}a z>v-)$uM@P8K+rvfD*84r(O)2qgWoYS)qrlLG@u=EI)ysX73huALAQZ76iZ+eSs(N> zH7=w~2(U|x7rtS#ihDll1@3=A3+bN|`k(wdr>ZXWVgR$mBBs($69M|@?Et+Wrgf06 jA^Mm{g2o1kaSPj?_z7P_j;bU?4kXMbD6m715xo5iPK9hM literal 0 HcmV?d00001 diff --git "a/out/production/\353\252\205\354\226\270\352\262\214\354\213\234\355\214\220/com/ll/wiseSaying/test/WiseSayingControllerTest.class" "b/out/production/\353\252\205\354\226\270\352\262\214\354\213\234\355\214\220/com/ll/wiseSaying/test/WiseSayingControllerTest.class" new file mode 100644 index 0000000000000000000000000000000000000000..84101853717019a00d05138798efe777401d2675 GIT binary patch literal 1865 zcmah~T~ixX7=8{3-E_N^k75;DB!H9z3M*}uN*ZmTtzRi<1EGvphp@sjo88RrrVe+0 zb%wECwBuB{fl*t%aF|g#Esa|J0sa7gguDFfxKV5gfuEgEj+wpW-#2LII;8h7@I7_j8Dh@@VKo!STkJ#D72laCL zR1hLFPCy}(@fgn0i7M`&Up|i0iQ1)q)Va47Qgt`($AfBhZmzrEthrx2aBi$QH|~yj zrE*?E1{0Lxf~IgYS6eT=VZa*YHI>XWL??|!g`p*@>dI8PxIo>+7c{zQ&l&};<+-VP z=kPLWFRSGKXq_he-|kFNE*F#!DaRLiVVP#Zm9lQDMJ2CVDxqg|-LSbGB)vE5g>j`! zJn8?Y82PI&H@w8T*=u>M~Gj7&aPi z!2^cl4Y+!ffLQi55MNNOlEzo3cu^s(=4)IlQ^Y%hTzkoPzWp`s-dlHm+@iqcjIvo! zE~#Etx~fh;IsZmHzp1Ma(PRb~{b-ER8lgSSXj&)fB-7WEH4i=n+onwuF3{?U0SOoV z)mOkJyh$hEEs{3*kH>v5(i{98!u&%Vd;qbE;r%55twf-0AC45_yiGFC$~zt;-rd9e zo5(fO&DHkS>`(>mmn(RFYVbb9lRG#*yo2}-PK-x8qZJHA|G>a}qBj`d5-E`_f2YTt$hann+W9TO@Phgs6Sq=%zA?f>ZCg2zP w5y337xJ;hJ@E)c}yNQspw13}6PT>kkqwxG~Az6;TGo(FhAy1z>;M1& literal 0 HcmV?d00001 diff --git "a/out/production/\353\252\205\354\226\270\352\262\214\354\213\234\355\214\220/db/wiseSaying/1.json" "b/out/production/\353\252\205\354\226\270\352\262\214\354\213\234\355\214\220/db/wiseSaying/1.json" index f1d8f43..51cb308 100644 --- "a/out/production/\353\252\205\354\226\270\352\262\214\354\213\234\355\214\220/db/wiseSaying/1.json" +++ "b/out/production/\353\252\205\354\226\270\352\262\214\354\213\234\355\214\220/db/wiseSaying/1.json" @@ -1 +1 @@ -{"quote":"현재를 사랑하라","author":"작자미상","id":1} \ No newline at end of file +{"quote":"현재를 사랑하라.","author":"작자미상","id":1} \ No newline at end of file diff --git "a/out/production/\353\252\205\354\226\270\352\262\214\354\213\234\355\214\220/db/wiseSaying/data.json" "b/out/production/\353\252\205\354\226\270\352\262\214\354\213\234\355\214\220/db/wiseSaying/data.json" index 68bfb30..17b0b4b 100644 --- "a/out/production/\353\252\205\354\226\270\352\262\214\354\213\234\355\214\220/db/wiseSaying/data.json" +++ "b/out/production/\353\252\205\354\226\270\352\262\214\354\213\234\355\214\220/db/wiseSaying/data.json" @@ -1 +1 @@ -[{"author":"작자미상","quote":"현재를 사랑하라","id":"1"},{"author":"ㅇㅇㅇㅇ","quote":"현재를 사랑하랑ㅇㅇ","id":"2"}] \ No newline at end of file +[{"quote":"adfadsf","author":"ㅁㅇㄹㅁㅇ","id":1},{"quote":"과거에 집착하지 마라","author":"작자미상","id":2}] \ No newline at end of file diff --git "a/out/production/\353\252\205\354\226\270\352\262\214\354\213\234\355\214\220/db/wiseSaying/lastId.txt" "b/out/production/\353\252\205\354\226\270\352\262\214\354\213\234\355\214\220/db/wiseSaying/lastId.txt" index d8263ee..56a6051 100644 --- "a/out/production/\353\252\205\354\226\270\352\262\214\354\213\234\355\214\220/db/wiseSaying/lastId.txt" +++ "b/out/production/\353\252\205\354\226\270\352\262\214\354\213\234\355\214\220/db/wiseSaying/lastId.txt" @@ -1 +1 @@ -2 \ No newline at end of file +1 \ No newline at end of file diff --git "a/out/production/\353\252\205\354\226\270\352\262\214\354\213\234\355\214\220/wiseSaying10/Main.class" "b/out/production/\353\252\205\354\226\270\352\262\214\354\213\234\355\214\220/wiseSaying10/Main.class" new file mode 100644 index 0000000000000000000000000000000000000000..262e7a1831fbf302b9a222dacfe8172722af4e43 GIT binary patch literal 6187 zcmaJ_33yc175?umd2c2ULIwz7A6Y^+2nLNv0tnPdAOSTr7+fEdM>1qG6J}nJ*v+c6 z2(-0T6s%ZmZBw^aLL369wYGMld$qOuzM8T7UX}j$zL#VY#?JS>x!bwto_o%JmiNxS zar#*Rmx+x*c;MCGGvG&_z@(k#ZnG+8#@nklZ{KM}Y=OMGXgq4K67ZImwFICepdn}= zAI2E+=H8TTb&)F3!%b5g6{BdP>dIs^Za3RW%j~MvF_C*#t_%-7x;Jz0U^sK=czET? zASR(uL&(5nOc9uzW2b=DE&0UaWL@g;Rzi|-G~QlY)}o_GKqud!W2ef(l4Y@h>6k(J z)y^FPbvZU(o5jnyaBW#m(F2%;*&5~;n2WGL;my&M)ok|i@C%n#HJMQg=1D~;y|cT= zj>f8*BW65qC2ND2hxr;77+8oB?o}7erl90;YmeO+javd!N?i%EFQ}uG2VA#0h;meD zs5Gz`OUCM7X+prC>W)QefkioPTb6xYS9Lm;3J4mZ8p||XWZ+`d49ln_Xo%ZZyOpGj z-DWanarh=SXpq7!H*hIdkhsH4b*xLY@j}E+gN`~{V(9MULk}I5WUCCUCj5|R?dmaO zsc{^KEwN36 z76V(=a#x})x}(?KHV>@^wn=9GNGy?3?5{I$y_^ZA%-vR_nX((&B!e3b+@wz3-V=?r zZAc~JI<^bU%N#lw=0(Dp``$CO{~qZX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_9Qnp8VfL*V>GWc!xV^`2)Bb zAEJg2u}YSqPFmp(e%~wMiicD;h(&Y;2l)B$yoNa%PW^`^Z9slVag;z3O(|huMB&OT z#ZnjJ&2n5${>-seHaRb!#>>ibl46`wG|IVOyveSYMs|&J8|f($57K*PR8-P;9ETw@ zLg82Apis>?58kQ(*I+(cu>jW*6xUNZH!#-T$S)l?;ZB&i3la38jjw{%h|2&24opb7 zjZsIs%w1R@%A^_0(S%X!4SJ zt1EpWHj8pm;UcUMo;NU;@l?Z*!dVqb`9;E2*_DcHY=`Tz2H zqYrvhWm+(aOT88`EuM2ziX-J7GV5hJxdkD-jqC3u#oHNa-hnxImy%MZf&eCnN+t{s zSA1fLsA7*ty7J22QfXdgREGIh4d;BU6D}Mv!WJbXPebT1xZma){708{y*BEM5O=# literal 0 HcmV?d00001 diff --git "a/out/production/\353\252\205\354\226\270\352\262\214\354\213\234\355\214\220/wiseSaying10/Quote.class" "b/out/production/\353\252\205\354\226\270\352\262\214\354\213\234\355\214\220/wiseSaying10/Quote.class" new file mode 100644 index 0000000000000000000000000000000000000000..ddaedf4f5812f4148af3f1fcce8caf577051f229 GIT binary patch literal 1151 zcmaJ<`)|@v6#g!+0xM%YWIEX9e3r7&&F2!9MPssr1xE}9jOX6gfP#i_@42Vn`M&e|@$>6<08j8ZjR>L=Vlv`LFsuyq3th8xd!V&@L!<98 zBo0j5^bQ%KO0}Cp5-AC38B35E^6$*C(b3PZ(kLRD#8Mj9 zuqL4_qk?sY+?2a%d&az}7wArAF=l`SoB%<#&3m`35%*iAGVH zGw86D^PXy#A@Lx zr(9HKTM%YI^%3H!m?DkSbB<|%3>$>~_c*DXsM8xVRQ?Z2cO2jC8%HKjJ}uIy^O0kV zRwzR29Haj&+y=uPvLd)kC#|WlX${3qdq#JRFmWh!R_SFCmd6&=OE9%OfuwFvkWqIg z$bA%1DxD>Y0I|i8K?=+C%kr&7jl60Qk8SMGiz#OKWq-os81JY%9C`x?v3;!zT AVgLXD literal 0 HcmV?d00001 diff --git a/Main.java b/wiseSaying10/Main.java similarity index 94% rename from Main.java rename to wiseSaying10/Main.java index 808c66c..0d2b879 100644 --- a/Main.java +++ b/wiseSaying10/Main.java @@ -1,3 +1,5 @@ +package wiseSaying10; + import java.util.*; import java.io.FileWriter; import java.io.IOException; @@ -9,6 +11,7 @@ public class Main { static Scanner sc = new Scanner(System.in); static StringBuilder sb = new StringBuilder(); + static String dirName = "db/wiseSaying/"; public static void main(String[] args) { System.out.println("== 명언 앱 =="); boolean continueFlag = true; @@ -59,7 +62,7 @@ public static void addQuote() { System.out.println(n + "번 명언이 등록되었습니다."); } public static void saveQuoteAsFile(Quote q) { - String fileName = String.format("db/wiseSaying/%d.json", q.id); + String fileName = String.format("%s%d.json", dirName, q.id); saveFile(fileName, q.toJson().toJSONString()); } public static void deleteQuote(int id) { @@ -98,12 +101,12 @@ public static void modifyQuote(int id) { } public static void saveLastId() { - String fileName = "db/wiseSaying/lastId.txt"; + String fileName = dirName + "lastId.txt"; saveFile(fileName, String.valueOf(n)); } public static void buildJson() { - String fileName = "db/wiseSaying/data.json"; + String fileName = dirName + "data.json"; JSONArray jsonList = new JSONArray(); for (int i : quotes.keySet()) { jsonList.add(quotes.get(i).toJson()); diff --git a/Quote.java b/wiseSaying10/Quote.java similarity index 96% rename from Quote.java rename to wiseSaying10/Quote.java index 841d2ed..7301544 100644 --- a/Quote.java +++ b/wiseSaying10/Quote.java @@ -1,4 +1,5 @@ -import java.util.HashMap; +package wiseSaying10; + import java.util.Map; import org.json.simple.JSONObject;