Skip to content

Commit a240c76

Browse files
committed
Merge branch 'dev'
2 parents 1b6dd40 + 797798b commit a240c76

File tree

4 files changed

+214
-6
lines changed

4 files changed

+214
-6
lines changed

README.md

Lines changed: 207 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,207 @@
1-
# Runnect-Spring-Boot-Server
1+
# Runnect-Spring-Boot-Server
2+
3+
4+
### 점과 점으로, 코스와 코스로 연결되는 너와 나의 러닝 경험
5+
![표지](https://user-images.githubusercontent.com/88873302/212262655-0f14bae8-79d9-4aff-b52a-993694727a6a.jpg)
6+
</br>
7+
![A333](https://user-images.githubusercontent.com/88873302/212286726-608ec06a-5631-4aaf-ae7f-bf711a4ef234.jpg)
8+
9+
</aside>
10+
<hr>
11+
</br>
12+
13+
# ☝ 서비스 핵심 기능
14+
### 1. 코스 그리기
15+
> 코스 그리기로 달리기 전 목표를 설정하고 실시간 트래킹으로 코스르 따라 잘 달리고 있는지 확인합니다.
16+
### 2. 코스 발견
17+
> 코스 발견을 통해 나에게 맞는 코스를 추천 받거나 다른 유저가 공유한 코스를 검색하고 스크랩합니다. 코스를 직접 업로드할 수 도 있습니다.
18+
### 3. 코스 보관함
19+
> 코스 보관함에서 내가 그린 코스와 스크랩 코스를 관리합니다.
20+
### 4. 마이페이지
21+
> 마이페이지에서 프로필과 활동 기록, 업로드한 코스를 확인하고 목표 보상으로 동기를 강화합니다.
22+
23+
</aside>
24+
<hr>
25+
</br>
26+
27+
28+
# 🧑‍🔧 Tech Stack
29+
### Backend
30+
<img src="https://img.shields.io/badge/java-007396?style=for-the-badge&logo=java&logoColor=white"> <img src="https://img.shields.io/badge/springboot-6DB33F?style=for-the-badge&logo=springboot&logoColor=white"> ![JWT](https://img.shields.io/badge/JWT-black?style=for-the-badge&logo=JSON%20web%20tokens) <img src="https://img.shields.io/badge/spring data jpa-6DB33F?style=for-the-badge&logoColor=white"> <img src="https://img.shields.io/badge/hibernate-59666C?style=for-the-badge&logo=hibernate&logoColor=white"> <img src="https://img.shields.io/badge/gradle-02303A?style=for-the-badge&logo=gradle&logoColor=white">
31+
32+
### DB
33+
<img src="https://img.shields.io/badge/amazon rds-527FFF?style=for-the-badge&logo=amazonrds&logoColor=white"> <img src="https://img.shields.io/badge/postgresql-4169E1?style=for-the-badge&logo=postgresql&logoColor=white"> <img src="https://img.shields.io/badge/postGIS-4169E1?style=for-the-badge&logoColor=white"> <img src="https://img.shields.io/badge/redis-DC382D?style=for-the-badge&logo=redis&logoColor=white"> <img src="https://img.shields.io/badge/amazon s3-569A31?style=for-the-badge&logo=amazons3&logoColor=white">
34+
35+
### CI/CD
36+
<img src="https://img.shields.io/badge/aws code deploy-FF9900?style=for-the-badge&logoColor=white">
37+
38+
### Deploy
39+
<img src="https://img.shields.io/badge/amazon ec2-FF9900?style=for-the-badge&logo=amazon ec2&logoColor=white"> <img src="https://img.shields.io/badge/nginx-009639?style=for-the-badge&logo=nginx&logoColor=white">
40+
41+
42+
### Develop Tool
43+
<img src="https://img.shields.io/badge/intelliJ-000000?style=for-the-badge&logo=intellij idea&logoColor=white"> <img src="https://img.shields.io/badge/postman-FF6C37?style=for-the-badge&logo=postman&logoColor=white"> <img src="https://img.shields.io/badge/github-181717?style=for-the-badge&logo=github&logoColor=white"> <img src="https://img.shields.io/badge/git-F05032?style=for-the-badge&logo=git&logoColor=white">
44+
45+
### Communicate Tool
46+
<img src="https://img.shields.io/badge/slack-4A154B?style=for-the-badge&logo=slack&logoColor=white"> <img src="https://img.shields.io/badge/notion-000000?style=for-the-badge&logo=notion&logoColor=white">
47+
<br>
48+
<br>
49+
50+
51+
</aside>
52+
<hr>
53+
</br>
54+
55+
56+
57+
# 🏠 server architecture
58+
![image](https://github.com/Runnect/Runnect-Spring-Boot-Server/assets/65851554/4cbb080d-f715-41da-bd2a-10256ecd9023)
59+
60+
61+
</aside>
62+
<hr>
63+
</br>
64+
65+
# 💽 DB ERD
66+
<img width="545" alt="스크린샷 2024-03-26 오후 1 15 33" src="https://github.com/Runnect/Runnect-Spring-Boot-Server/assets/65851554/c48b0966-e73d-4ec0-be08-b097c6890265">
67+
68+
</aside>
69+
<hr>
70+
</br>
71+
72+
# 📄 API(+ Non - API) Docs
73+
74+
75+
<img width="1351" alt="스크린샷 2024-04-05 오후 6 35 31" src="https://github.com/Runnect/Runnect-Spring-Boot-Server/assets/65851554/6cdf531e-4945-4ace-86ad-a3feecd68793">
76+
<img width="1351" alt="스크린샷 2024-04-05 오후 6 36 54" src="https://github.com/Runnect/Runnect-Spring-Boot-Server/assets/65851554/48425786-0d44-4f66-90ab-d40453b32fb8">
77+
<img width="1351" alt="스크린샷 2024-04-05 오후 6 36 14" src="https://github.com/Runnect/Runnect-Spring-Boot-Server/assets/65851554/c3a009d2-6bb5-4af0-885d-7ba5ac0c2e7a">
78+
79+
</aside>
80+
<hr>
81+
</br>
82+
83+
84+
# 🙆‍♀️ 역할분담
85+
86+
|담당자|담당 내용|
87+
|:---|:---|
88+
|유수화|EC2, publicCourse & stamp 관련 api, 인프라 구축|
89+
|전선희|RDS, course & user 관련 api, 인프라 구축|
90+
|박수린|S3, record & scrap 관련 api, 인프라 구축|
91+
92+
93+
</aside>
94+
<hr>
95+
</br>
96+
97+
# 🗣️️ 컨벤션
98+
99+
> 💡 **동료들과 말투를 통일하기 위해 컨벤션을 지정합니다.**
100+
> 오합지졸의 코드가 아닌, **한 사람이 짠 것같은 코드**를 작성하는 것이 추후 유지보수나 협업에서 도움이 됩니다. 내가 코드를 생각하면서 짤 수 있도록 해주는 룰이라고 생각해도 좋습니다!
101+
102+
## 👩‍💻 Coding Conventions
103+
104+
<details>
105+
<summary>명명규칙(Naming Conventions)</summary>
106+
<div markdown="1">
107+
108+
1. 이름으로부터 의도가 읽혀질 수 있게 쓴다.
109+
110+
2. 단수를 기본형으로 한다.
111+
112+
- 기능 자체에서 단수, 복수를 구분하는 경우에만 복수 사용 ex. 다중삭제, 단일삭제
113+
114+
3. DB의 테이블, 클래스에는 `PascalCase`를 사용한다.
115+
116+
4. 변수, 메소드에는 `camelCase`를 사용한다.
117+
118+
5. DB의 테이블의 칼럼에는 `snake_case`를 사용한다.
119+
120+
6. 상수, enum에는 `UPPER_SNAKE_CASE`를 사용한다.
121+
122+
7. 메소드는 `crud + http method`(동사) + 명사 형태로 작성한다.
123+
124+
- c : ex. `createUser`
125+
- r : ex. `getUser`
126+
- u : ex. `updateUser`
127+
- d : ex. `deleteUser`
128+
129+
8. 약어 사용은 최대한 지양한다.
130+
131+
9. 이름에 네 단어 이상이 들어가면 팀원과 상의를 거친 후 사용한다.
132+
</div>
133+
</details>
134+
135+
<details>
136+
<summary>주석(Comment)</summary>
137+
<div markdown="1">
138+
139+
1. 해당 메소드가 어디에 쓰이는지 설명한다.
140+
141+
2. 해당 분기문이 어떤 분기인지 설명한다.
142+
143+
3. 반복문에서 어떤 조건에서 반복되는지 설명한다.
144+
145+
4. 정렬하고 필터링할때 어떤 조건의 정렬과 필터링인지 설명한다.
146+
147+
</div>
148+
</details>
149+
150+
<hr>
151+
</br>
152+
153+
## 🌳 Branch
154+
155+
🌱 git branch 전략
156+
157+
`main branch` : 운영 서버 배포 단위 branch
158+
159+
`dev branch` : 주요 개발 branch, main merge 전 거치는 branch, test 서버로 배포되는 branch
160+
161+
`feat branch`: 각자 개발 branch
162+
163+
- 할 일 issue 등록 후 issue 번호와 isuue 이름으로 branch 생성 후 작업
164+
- ex) feat/#`issue num`-`isuue name(기능요약)`
165+
- 해당 branch 작업 완료 후 PR 보내기
166+
- 항상 local에서 충돌 해결 후 → remote에 올리기
167+
- reviewer에 서로 tag후 code-review
168+
- comment 전 merge 불가!
169+
- review반영 후, 본인이 merge.
170+
171+
### branch 구조
172+
173+
```jsx
174+
- main
175+
- dev
176+
- feat
177+
├── #1-isuue name1
178+
└── #2-isuue name2
179+
```
180+
181+
</aside>
182+
<hr>
183+
</br>
184+
185+
## 🧵 Commit Convention
186+
187+
<aside>
188+
📍 git commit message convention
189+
190+
`ex) feat(변경한 파일) : 변경 내용 (/#issue num)`
191+
192+
```plain
193+
- ✨ feat: 새로운 기능 구현
194+
- 🐛 fix: 버그, 오류 해결
195+
- 🧹 chore: src 또는 test 파일을 수정하지 않는 기타 변경 사항 ( 새로운 파일 생성, 파일 이동, 이름 변경 등 )
196+
- ♻️ refactor: 버그 수정이나 기능 추가가 없는 코드 변경 ( 코드 구조 변경 등의 리팩토링 )
197+
- 💎 style: 코드의 의미에 영향을 미치지 않는 변경 사항 ( 코드 형식, 세미콜론 추가: 비즈니스 로직에 변경 없음 )
198+
- 🏗️ build: 빌드 시스템 또는 외부에 영향을 미치는 변경 사항 종속성 ( 라이브러리 추가 등 )
199+
- 📈 perf: 성능을 향상 시키기 위한 코드 변경
200+
- 🧪 test: 테스트 추가 또는 이전 테스트 수정
201+
- 📝 docs: README나 WIKI 등의 문서 개정
202+
- ⏪️ revert: 이전 커밋을 되돌리는 경우
203+
- 📦 ci: CI 구성 파일 및 스크립트 변경
204+
- Merge: 다른브렌치를 merge하는 경우
205+
- Init : Initial commit을 하는 경우
206+
```
207+

src/main/java/org/runnect/server/common/module/convert/CoordinatePathConverter.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,16 @@ public static List<List<Double>> pathConvertCoor(LineString path) {
4343
}
4444

4545
private static LineString getLineString(List<CoordinateDto> coordinateDtos) {
46+
StringBuilder sb = new StringBuilder();
4647
GeometryFactory geometryFactory = new GeometryFactory(new PrecisionModel(), 4326);
4748
Coordinate[] coordinates = new Coordinate[coordinateDtos.size()];
4849
for (int i = 0; i < coordinateDtos.size(); i++) {
4950
coordinates[i] = new Coordinate(coordinateDtos.get(i).getLatitude(), coordinateDtos.get(i).getLongitude());
51+
sb.append("(" + coordinateDtos.get(i).getLatitude() + ", " + coordinateDtos.get(i).getLongitude() + ")");
5052
}
5153
LineString lineString = geometryFactory.createLineString(coordinates);
54+
log.info("create course!");
55+
log.info(sb.toString());
5256
return lineString;
5357
}
5458
}

src/main/java/org/runnect/server/config/jwt/JwtService.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,13 @@
77
import io.jsonwebtoken.security.Keys;
88
import java.nio.charset.StandardCharsets;
99
import java.security.Key;
10-
import java.time.Duration;
1110
import java.util.Base64;
1211
import java.util.Date;
1312
import javax.annotation.PostConstruct;
1413
import lombok.RequiredArgsConstructor;
1514
import org.runnect.server.common.constant.TokenStatus;
1615
import org.runnect.server.config.redis.RedisService;
1716
import org.springframework.beans.factory.annotation.Value;
18-
import org.springframework.data.redis.core.RedisTemplate;
1917
import org.springframework.stereotype.Service;
2018

2119

@@ -26,7 +24,8 @@ public class JwtService {
2624
@Value("${jwt.secret}")
2725
private String jwtSecret;
2826

29-
private final long accessTokenExpiryTime = 1000L * 60 * 60 * 2; // 2시간
27+
// private final long accessTokenExpiryTime = 1000L * 60 * 60 * 2; // 2시간
28+
private final long accessTokenExpiryTime = 1 * 60 * 1000L; // 안드로이드 테스트용
3029
private final long refreshTokenExpiryTime = 1000L * 60 * 60 * 24 * 14; // 2주
3130
private final String CLAIM_NAME = "userId";
3231

src/main/java/org/runnect/server/course/dto/response/GetCourseDetailResponseDto.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ public static class UserResponseCourseDetail {
3434
private Long userId;
3535

3636
public static UserResponseCourseDetail from(RunnectUser user) {
37-
if (user == null) return null;
38-
return new UserResponseCourseDetail(user.getId());
37+
return new UserResponseCourseDetail(user != null ? user.getId() : -1);
3938
}
4039
}
4140

0 commit comments

Comments
 (0)