Skip to content

Commit f62df03

Browse files
committed
fix merge conflict
2 parents 549d0e5 + dee2129 commit f62df03

File tree

5 files changed

+92
-49
lines changed

5 files changed

+92
-49
lines changed

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 GiJung Park, JongWon Lee
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 32 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,32 @@
1-
# DMU-BackEnd2
2-
3-
## DB 설계
4-
5-
## Rest API 설계
6-
7-
## 구현 중 어려웠던 상황 및 극복
8-
### 크롤링 라이브러리의 문제
9-
자바의 크롤링 방법은 크게 두 가지의 라이브러리를 사용할 수 있다는 것을 확인할 수 있었다.
10-
- Jsoup
11-
- Selenium
12-
13-
크롤링을 하는데에 이 두 라이브러리의 큰 차이는 다음과 같다.
14-
- Jsoup은 정적인 HTML을 수집하는데, Selenium은 동적인 데이터도 수집 가능하다.
15-
- Jsoup은 라이브러리를 추가하고 바로 사용할 수 있지만, Selenium은 크롬 드라이버가 별도로 필요하다.
16-
17-
사실 처음에는 Selenium을 사용하여 개발을 시작했다. <br/>
18-
이유는 학교 공지사항 페이지를 자동으로 넘겨가면서 크롤링을 할 수 있을 것 같았기 때문이다. <br/>
19-
20-
하지만 아래와 같은 이유들 때문에 오류들을 해결하다가 크롤링 라이브러리를 바꾸게 되었다. <br/>
21-
- Jsoup을 사용하더라도 충분히 원하는 결과를 얻을 수 있고, 속도도 Selenium보다 빠르다.
22-
- Selenium 설정의 오류
23-
- 크롬 드라이버의 버전이 현재 가장 최신 버전의 크롬을 지원하지 않는다.
24-
- 크롬의 버전을 다운그레이드 하려고 했으나 자동 업데이트를 막지 못했다.
25-
26-
이러한 문제를 겪으며 개발에 들어가기 앞서 만들려는 기능이 무엇이고, 어떻게 구현해야 하는지를 신중하게 생각해야겠다고 느꼈다.
27-
28-
---
29-
30-
### 성능과 가독성의 Trade In
31-
주어진 정보를 가지고 url을 만드는 urlBuilder라는 메서드가 Parser클래스에서 사용되는 것을 볼 수 있다. <br/>
32-
여러 String 값을 통해 하나의 url을 만드는 과정이다 보니 String.format() or StringBuilder 등 여러 방법이 존재했다. <br/>
33-
만약 성능을 중요시 한다면 StringBuilder를 사용할 수 있었고, 가독성을 원한다면 String.format()을 사용할 수 있었다. <br/>
34-
35-
성능과 가독성의 Trade In을 위해서 아래와 같은 두가지 테스트를 진행해보았다.
36-
- 첫 번째는 전체 데이터를 가져오는 작업
37-
- 두 번째는 최근 정보들을 가져오는 작업
38-
39-
첫 번째 테스트 결과
40-
- String.format() -> 약 5분 소요
41-
- StringBuilder() -> 약 4분 20초 소요
42-
- 40초 가량 13%의 성능 향상
43-
44-
두 번째 테스트 결과
45-
- String.format(), StringBuilder() 둘 다 약 10초 소요
46-
- 작업의 양이 적다면 성능의 이점이 없음
47-
48-
이를 통해 초기 데이터베이스를 구성하는데에 성능을 향상 시킬수 있지만, 운영중에는 성능의 이점을 누릴수 없다는 것을 확인할 수 있었다. <br/>
49-
따라서 서비스 운영과 유지 보수적인 측면에서 가독성이 더 우위를 점한다고 판단하였고, 가독성을 가져오는 것으로 결정하였다.
1+
# DMU-BackEnd
2+
동양미래대학교 홈페이지의 정보들을 활용하여 더 나은 편리성을 제공하기 위해 만들어진 API 서버입니다.
3+
4+
## Team Members
5+
| 박기중 | 이종원 |
6+
|:-------------------------------------------:|:----------------------------------------:|
7+
| [GiJungPark](https://github.com/GiJungPark) |[LeeJongWon](https://github.com/LJW22222) |
8+
| 식단, 일정, 공지사항 크롤링 서비스 제작<br/>AWS 서버 구축 | FCM을 활용한 알림 전송<br/>Redis를 활용한 구독 시스템 제작 |
9+
10+
<br><br>
11+
12+
## Tech Stack
13+
### Develop Environment
14+
<img src="https://img.shields.io/badge/IntellJ-000000?style=for-the-badge&logo=intellijidea&logoColor=white">
15+
<img src="https://img.shields.io/badge/Spring Boot 3.0.2-6DB33F?style=for-the-badge&logo=SpringBoot&logoColor=white">
16+
<img src="https://img.shields.io/badge/java 17-007396?style=for-the-badge&logo=java&logoColor=white">
17+
<img src="https://img.shields.io/badge/MySQL 8.0.35-4479A1?style=for-the-badge&logo=MySQL&logoColor=white">
18+
<img src="https://img.shields.io/badge/Redis 6.0.16-DC382D?style=for-the-badge&logo=Redis&logoColor=white">
19+
20+
### Library
21+
<img src="https://img.shields.io/badge/Spring Data JPA-6DB33F?style=for-the-badge&logo=Spring&logoColor=white">
22+
<img src="https://img.shields.io/badge/Jsoup 1.17.2-007396?style=for-the-badge&logo=java&logoColor=white">
23+
<img src="https://img.shields.io/badge/firebase 9.2.0-FFCA28?style=for-the-badge&logo=firebase&logoColor=white">
24+
25+
<br><br>
26+
27+
## Architecture
28+
### AWS
29+
<img src="asset/AWS-Architecture.png"/>
30+
31+
### Server
32+
<img src="asset/Server-Architecture.png"/>

asset/AWS-Architecture.png

145 KB
Loading

asset/Server-Architecture.png

417 KB
Loading

src/main/java/me/gijung/DMforU/utils/NoticeMapper.java

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
package me.gijung.DMforU.utils;
22

3+
<<<<<<< HEAD
34
import me.gijung.DMforU.model.dto.TypeNoticeDto;
45
import me.gijung.DMforU.model.dto.NoticeDto;
6+
=======
7+
import me.gijung.DMforU.model.dto.*;
8+
>>>>>>> origin/release_1.0.1
59
import me.gijung.DMforU.model.entity.Notice;
610

711
public class NoticeMapper {
@@ -20,6 +24,10 @@ public static NoticeDto mapToDto(Notice notice) {
2024
.url(notice.getUrl())
2125
.build();
2226
}
27+
<<<<<<< HEAD
28+
=======
29+
30+
>>>>>>> origin/release_1.0.1
2331
public static TypeNoticeDto maoToDepartmentNotice(Notice notice) {
2432
return TypeNoticeDto.builder()
2533
.type(notice.getType())
@@ -29,4 +37,35 @@ public static TypeNoticeDto maoToDepartmentNotice(Notice notice) {
2937
.url(notice.getUrl())
3038
.build();
3139
}
40+
<<<<<<< HEAD
41+
=======
42+
43+
//RequestTokenDto -> ServiceTokensDto
44+
// Token Update, Delete, Refresh 사용
45+
public static TokensDto RequestTokenDtoToServiceTokensDto(RequestTokenDto requestTokenDto) {
46+
return TokensDto.builder()
47+
.token(requestTokenDto.getToken())
48+
.topic(requestTokenDto.getTopic())
49+
.build();
50+
}
51+
52+
//RequestInitDto -> ServiceTokensDto
53+
//초기 앱 진입시 Token 및 Topic 생성에 사용
54+
public static TokensDto RequestTokenDtoToServiceTokensDto(InitRequestDto requestInitDto) {
55+
return TokensDto.builder()
56+
.token(requestInitDto.getToken())
57+
.topic(requestInitDto.getTopic())
58+
.build();
59+
}
60+
61+
//RequestInitDto -> ServiceDepartmentDto
62+
//초기 앱 진입시 학과 생성에 사용
63+
public static DepartmentDto RequestInitDtoToServiceDepartmentDto(InitRequestDto requestInitDto) {
64+
return DepartmentDto.builder()
65+
.token(requestInitDto.getToken())
66+
.department(requestInitDto.getDepartment())
67+
.build();
68+
}
69+
70+
>>>>>>> origin/release_1.0.1
3271
}

0 commit comments

Comments
 (0)