Skip to content

Commit 1fb9974

Browse files
authored
Merge pull request #40 from jaewoo9797/part1-백재우-sprint1
[백재우] sprint1
2 parents d65d70e + fe85cbc commit 1fb9974

File tree

77 files changed

+3488
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+3488
-1
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: sprint mission 1 PR Test
2+
3+
on:
4+
push:
5+
branches:
6+
- 'part1-백재우-sprint1'
7+
pull_request:
8+
branches:
9+
- 'part1-백재우'
10+
paths:
11+
- 'codeit-bootcamp-spring/1-sprint-mission/**'
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v3
20+
21+
- name: ☕ JDK 17 세팅
22+
uses: actions/setup-java@v3
23+
with:
24+
distribution: 'adopt'
25+
java-version: '17'
26+
27+
28+
- name: ☕ gradlew 실행 권한 설정
29+
run: find . -name "gradlew" -exec chmod +x {} \;
30+
31+
- name: 🚀 테스트 진행
32+
run: cd codeit-bootcamp-spring/1-sprint-mission && ./gradlew --info test

.gitignore

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
# Created by https://www.toptal.com/developers/gitignore/api/intellij
2+
# Edit at https://www.toptal.com/developers/gitignore?templates=intellij
3+
4+
### Intellij ###
5+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
6+
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
7+
8+
# User-specific stuff
9+
.idea/**/workspace.xml
10+
.idea/**/tasks.xml
11+
.idea/**/usage.statistics.xml
12+
.idea/**/dictionaries
13+
.idea/**/shelf
14+
15+
# AWS User-specific
16+
.idea/**/aws.xml
17+
18+
# Generated files
19+
.idea/**/contentModel.xml
20+
21+
# Sensitive or high-churn files
22+
.idea/**/dataSources/
23+
.idea/**/dataSources.ids
24+
.idea/**/dataSources.local.xml
25+
.idea/**/sqlDataSources.xml
26+
.idea/**/dynamic.xml
27+
.idea/**/uiDesigner.xml
28+
.idea/**/dbnavigator.xml
29+
30+
# Gradle
31+
.idea/**/gradle.xml
32+
.idea/**/libraries
33+
34+
# Gradle and Maven with auto-import
35+
# When using Gradle or Maven with auto-import, you should exclude module files,
36+
# since they will be recreated, and may cause churn. Uncomment if using
37+
# auto-import.
38+
# .idea/artifacts
39+
# .idea/compiler.xml
40+
# .idea/jarRepositories.xml
41+
# .idea/modules.xml
42+
# .idea/*.iml
43+
# .idea/modules
44+
# *.iml
45+
# *.ipr
46+
47+
# CMake
48+
cmake-build-*/
49+
50+
# Mongo Explorer plugin
51+
.idea/**/mongoSettings.xml
52+
53+
# File-based project format
54+
*.iws
55+
56+
# IntelliJ
57+
out/
58+
59+
# mpeltonen/sbt-idea plugin
60+
.idea_modules/
61+
62+
# JIRA plugin
63+
atlassian-ide-plugin.xml
64+
65+
# Cursive Clojure plugin
66+
.idea/replstate.xml
67+
68+
# SonarLint plugin
69+
.idea/sonarlint/
70+
71+
# Crashlytics plugin (for Android Studio and IntelliJ)
72+
com_crashlytics_export_strings.xml
73+
crashlytics.properties
74+
crashlytics-build.properties
75+
fabric.properties
76+
77+
# Editor-based Rest Client
78+
.idea/httpRequests
79+
80+
# Android studio 3.1+ serialized cache file
81+
.idea/caches/build_file_checksums.ser
82+
83+
### Intellij Patch ###
84+
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721
85+
86+
# *.iml
87+
# modules.xml
88+
# .idea/misc.xml
89+
# *.ipr
90+
91+
# Sonarlint plugin
92+
# https://plugins.jetbrains.com/plugin/7973-sonarlint
93+
.idea/**/sonarlint/
94+
95+
# SonarQube Plugin
96+
# https://plugins.jetbrains.com/plugin/7238-sonarqube-community-plugin
97+
.idea/**/sonarIssues.xml
98+
99+
# Markdown Navigator plugin
100+
# https://plugins.jetbrains.com/plugin/7896-markdown-navigator-enhanced
101+
.idea/**/markdown-navigator.xml
102+
.idea/**/markdown-navigator-enh.xml
103+
.idea/**/markdown-navigator/
104+
105+
# Cache file creation bug
106+
# See https://youtrack.jetbrains.com/issue/JBR-2257
107+
.idea/$CACHE_FILE$
108+
109+
# CodeStream plugin
110+
# https://plugins.jetbrains.com/plugin/12206-codestream
111+
.idea/codestream.xml
112+
113+
# Azure Toolkit for IntelliJ plugin
114+
# https://plugins.jetbrains.com/plugin/8053-azure-toolkit-for-intellij
115+
.idea/**/azureSettings.xml
116+
117+
# End of https://www.toptal.com/developers/gitignore/api/intellij
118+
119+
/codeit-bootcamp-spring/1-sprint-mission/.idea
120+
.idea

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,10 @@
1-
# Spring 백엔드 트랙 1기 스프린트 미션 제출 리포지토리
1+
# Spring 백엔드 트랙 1기 스프린트 미션 제출 리포지토리
2+
3+
## 🌱 스프린트 미션 1
4+
### 고민하고 학습했던 내용 정리
5+
- [CI 테스트 자동화를 위해 github action을 설정하며 생긴 issue](https://github.com/jaewoo9797/githubActionFlow/blob/main/README.md)
6+
- [메서드 파라미터에 final 키워드 사용해야할까?](https://github.com/jaewoo9797/TIL/blob/main/java/%E2%9C%85%20%5BJAVA%5D%20parameter%20final.md)
7+
- [start test code, 갓 태어난 테스트 코더의 테스트란](https://github.com/jaewoo9797/TIL/blob/main/Test/%E2%9C%85%ED%85%8C%EC%8A%A4%ED%8A%B8%20%EC%BD%94%EB%93%9C%EC%97%90%20%EB%8C%80%ED%95%9C%20%EA%B3%A0%EB%AF%BC.md)
8+
- [생성자 초기화 시에 값이 없음을 나타내주어야 할까?](https://github.com/jaewoo9797/TIL/blob/main/java/%E2%9C%85At%20Initialized%20field%20null.md)
9+
- [static factory method 나도 한 번 사용해보자!](https://github.com/jaewoo9797/TIL/blob/main/java/%E2%9C%85%20%5BJAVA%5D%20%EC%A0%95%EC%A0%81%20%ED%8C%A9%ED%86%A0%EB%A6%AC%20%EB%A9%94%EC%86%8C%EB%93%9C.md)
10+
- [Optional method `of`, `ofNullable` 어떻게 사용하는 걸까?](https://github.com/jaewoo9797/TIL/blob/main/java/%E2%9C%85%20Optional.of%20%EC%99%80%20Optional.ofNullalbe.md)
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
.gradle
2+
build/
3+
!gradle/wrapper/gradle-wrapper.jar
4+
!**/src/main/**/build/
5+
!**/src/test/**/build/
6+
7+
### IntelliJ IDEA ###
8+
.idea/modules.xml
9+
.idea/jarRepositories.xml
10+
.idea/compiler.xml
11+
.idea/libraries/
12+
*.iws
13+
*.iml
14+
*.ipr
15+
out/
16+
!**/src/main/**/out/
17+
!**/src/test/**/out/
18+
19+
### Eclipse ###
20+
.apt_generated
21+
.classpath
22+
.factorypath
23+
.project
24+
.settings
25+
.springBeans
26+
.sts4-cache
27+
bin/
28+
!**/src/main/**/bin/
29+
!**/src/test/**/bin/
30+
31+
### NetBeans ###
32+
/nbproject/private/
33+
/nbbuild/
34+
/dist/
35+
/nbdist/
36+
/.nb-gradle/
37+
38+
### VS Code ###
39+
.vscode/
40+
41+
### Mac OS ###
42+
.DS_Store
Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
# 스프린트 미션 1
2+
디스코드 서비스 만들기
3+
4+
## 🚀 목표
5+
6+
1. Git과 GitHub을 통해 프로젝트를 관리할 수 있다.
7+
2. 채팅 서비스의 도메인 모델을 설계하고, Java로 구현할 수 있다.
8+
3. 인터페이스를 설계하고 구현체를 구현할 수 있다.
9+
4. 싱글톤 패턴을 구현할 수 있다.
10+
5. Java Collections Framework에 데이터를 생성/수정/삭제할 수 있다.
11+
6. Stream API를 통해 JCF의 데이터를 조회할 수 있다.
12+
7. [심화] 모듈 간 의존 관계를 이해하고 팩토리 패턴을 활용해 의존성을 관리할 수 있다.
13+
14+
## 프로젝트 마일스톤
15+
16+
- 프로젝트 초기화
17+
- 도메인 모델 구현
18+
- 서비스 인터페이스 설계 및 구현
19+
- 각 도메인 모델별 CRUD
20+
- JCF 메모리 기반
21+
- 의존성 주입
22+
23+
## ⭐ 요구사항
24+
25+
### 기본 요구사항
26+
27+
**1️⃣ 프로젝트 초기화**
28+
29+
- [x] IntelliJ를 통해 다음의 조건으로 Java 프로젝트를 생성합니다.
30+
- [x] IntelliJ에서 제공하는 프로젝트 템플릿 중 Java를 선택합니다.
31+
- [x] 프로젝트의 경로는 스프린트 미션 리포지토리의 경로와 같게 설정합니다.
32+
- [x] Create Git Repository 옵션은 체크하지 않습니다.
33+
- [x] Build system은 Gradle을 사용합니다. Gradle DSL은 Groovy를 사용합니다.
34+
- [x] JDK 17을 선택합니다.
35+
- [x] GroupId는 com.sprint.mission로 설정합니다.
36+
- [x] ArtifactId는 수정하지 않습니다.
37+
- [x] .gitignore에 IntelliJ와 관련된 파일이 형상관리 되지 않도록 .idea디렉토리를 추가합니다.
38+
39+
**2️⃣ 도메인 모델링**
40+
41+
- [ ] 디스코드 서비스를 활용해보면서 각 도메인 모델에 필요한 정보를 도출하고, Java Class로 구현하세요.
42+
- [x] 패키지명: `com.sprint.mission.discodeit.entity`
43+
- [ ] 도메인 모델 정의
44+
- [x] 공통
45+
- [x] `id`: 객체를 식별하기 위한 id로 UUID 타입으로 선언합니다.
46+
- [x] `createdAt`, `updatedAt`: 각각 객체의 생성, 수정 시간을 유닉스 타임스탬프로 나타내기 위한 필드로 Long 타입으로 선언합니다.
47+
-[ ] User
48+
- [ ] Channel
49+
- [ ] Message
50+
-[ ] 생성자
51+
- [x] `id`는 생성자에서 초기화하세요.
52+
- [x] `createdAt`는 생성자에서 초기화하세요.
53+
- [x] `id`, `createdAt`, `updatedAt`을 제외한 필드는 생성자의 파라미터를 통해 초기화하세요.
54+
- [ ] 메소드
55+
- [ ] 각 필드를 반환하는 `Getter` 함수를 정의하세요.
56+
- [ ] 필드를 수정하는 `update` 함수를 정의하세요.
57+
58+
**3️⃣ 서비스 설계 및 구현**
59+
60+
- [x] 도메인 모델 별 CRUD(생성, 읽기, 모두 읽기, 수정, 삭제) 기능을 인터페이스로 선언하세요.
61+
- [x] 인터페이스 패키지명: `com.sprint.mission.discodeit.service`
62+
- [x] 인터페이스 네이밍 규칙: `[도메인 모델 이름]Service`
63+
- [x] 다음의 조건을 만족하는 서비스 인터페이스의 구현체를 작성하세요.
64+
- [x] 클래스 패키지명: `com.sprint.mission.discodeit.service.jcf`
65+
- [x] 클래스 네이밍 규칙: `JCF[인터페이스 이름]`
66+
- [x] Java Collections Framework를 활용하여 데이터를 저장할 수 있는 필드(data)를 final로 선언하고 생성자에서 초기화하세요.
67+
- [x] `data` 필드를 활용해 생성, 조회, 수정, 삭제하는 메소드를 구현하세요.
68+
69+
**4️⃣ 메인 클래스 구현**
70+
71+
- [ ] 메인 메소드가 선언된 `JavaApplication` 클래스를 선언하고, 도메인 별 서비스 구현체를 테스트해보세요.
72+
- [ ] 등록
73+
- [ ] 조회(단건, 다건)
74+
- [ ] 수정
75+
- [ ] 수정된 데이터 조회
76+
- [ ] 삭제
77+
- [ ] 조회를 통해 삭제되었는지 확인
78+
79+
**5️⃣기본 요구사항 커밋 태그**
80+
81+
- [ ] 여기까지 진행 후 반드시 커밋해주세요. 그리고 `sprint1-basic` 태그를 생성해주세요.
82+
83+
### 심화 요구사항
84+
85+
**서비스 간 의존성 주입**
86+
87+
- [ ] 도메인 모델 간 관계를 고려해서 검증하는 로직을 추가하고, 테스트해보세요.
88+
- 힌트: Message를 생성할 때 연관된 도메인 모델 데이터 확인하기
89+
90+
## 📝 기능 명세서
91+
92+
### 🚶 User
93+
94+
- 새로운 고객이 회원가입을 통해 애플리케이션의 사용자가 된다.
95+
- 유저는 자신의 정보를 수정할 수 있다.
96+
- 유저는 해당 서비스를 탈퇴할 수 있다.
97+
- 유저는 새로운 채널을 생성할 수 있다.
98+
- 유저는 생성한 채널에 다른 사용자를 초대할 수 있다.
99+
- 유저는 채널에서 메시지를 전송할 수 있다.
100+
- 유저는 채널에서 전송한 메시지를 수정할 수 있다
101+
- 유저는 채널에 전송한 메세지를 삭제할 수 있다.
102+
103+
### ✉️ Message
104+
105+
- 메세지를 생성할 수 있다.
106+
- 메시지를 수정할 수 있다.
107+
- 메시지를 삭제할 수 있다.
108+
- 모든 메시지를 조회할 수 있다.
109+
- 특정 메시지를 조회할 수 있다.
110+
111+
### 🚪 Channel
112+
113+
- 채널을 생성한다.
114+
- 채널을 삭제한다.
115+
- 메시지를 관리한다.
116+
- 유저를 관리한다.
117+
118+
119+
### 모호한 부분 결정
120+
121+
`TODO`
122+
123+
- 생성 날짜와 수정 날짜는 우리가 아는 시간으로 저장하지 않고 `Long` 타입으로 유닉스 타임 스태프로 저장하고 있는다.
124+
125+
- 이에 이 정보를 반환해줄 때 long 타입으로 반환해서 사용하는것은 곳곳에 변환 구현 코드를 짜야한다. 이에 한 곳에서 변환하는 코드를 관리하고 싶다.
126+
127+
- 이를 관리하는 컨버터 ? 또는 수정할 때 저장 로직을 한 곳에서 관리?
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
plugins {
2+
id 'java'
3+
}
4+
5+
group = 'com.sprint.mission'
6+
version = '1.0-SNAPSHOT'
7+
8+
repositories {
9+
mavenCentral()
10+
}
11+
12+
dependencies {
13+
testImplementation platform('org.junit:junit-bom:5.10.0')
14+
testImplementation 'org.junit.jupiter:junit-jupiter'
15+
16+
// https://mvnrepository.com/artifact/org.mockito/mockito-core
17+
testImplementation 'org.mockito:mockito-core:4.11.0'
18+
// https://mvnrepository.com/artifact/org.assertj/assertj-core
19+
testImplementation 'org.assertj:assertj-core:3.24.2'
20+
21+
// https://mvnrepository.com/artifact/org.hibernate.validator/hibernate-validator
22+
implementation 'org.hibernate.validator:hibernate-validator:8.0.2.Final'
23+
// https://mvnrepository.com/artifact/org.glassfish.expressly/expressly
24+
implementation 'org.glassfish.expressly:expressly:5.0.0'
25+
// https://mvnrepository.com/artifact/com.google.guava/guava
26+
implementation 'com.google.guava:guava:33.2.1-jre'
27+
28+
}
29+
30+
test {
31+
useJUnitPlatform()
32+
}
Binary file not shown.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#Tue Jan 07 00:58:32 KST 2025
2+
distributionBase=GRADLE_USER_HOME
3+
distributionPath=wrapper/dists
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
5+
zipStoreBase=GRADLE_USER_HOME
6+
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)