Skip to content

Commit

Permalink
add : Papago 사용 문서 업로드
Browse files Browse the repository at this point in the history
  • Loading branch information
bongsh0112 committed Nov 4, 2023
1 parent 55e816b commit cc5fe1c
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 0 deletions.
61 changes: 61 additions & 0 deletions Papago/Papago Api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Papago API

[Papago Text Translation 개요](https://api.ncloud-docs.com/docs/ko/ai-naver-papagonmt)

![NCP 내에서 파파고 Api 사용 신청](./image/image.png)

![파파고 Api 인증 정보](./image/image-1.png)

![파파고 Api 공통 설정](./image/image-2.png)

- app 이름 : hook-killer
- Client ID(X-NCP-APIGW-API-KEY-ID) : ybakk0x770
- Client Secret(X-NCP-APIGW-API-KEY) : DQxOkhtAKEqN61A5vGrp5mYW1j66Qi7vR0R7fJh5

- VM Option으로 주어질 변수
- -Dpapago.X-NCP-APIGW-API-KEY-ID=ybakk0x770
- -Dpapago.X-NCP-APIGW-API-KEY=DQxOkhtAKEqN61A5vGrp5mYW1j66Qi7vR0R7fJh5

---

## Papago Translation Issue 해결

https://github.com/hook-killer/back-end/issues/57

작업은

`TranslationService`, `ArticleController`, `ArticleService`, `NoticeController`, `NoticeService` 에서 진행한다.

### TranslationService

실제로 파파고 API를 사용하여 통신하는 부분.

여기서 source, target에 따라 조건부 번역을 시도해야 할 듯 싶다. → 해보니까 아니었음!

### Article / Notice Controller

등록 / 수정이 일어나는 부분.

`@Transactional` 고려해야 할듯

여기에서 Service의 메소드를 호출하기 때문에..

흠 근데 컨트롤러에서 `@Transactional` 쓰는게 맞나?

### Article / Notice Service

`TranslationService`를 사용하여 실제로 게시글을 등록 / 수정하는 부분. → 여기서 CN, EN 번역 고려

create에서는 `@Transactional` 이 불필요하나,

update에서는 `@Transactional` 가 필요해보인다.

[Transaction Propagation and Isolation in Spring @Transactional](https://www.baeldung.com/spring-transactional-propagation-isolation)

![Alt text](./image/image-3.png)

`@Transactional(propagation = MANDATORY)`?

`@Transactional(propagation = REQUIRES_NEW)`?

Transactional은 `ArticleContent` 혹은 `NoticeContent` Entity 안의 update에 걸어주자.
Binary file added Papago/image/image-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 Papago/image/image-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 Papago/image/image-3.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 Papago/image/image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit cc5fe1c

Please sign in to comment.