Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/

### IntelliJ IDEA ###
.idea/modules.xml
.idea/jarRepositories.xml
.idea/compiler.xml
.idea/libraries/
*.iws
*.iml
*.ipr

### Eclipse ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/

### VS Code ###
.vscode/

### Mac OS ###
.DS_Store
3 changes: 3 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/encodings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

124 changes: 124 additions & 0 deletions .idea/uiDesigner.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

121 changes: 120 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,120 @@
# code-review
# 명령 게시판

## 목차
1. [출력 및 코드 설명](#출력-및-코드-설명)
- [레벨 1](#레벨-1)
- [레벨 2](#레벨-2)
- [레벨 3, 4](#레벨-3-4)
- [레벨 5](#레벨-5)
- [레벨 6](#레벨-6)
- [레벨 7](#레벨-7)
- [레벨 8](#레벨-8)
- [레벨 9](#레벨-9)
- [레벨 10](#레벨-10)

---

## 출력 및 코드 설명

### 레벨 1
#### 출력 결과
![레벨 1 출력](./images/level1.png)

#### 코드 설명
- **종료 기능**:
`while` 문에서 명령어로 `"종료"`가 입력되면 `break`를 통해 프로그램을 종료합니다.

---

### 레벨 2
#### 출력 결과
![레벨 2 출력](./images/level2.png)

#### 코드 설명
- **등록 기능**:
- 명령어로 `"등록"`이 입력되면 사용자로부터 **명언**과 **작가**에 대한 입력을 받습니다.

---

### 레벨 3, 4
#### 출력 결과
![레벨 3, 4 출력](./images/level3,4.png)

#### 코드 설명
- **등록 횟수 관리**:
- `count` 변수를 활용해 **명언 번호**를 등록 횟수에 따라 증가시킵니다.

---

### 레벨 5
#### 출력 결과
![레벨 5 출력](./images/level5.png)

#### 코드 설명
- **Switch 활용**:
- 명령어를 추가할 때의 편의성을 위해 `switch` 문으로 변경했습니다.
- **클래스 설계**:
- `noSpring.Quote` 클래스를 `public class`로 선언.
- **Getter**와 **Constructor**를 추가했습니다.
- **리스트 관리**:
- `List<noSpring.Quote> quotes`를 선언해 명언 객체를 저장합니다.
- **등록 및 출력 기능**:
- `"등록"` 명령어: 입력받은 데이터를 `quotes` 리스트에 추가.
- `"목록"` 명령어: 예제에 맞게 명언을 출력.

---

### 레벨 6
#### 출력 결과
![레벨 6 출력](./images/level6.png)

#### 코드 설명
- **삭제 명령어 추가**:
- `switch`에서 명령어를 처리할 때 입력을 `'?'` 기준으로 나눕니다.
- `"삭제"` 명령어 입력 시 조건에 맞는 데이터를 삭제합니다.

---

### 레벨 7
#### 출력 결과
![레벨 7 출력](./images/level7.png)

#### 코드 설명
- **예외 처리**:
- **`flag`** 변수를 사용해 예외 상황을 처리합니다.

---

### 레벨 8
#### 출력 결과
![레벨 8 출력](./images/level8.png)

#### 코드 설명
- **데이터 수정 기능**:
- `newQuote`와 `newAuthor`를 통해 새로운 데이터를 입력받습니다.
- `noSpring.Quote` 클래스에 **Setter**를 추가해 데이터를 수정 가능하도록 합니다.
- 수정 불가능한 `id`는 **`final`**로 선언.
- **코드 흐름**:
- 전반적인 로직은 `"삭제"` 기능과 유사하게 작성되었습니다.

### 레벨 9
#### 출력 결과
![레벨 9 출력](./images/level9.png)
- **종료 후**

![영속성 출력](./images/level9-1.png)
![파일 생성 출력](./images/level9-2.png)

#### 코드 설명
- **주요 변경점**:
- 데이터 저장 방식 : 메모리 -> 파일
- 프로그램이 종료되어도 영속성을 부여
- Jackson 라이브러리를 통해 JSON 활용

### 레벨 10
#### 출력 결과
![레벨 10 출력](./images/level10.png)
![레벨 10 출력](./images/level10-1.png)

#### 코드 설명
- "빌드" 명령어를 추가하였다.
5 changes: 5 additions & 0 deletions db/wiseSaying/2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"id" : 2,
"author" : "홍길동",
"content" : "현재와 자신을 사랑하라."
}
5 changes: 5 additions & 0 deletions db/wiseSaying/data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[ {
"id" : 2,
"author" : "홍길동",
"content" : "현재와 자신을 사랑하라."
} ]
1 change: 1 addition & 0 deletions db/wiseSaying/lastId.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2
Binary file added images/level1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/level10-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/level10.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/level2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/level3,4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/level5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/level6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/level7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/level8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/level9-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/level9-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/level9.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 31 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>org.example</groupId>
<artifactId>quote</artifactId>
<version>1.0-SNAPSHOT</version>


<properties>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencies>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.10.1</version>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.15.2</version> <!-- 최신 버전으로 교체하세요 -->
</dependency>
</dependencies>
</project>
3 changes: 3 additions & 0 deletions src/main/java/.idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions src/main/java/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions src/main/java/.idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading