-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
386 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,389 @@ | ||
# ICTeam - Shopping Mall | ||
# :pushpin: I.C Shopping Mall | ||
> ์ ์ ์ํ ํ๋งค ์ผํ๋ชฐ | ||
>http://15.164.244.62:8080/icmall/all/vegetable | ||
## ๐ ์ฐธ์ฌ | ||
### ํ์ฅ : ๊น์ข ์ | ||
### ํ์ : ๊ฐ์ง, ์ ์ฌ์ฑ, ๋ฐฐ์ํ | ||
</br> | ||
|
||
### ๊ธฐ๊ฐ: 2021.09.18 ~ 10.14 | ||
### ์ฃผ์ ์ฌ์ฉ ๊ธฐ์ : | ||
Java11, JSON, springboot, MySQL5, Javascript, jsoup, MyBatis, JSTL, KakaoAPI, Security | ||
## 1. ์ ์ ๊ธฐ๊ฐ & ์ฐธ์ฌ ์ธ์ | ||
- 2021๋ 9์ 18์ผ ~ 10์ 14์ผ | ||
- ํ์ฅ: ๊น์ข ์ | ||
- ํ์: ๊ฐ์ง, ์ ์ฌ์ฑ, ๋ฐฐ์ํ | ||
|
||
</br> | ||
|
||
## 2. ์ฌ์ฉ ๊ธฐ์ | ||
#### `Back-end` | ||
- Java 11 | ||
- Spring Boot 4.12.1 | ||
- MyBatipse 1.2.4 | ||
- Jsoup | ||
- MySQL 8.0.26 | ||
- Spring Security | ||
#### `Front-end` | ||
- HTML, CSS, Jquery | ||
- Javascript | ||
|
||
</br> | ||
|
||
## 3. ERD ์ค๊ณ | ||
![ERD](https://user-images.githubusercontent.com/65885458/144964958-a7af2267-ffef-4019-b87b-af70776ca96d.png) | ||
|
||
|
||
## 4. ํต์ฌ ๊ธฐ๋ฅ | ||
์ด ์๋น์ค์ ํต์ฌ ๊ธฐ๋ฅ ์ ๊ธฐ๋ฅ์ ๋๋ค. | ||
์ฌ์ฉ์๋ ๋จ์ง ์ปจํ ์ธ ์ ์นดํ ๊ณ ๋ฆฌ๋ฅผ ์ ํํ๊ณ , URL๋ง ์ ๋ ฅํ๋ฉด ๋์ ๋๋ค. | ||
์ด ๋จ์ํ ๊ธฐ๋ฅ์ ํ๋ฆ์ ๋ณด๋ฉด, ์๋น์ค๊ฐ ์ด๋ป๊ฒ ๋์ํ๋์ง ์ ์ ์์ต๋๋ค. | ||
|
||
<details> | ||
<summary><b>ํต์ฌ ๊ธฐ๋ฅ ์ค๋ช ํผ์น๊ธฐ</b></summary> | ||
<div markdown="1"> | ||
|
||
### 4.1. ์ ์ฒด ํ๋ฆ | ||
![](https://zuminternet.github.io/images/portal/post/2019-04-22-ZUM-Pilot-integer/flow1.png) | ||
|
||
### 4.2. ์ฌ์ฉ์ ์์ฒญ | ||
![](https://zuminternet.github.io/images/portal/post/2019-04-22-ZUM-Pilot-integer/flow_vue.png) | ||
|
||
- **URL ์ ๊ท์ ์ฒดํฌ** :pushpin: [์ฝ๋ ํ์ธ](https://github.com/Integerous/goQuality/blob/b587bbff4dce02e3bec4f4787151a9b6fa326319/frontend/src/components/PostInput.vue#L67) | ||
- Vue.js๋ก ๋ ๋๋ง๋ ํ๋ฉด๋จ์์, ์ฌ์ฉ์๊ฐ ๋ฑ๋ก์ ์๋ํ URL์ ๋ชจ์์๋ฅผ ์ ๊ท์์ผ๋ก ํ์ธํฉ๋๋ค. | ||
- URL์ ๋ชจ์์๊ฐ ์๋ ๊ฒฝ์ฐ, ์๋ฌ ๋ฉ์ธ์ง๋ฅผ ๋์๋๋ค. | ||
|
||
- **Axios ๋น๋๊ธฐ ์์ฒญ** :pushpin: [์ฝ๋ ํ์ธ]() | ||
- URL์ ๋ชจ์์์ธ ๊ฒฝ์ฐ, ์ปจํ ์ธ ๋ฅผ ๋ฑ๋กํ๋ POST ์์ฒญ์ ๋น๋๊ธฐ๋ก ๋ ๋ฆฝ๋๋ค. | ||
|
||
### 4.3. Controller | ||
|
||
![](https://zuminternet.github.io/images/portal/post/2019-04-22-ZUM-Pilot-integer/flow_controller.png) | ||
|
||
- **์์ฒญ ์ฒ๋ฆฌ** :pushpin: [์ฝ๋ ํ์ธ](https://github.com/Integerous/goQuality/blob/b2c5e60761b6308f14eebe98ccdb1949de6c4b99/src/main/java/goQuality/integerous/controller/PostRestController.java#L55) | ||
- Controller์์๋ ์์ฒญ์ ํ๋ฉด๋จ์์ ๋์ด์จ ์์ฒญ์ ๋ฐ๊ณ , Service ๊ณ์ธต์ ๋ก์ง ์ฒ๋ฆฌ๋ฅผ ์์ํฉ๋๋ค. | ||
|
||
- **๊ฒฐ๊ณผ ์๋ต** :pushpin: [์ฝ๋ ํ์ธ]() | ||
- Service ๊ณ์ธต์์ ๋์ด์จ ๋ก์ง ์ฒ๋ฆฌ ๊ฒฐ๊ณผ(๋ฉ์ธ์ง)๋ฅผ ํ๋ฉด๋จ์ ์๋ตํด์ค๋๋ค. | ||
|
||
### 4.4. Service | ||
|
||
![](https://zuminternet.github.io/images/portal/post/2019-04-22-ZUM-Pilot-integer/flow_service1.png) | ||
|
||
- **Http ํ๋กํ ์ฝ ์ถ๊ฐ ๋ฐ trim()** :pushpin: [์ฝ๋ ํ์ธ]() | ||
- ์ฌ์ฉ์๊ฐ URL ์ ๋ ฅ ์ Http ํ๋กํ ์ฝ์ ์๋ตํ๊ฑฐ๋ ๊ณต๋ฐฑ์ ๋ฃ์ ๊ฒฝ์ฐ, | ||
์ฌ๋ฐ๋ฅธ URL์ด ๋ ์ ์๋๋ก Http ํ๋กํ ์ฝ์ ์ถ๊ฐํด์ฃผ๊ณ , ๊ณต๋ฐฑ์ ์ ๊ฑฐํด์ค๋๋ค. | ||
|
||
- **URL ์ ์ ํ์ธ** :pushpin: [์ฝ๋ ํ์ธ]() | ||
- ํ๋ฉด๋จ์์ ๋ชจ์์๋ง ํ์ธํ URL์ด ์ค์ ๋ฆฌ์์ค๋ก ์ฐ๊ฒฐ๋๋์ง HttpUrlConnection์ผ๋ก ํ ์คํธํฉ๋๋ค. | ||
- ์ด ๋, ๋น ๋ฅธ ์๋ต์ ์ํด Request Method๋ฅผ GET์ด ์๋ HEAD๋ฅผ ์ฌ์ฉํ์ต๋๋ค. | ||
- (HEAD ๋ฉ์๋๋ GET ๋ฉ์๋์ ์๋ต ๊ฒฐ๊ณผ์ Body๋ ๊ฐ์ ธ์ค์ง ์๊ณ , Header๋ง ํ์ธํ๊ธฐ ๋๋ฌธ์ GET ๋ฉ์๋์ ๋นํด ์๋ต์๋๊ฐ ๋น ๋ฆ ๋๋ค.) | ||
|
||
![](https://zuminternet.github.io/images/portal/post/2019-04-22-ZUM-Pilot-integer/flow_service2.png) | ||
|
||
- **Jsoup ์ด๋ฏธ์ง, ์ ๋ชฉ ํ์ฑ** :pushpin: [์ฝ๋ ํ์ธ]() | ||
- URL ์ ์ ํ์ธ๊ฒฐ๊ณผ ์ ํจํ๋ฉด Jsoup์ ์ฌ์ฉํด์ ์ ๋ ฅ๋ URL์ ์ด๋ฏธ์ง์ ์ ๋ชฉ์ ํ์ฑํฉ๋๋ค. | ||
- ์ด๋ฏธ์ง๋ Open Graphic Tag๋ฅผ ์ฐ์ ์ ์ผ๋ก ํ์ฑํ๊ณ , ์์ ๊ฒฝ์ฐ ์ฒซ ๋ฒ์งธ ์ด๋ฏธ์ง์ ์ ๋ชฉ์ ํ์ฑํฉ๋๋ค. | ||
- ์ปจํ ์ธ ์ ์ด๋ฏธ์ง๊ฐ ์์ ๊ฒฝ์ฐ, ๋ฏธ๋ฆฌ ์ค์ ํด๋ ๊ธฐ๋ณธ ์ด๋ฏธ์ง๋ฅผ ์ฌ์ฉํ๊ณ , ์ ๋ชฉ์ด ์์ ๊ฒฝ์ฐ ์๋ตํฉ๋๋ค. | ||
|
||
|
||
### 4.5. Repository | ||
|
||
![](https://zuminternet.github.io/images/portal/post/2019-04-22-ZUM-Pilot-integer/flow_repo.png) | ||
|
||
- **์ปจํ ์ธ ์ ์ฅ** :pushpin: [์ฝ๋ ํ์ธ]() | ||
- URL ์ ํจ์ฑ ์ฒดํฌ์ ์ด๋ฏธ์ง, ์ ๋ชฉ ํ์ฑ์ด ๋๋ ์ปจํ ์ธ ๋ DB์ ์ ์ฅํฉ๋๋ค. | ||
- ์ ์ฅ๋ ์ปจํ ์ธ ๋ ๋ค์ Repository - Service - Controller๋ฅผ ๊ฑฐ์ณ ํ๋ฉด๋จ์ ์ก์ถ๋ฉ๋๋ค. | ||
|
||
</div> | ||
</details> | ||
|
||
</br> | ||
|
||
## 5. ํต์ฌ ํธ๋ฌ๋ธ ์ํ | ||
### 5.1. ์ปจํ ์ธ ํํฐ์ ํ์ด์ง ์ฒ๋ฆฌ ๋ฌธ์ | ||
- ์ ๋ ์ด ์๋น์ค๊ฐ ํ์ด์ค๋ถ์ด๋ ์ธ์คํ๊ทธ๋จ ์ฒ๋ผ ๊ฐ๋ณ๊ฒ, ์์ฃผ ์ฌ์ฉ๋๊ธธ ๋ฐ๋ผ๋ ๋ง์์ผ๋ก ๊ฐ๋ฐํ์ต๋๋ค. | ||
๋๋ฌธ์ ํ์ด์ง ์ฒ๋ฆฌ๋ ๋ฌดํ ์คํฌ๋กค์ ์ ์ฉํ์ต๋๋ค. | ||
|
||
- ํ์ง๋ง [๋ฌดํ์คํฌ๋กค, ํ์ด์ง ํน์ โ๋๋ณด๊ธฐโ ๋ฒํผ? ์ด๋ค ๊ฑธ ์จ์ผํ ๊น](https://cyberx.tistory.com/82) ๋ผ๋ ๊ธ์ ์ฝ๊ณ ๋ฌดํ ์คํฌ๋กค์ ๋จ์ ๋ค์ ์๊ฒ ๋์๊ณ , | ||
๋ค์ํ ๊ธฐ์ค(์นดํ ๊ณ ๋ฆฌ, ์ฌ์ฉ์, ๋ฑ๋ก์ผ, ์ธ๊ธฐ๋)์ ๊ฒ์๋ฌผ ํํฐ ๊ธฐ๋ฅ์ ๋ฃ์ด์ ์ด๋ฅผ ๋ณด์ํ๊ณ ์ ํ์ต๋๋ค. | ||
|
||
- ๊ทธ๋ฐ๋ฐ ๊ฒ์๋ฌผ์ด ํํฐ๋ง ๋ ์ํ์์ ๋ฌดํ ์คํฌ๋กค์ด ๋์ํ๋ฉด, | ||
ํํฐ๋ง ๋ ๊ฒ์๋ฌผ๋ค๋ง DB์ ์์ฒญํด์ผ ํ๊ธฐ ๋๋ฌธ์ ์๋์ **๊ธฐ์กด ์ฝ๋** ์ฒ๋ผ ๊ฐ ํํฐ๋ณ๋ก ๋ค๋ฅธ Query๋ฅผ ๋ ๋ ค์ผ ํ์ต๋๋ค. | ||
|
||
<details> | ||
<summary><b>๊ธฐ์กด ์ฝ๋</b></summary> | ||
<div markdown="1"> | ||
|
||
~~~java | ||
/** | ||
* ๊ฒ์๋ฌผ Top10 (๊ธฐ์ค: ๋๊ธ ์ + ์ข์์ ์) | ||
* @return ์ธ๊ธฐ์ ์์ 10๊ฐ ๊ฒ์๋ฌผ | ||
*/ | ||
public Page<PostResponseDto> listTopTen() { | ||
|
||
PageRequest pageRequest = PageRequest.of(0, 10, Sort.Direction.DESC, "rankPoint", "likeCnt"); | ||
return postRepository.findAll(pageRequest).map(PostResponseDto::new); | ||
} | ||
|
||
/** | ||
* ๊ฒ์๋ฌผ ํํฐ (Tag Name) | ||
* @param tagName ๊ฒ์๋ฌผ ๋ฐ์ค์์ ํด๋ฆญํ ํ๊ทธ ์ด๋ฆ | ||
* @param pageable ํ์ด์ง ์ฒ๋ฆฌ๋ฅผ ์ํ ๊ฐ์ฒด | ||
* @return ํด๋น ํ๊ทธ๊ฐ ํฌํจ๋ ๊ฒ์๋ฌผ ๋ชฉ๋ก | ||
*/ | ||
public Page<PostResponseDto> listFilteredByTagName(String tagName, Pageable pageable) { | ||
|
||
return postRepository.findAllByTagName(tagName, pageable).map(PostResponseDto::new); | ||
} | ||
|
||
// ... ๊ฒ์๋ฌผ ํํฐ (Member) ์๋ต | ||
|
||
/** | ||
* ๊ฒ์๋ฌผ ํํฐ (Date) | ||
* @param createdDate ๊ฒ์๋ฌผ ๋ฐ์ค์์ ํด๋ฆญํ ๋ ์ง | ||
* @return ํด๋น ๋ ์ง์ ๋ฑ๋ก๋ ๊ฒ์๋ฌผ ๋ชฉ๋ก | ||
*/ | ||
public List<PostResponseDto> listFilteredByDate(String createdDate) { | ||
|
||
// ๋ฑ๋ก์ผ 00์๋ถํฐ 24์๊น์ง | ||
LocalDateTime start = LocalDateTime.of(LocalDate.parse(createdDate), LocalTime.MIN); | ||
LocalDateTime end = LocalDateTime.of(LocalDate.parse(createdDate), LocalTime.MAX); | ||
|
||
return postRepository | ||
.findAllByCreatedAtBetween(start, end) | ||
.stream() | ||
.map(PostResponseDto::new) | ||
.collect(Collectors.toList()); | ||
} | ||
~~~ | ||
|
||
</div> | ||
</details> | ||
|
||
- ์ด ๋ ์นดํ ๊ณ ๋ฆฌ(tag)๋ก ๊ฒ์๋ฌผ์ ํํฐ๋ง ํ๋ ๊ฒฝ์ฐ, | ||
๊ฐ ๊ฒ์๋ฌผ์ ์ต๋ 3๊ฐ๊น์ง์ ์นดํ ๊ณ ๋ฆฌ(tag)๋ฅผ ๊ฐ์ง ์ ์์ด ํด๋น ์นดํ ๊ณ ๋ฆฌ๋ฅผ ํฌํจํ๋ ๋ชจ๋ ๊ฒ์๋ฌผ์ ์ง์ํด์ผ ํ๊ธฐ ๋๋ฌธ์ | ||
- ์๋ **๊ฐ์ ๋ ์ฝ๋**์ ๊ฐ์ด QueryDSL์ ์ฌ์ฉํ์ฌ ๋ค์ ๋ณต์กํ Query๋ฅผ ์์ฑํ๋ฉด์๋ ํ์ด์ง ์ฒ๋ฆฌ๋ฅผ ํ ์ ์์์ต๋๋ค. | ||
|
||
<details> | ||
<summary><b>๊ฐ์ ๋ ์ฝ๋</b></summary> | ||
<div markdown="1"> | ||
|
||
~~~java | ||
/** | ||
* ๊ฒ์๋ฌผ ํํฐ (Tag Name) | ||
*/ | ||
@Override | ||
public Page<Post> findAllByTagName(String tagName, Pageable pageable) { | ||
|
||
QueryResults<Post> results = queryFactory | ||
.selectFrom(post) | ||
.innerJoin(postTag) | ||
.on(post.idx.eq(postTag.post.idx)) | ||
.innerJoin(tag) | ||
.on(tag.idx.eq(postTag.tag.idx)) | ||
.where(tag.name.eq(tagName)) | ||
.orderBy(post.idx.desc()) | ||
.limit(pageable.getPageSize()) | ||
.offset(pageable.getOffset()) | ||
.fetchResults(); | ||
|
||
return new PageImpl<>(results.getResults(), pageable, results.getTotal()); | ||
} | ||
~~~ | ||
|
||
</div> | ||
</details> | ||
|
||
</br> | ||
|
||
## 6. ๊ทธ ์ธ ํธ๋ฌ๋ธ ์ํ | ||
<details> | ||
<summary>npm run dev ์คํ ์ค๋ฅ</summary> | ||
<div markdown="1"> | ||
|
||
- Webpack-dev-server ๋ฒ์ ์ 3.0.0์ผ๋ก ๋ค์ด๊ทธ๋ ์ด๋๋ก ํด๊ฒฐ | ||
- `$ npm install โsave-dev webpack-dev-server@3.0.0` | ||
|
||
</div> | ||
</details> | ||
|
||
<details> | ||
<summary>vue-devtools ํฌ๋กฌ์ต์คํ ์ ์ธ์ ์ค๋ฅ ๋ฌธ์ </summary> | ||
<div markdown="1"> | ||
|
||
- main.js ํ์ผ์ `Vue.config.devtools = true` ์ถ๊ฐ๋ก ํด๊ฒฐ | ||
- [https://github.com/vuejs/vue-devtools/issues/190](https://github.com/vuejs/vue-devtools/issues/190) | ||
|
||
</div> | ||
</details> | ||
|
||
<details> | ||
<summary>ElementUI input ๋ฐ์ค์์ `v-on:keyup.enter="๋ฉ์๋๋ช "`์ด ์ ์ ์๋ ์ํ๋ ๋ฌธ์ </summary> | ||
<div markdown="1"> | ||
|
||
- `v-on:keyup.enter.native=""` ์ ๊ฐ์ด .native ์ถ๊ฐ๋ก ํด๊ฒฐ | ||
|
||
</div> | ||
</details> | ||
|
||
<details> | ||
<summary> Post ๋ชฉ๋ก ์ถ๋ ฅ์์ Member ๊ฐ์ฒด ์ถ๋ ฅ ์๋ฌ </summary> | ||
<div markdown="1"> | ||
|
||
- ์๋ฌ ๋ฉ์ธ์ง(500์๋ฌ) | ||
- No serializer found for class org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationConfig.SerializationFeature.FAIL_ON_EMPTY_BEANS) | ||
- ํด๊ฒฐ | ||
- Post ์ํฐํฐ์ @ManyToOne ์ฐ๊ด๊ด๊ณ ๋งคํ์ LAZY ์ต์ ์์ ๊ธฐ๋ณธ(EAGER)์ต์ ์ผ๋ก ์์ | ||
|
||
</div> | ||
</details> | ||
|
||
<details> | ||
<summary> ํ๋ก์ ํธ๋ฅผ git init์ผ๋ก ์์ฑ ํ ๋ฐ์ํ๋ npm run dev/build ์ค๋ฅ ๋ฌธ์ </summary> | ||
<div markdown="1"> | ||
|
||
```jsx | ||
$ npm run dev | ||
npm ERR! path C:\Users\integer\IdeaProjects\pilot\package.json | ||
npm ERR! code ENOENT | ||
npm ERR! errno -4058 | ||
npm ERR! syscall open | ||
npm ERR! enoent ENOENT: no such file or directory, open 'C:\Users\integer\IdeaProjects\pilot\package.json' | ||
npm ERR! enoent This is related to npm not being able to find a file. | ||
npm ERR! enoent | ||
|
||
npm ERR! A complete log of this run can be found in: | ||
npm ERR! C:\Users\integer\AppData\Roaming\npm-cache\_logs\2019-02-25T01_23_19_131Z-debug.log | ||
``` | ||
|
||
- ๋จ์ํ npm run dev/build ๋ช ๋ น์ ์ ๋ ฅํ ๊ฒฝ๋ก๊ฐ ๋ฌธ์ ์๋ค. | ||
|
||
</div> | ||
</details> | ||
|
||
<details> | ||
<summary> ํ๊ทธ ์ ํํ ๋ฑ๋กํ๊ธฐ ๋๋ฅผ ๋ `object references an unsaved transient instance - save the transient instance before flushing` ์ค๋ฅ</summary> | ||
<div markdown="1"> | ||
|
||
- Post ์ํฐํฐ์ @ManyToMany์ ์์์ฑ ์ ์ด(cascade=CascadeType.ALL) ์ถ๊ฐ | ||
- JPA์์ Entity๋ฅผ ์ ์ฅํ ๋ ์ฐ๊ด๋ ๋ชจ๋ Entity๋ ์์์ํ์ฌ์ผ ํ๋ค. | ||
- CascadeType.PERSIST ์ต์ ์ผ๋ก ๋ถ๋ชจ์ ์์ Enitity๋ฅผ ํ ๋ฒ์ ์์ํํ ์ ์๋ค. | ||
- ์ฐธ๊ณ | ||
- [https://stackoverflow.com/questions/2302802/object-references-an-unsaved-transient-instance-save-the-transient-instance-be/10680218](https://stackoverflow.com/questions/2302802/object-references-an-unsaved-transient-instance-save-the-transient-instance-be/10680218) | ||
|
||
</div> | ||
</details> | ||
|
||
<details> | ||
<summary> JSON: Infinite recursion (StackOverflowError)</summary> | ||
<div markdown="1"> | ||
|
||
- @JsonIgnoreProperties ์ฌ์ฉ์ผ๋ก ํด๊ฒฐ | ||
- ์ฐธ๊ณ | ||
- [http://springquay.blogspot.com/2016/01/new-approach-to-solve-json-recursive.html](http://springquay.blogspot.com/2016/01/new-approach-to-solve-json-recursive.html) | ||
- [https://stackoverflow.com/questions/3325387/infinite-recursion-with-jackson-json-and-hibernate-jpa-issue](https://stackoverflow.com/questions/3325387/infinite-recursion-with-jackson-json-and-hibernate-jpa-issue) | ||
|
||
</div> | ||
</details> | ||
|
||
<details> | ||
<summary> H2 ์ ์๋ฌธ์ </summary> | ||
<div markdown="1"> | ||
|
||
- H2์ JDBC URL์ด jdbc:h2:~/test ์ผ๋ก ๋์ด์์ผ๋ฉด jdbc:h2:mem:testdb ์ผ๋ก ๋ณ๊ฒฝํด์ ์ ์ํด์ผ ํ๋ค. | ||
|
||
</div> | ||
</details> | ||
|
||
<details> | ||
<summary> ์ปจํ ์ธ ์์ ๋ชจ๋ฌ์ฐฝ์์ ํ๊ทธ ์ ๋ ํธ๋ฐ์ค ๋๋๋ค์ด์ด ๋ค์ชฝ์ ๋ณด์ด๋ ๋ฌธ์ </summary> | ||
<div markdown="1"> | ||
|
||
- ElementUI์ Global Config์ ์ต์ ์ถ๊ฐํ๋ฉด ํด๊ฒฐ | ||
- main.js ํ์ผ์ `Vue.us(ElementUI, { zIndex: 9999 });` ์ต์ ์ถ๊ฐ(9999 ์ดํ๋ฉด ์๋) | ||
- ์ฐธ๊ณ | ||
- [https://element.eleme.io/#/en-US/component/quickstart#global-config](https://element.eleme.io/#/en-US/component/quickstart#global-config) | ||
|
||
</div> | ||
</details> | ||
|
||
<details> | ||
<summary> HTTP delete Request์ ๊ฐ๋ฐ์๋๊ตฌ์ XHR(XMLHttpRequest )์์ delete์์ฒญ์ด 2๋ฒ์ฉ ์ฐํ๋ ์ด์ </summary> | ||
<div markdown="1"> | ||
|
||
- When you try to send a XMLHttpRequest to a different domain than the page is hosted, you are violating the same-origin policy. However, this situation became somewhat common, many technics are introduced. CORS is one of them. | ||
|
||
In short, server that you are sending the DELETE request allows cross domain requests. In the process, there should be a **preflight** call and that is the **HTTP OPTION** call. | ||
|
||
So, you are having two responses for the **OPTION** and **DELETE** call. | ||
|
||
see [MDN page for CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS). | ||
|
||
- ์ถ์ฒ : [https://stackoverflow.com/questions/35808655/why-do-i-get-back-2-responses-of-200-and-204-when-using-an-ajax-call-to-delete-o](https://stackoverflow.com/questions/35808655/why-do-i-get-back-2-responses-of-200-and-204-when-using-an-ajax-call-to-delete-o) | ||
|
||
</div> | ||
</details> | ||
|
||
<details> | ||
<summary> ์ด๋ฏธ์ง ํ์ฑ ์ og:image ๊ฒฝ๋ก๊ฐ ๋ฌ๋ผ์ ์ ๋๋ก ํ์ฑ์ด ์๋๋ ๊ฒฝ์ฐ</summary> | ||
<div markdown="1"> | ||
|
||
- UserAgent ์ค์ ์ผ๋ก ํด๊ฒฐ | ||
- [https://www.javacodeexamples.com/jsoup-set-user-agent-example/760](https://www.javacodeexamples.com/jsoup-set-user-agent-example/760) | ||
- [http://www.useragentstring.com/](http://www.useragentstring.com/) | ||
|
||
</div> | ||
</details> | ||
|
||
<details> | ||
<summary> ๊ตฌ๊ธ ๋ก๊ทธ์ธ์ผ๋ก ๋ก๊ทธ์ธํ ์ฌ์ฉ์์ ์ ๋ณด๋ฅผ ๊ฐ์ ธ์ค๋ ๋ฐฉ๋ฒ์ด ์คํ๋ง 2.0๋ ๋ฒ์ ์์ ๋ฌ๋ผ์ง ๊ฒ</summary> | ||
<div markdown="1"> | ||
|
||
- 1.5๋ ๋ฒ์ ์์๋ Controller์ ์ธ์๋ก Principal์ ๋๊ธฐ๋ฉด principal.getName(0์์ ๋ฐ๋ก ๊บผ๋ด์ ์ธ ์ ์์๋๋ฐ, 2.0๋ ๋ฒ์ ์์๋ principal.getName()์ ๊ฒฝ์ฐ principal ๊ฐ์ฒด.toString()์ ๋ฐํํ๋ค. | ||
- 1.5๋ ๋ฒ์ ์์ principal์ ์ฌ์ฉํ๋ ๊ฒฝ์ฐ | ||
- ์๋์ ๊ฐ์ด ์ฌ์ฉํ๋ค๋ฉด, | ||
|
||
```jsx | ||
@RequestMapping("/sso/user") | ||
@SuppressWarnings("unchecked") | ||
public Map<String, String> user(Principal principal) { | ||
if (principal != null) { | ||
OAuth2Authentication oAuth2Authentication = (OAuth2Authentication) principal; | ||
Authentication authentication = oAuth2Authentication.getUserAuthentication(); | ||
Map<String, String> details = new LinkedHashMap<>(); | ||
details = (Map<String, String>) authentication.getDetails(); | ||
logger.info("details = " + details); // id, email, name, link etc. | ||
Map<String, String> map = new LinkedHashMap<>(); | ||
map.put("email", details.get("email")); | ||
return map; | ||
} | ||
return null; | ||
} | ||
``` | ||
|
||
- 2.0๋ ๋ฒ์ ์์๋ | ||
- ์๋์ ๊ฐ์ด principal ๊ฐ์ฒด์ ๋ด์ฉ์ ๊บผ๋ด ์ธ ์ ์๋ค. | ||
|
||
```jsx | ||
UsernamePasswordAuthenticationToken token = | ||
(UsernamePasswordAuthenticationToken) SecurityContextHolder | ||
.getContext().getAuthentication(); | ||
Map<String, Object> map = (Map<String, Object>) token.getPrincipal(); | ||
|
||
String email = String.valueOf(map.get("email")); | ||
post.setMember(memberRepository.findByEmail(email)); | ||
``` | ||
|
||
</div> | ||
</details> | ||
|
||
<details> | ||
<summary> ๋ญํน ๋์ ์ ์ฒ๋ฆฌ ๋ฌธ์ </summary> | ||
<div markdown="1"> | ||
|
||
- PageRequest์ Sort๋ถ๋ถ์์ properties๋ฅผ "rankPoint"๋ฅผ ์ฃผ๊ณ "likeCnt"๋ฅผ ์ค์ ๋๊ธ์๋ณด๋ค ์ข์์์๊ฐ ์ฐ์ ์์ ๊ฐ๋๋ก ์ค์ . | ||
- ์ข์์ ์๋ ๋๊ฐ๋ค๋ฉด.......... | ||
|
||
</div> | ||
</details> | ||
|
||
</br> | ||
|
||
## 6. ํ๊ณ / ๋๋์ | ||
>ํ๋ก์ ํธ ๊ฐ๋ฐ ํ๊ณ ๊ธ: https://zuminternet.github.io/ZUM-Pilot-integer/ |