]> git.ipfire.org Git - thirdparty/fastapi/fastapi.git/commitdiff
🌐 Add Korean translation for `/docs/ko/docs/tutorial/dependencies/dependencies-in...
authorκΉ€λͺ…κΈ° <riroan@naver.com>
Sun, 11 Feb 2024 13:49:45 +0000 (22:49 +0900)
committerGitHub <noreply@github.com>
Sun, 11 Feb 2024 13:49:45 +0000 (08:49 -0500)
docs/ko/docs/tutorial/dependencies/dependencies-in-path-operation-decorators.md [new file with mode: 0644]

diff --git a/docs/ko/docs/tutorial/dependencies/dependencies-in-path-operation-decorators.md b/docs/ko/docs/tutorial/dependencies/dependencies-in-path-operation-decorators.md
new file mode 100644 (file)
index 0000000..92b2c7d
--- /dev/null
@@ -0,0 +1,139 @@
+# κ²½λ‘œ μž‘동 λ°μ½”λ ˆμ΄ν„°μ—μ„œμ˜ μ˜μ‘΄μ„±
+
+λͺ‡λͺ‡ κ²½μš°μ—λŠ”, *경둜 μž‘동 ν•¨μˆ˜* μ•ˆμ—μ„œ μ˜μ‘΄μ„±μ˜ λ°˜ν™˜ κ°’이 ν•„μš”ν•˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€.
+
+λ˜λŠ” μ˜μ‘΄μ„±μ΄ κ°’을 λ°˜ν™˜ν•˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€.
+
+κ·ΈλŸ¬λ‚˜ μ—¬μ „νžˆ μ‹€ν–‰/해결될 ν•„μš”κ°€ μžˆμŠ΅λ‹ˆλ‹€.
+
+그런 κ²½μš°μ—, `Depends`λ₯Ό μ‚¬μš©ν•˜μ—¬ *경둜 μž‘동 ν•¨μˆ˜*의 λ§€κ°œλ³€μˆ˜λ‘œ μ„ μ–Έν•˜λŠ” κ²ƒλ³΄λ‹€ *경둜 μž‘동 λ°μ½”λ ˆμ΄ν„°*에 `dependencies`의 `list`λ₯Ό μΆ”κ°€ν•  μˆ˜ μžˆμŠ΅λ‹ˆλ‹€.
+
+## *경둜 μž‘동 λ°μ½”λ ˆμ΄ν„°*에 `dependencies` μΆ”κ°€ν•˜κΈ°
+
+*경둜 μž‘동 λ°μ½”λ ˆμ΄ν„°*λŠ” `dependencies`λΌλŠ” μ„ νƒμ μΈ μΈμžλ₯Ό λ°›μŠ΅λ‹ˆλ‹€.
+
+`Depends()`둜 λœ `list`μ΄μ–΄μ•Όν•©λ‹ˆλ‹€:
+
+=== "Python 3.9+"
+
+    ```Python hl_lines="19"
+    {!> ../../../docs_src/dependencies/tutorial006_an_py39.py!}
+    ```
+
+=== "Python 3.8+"
+
+    ```Python hl_lines="18"
+    {!> ../../../docs_src/dependencies/tutorial006_an.py!}
+    ```
+
+=== "Python 3.8 Annotatedκ°€ μ—†λŠ” κ²½μš°"
+
+    !!! tip "팁"
+        κ°€λŠ₯ν•˜λ‹€λ©΄ `Annotated`κ°€ λ‹¬λ¦° λ²„전을 κΆŒμž₯ν•©λ‹ˆλ‹€.
+
+    ```Python hl_lines="17"
+    {!> ../../../docs_src/dependencies/tutorial006.py!}
+    ```
+
+μ΄λŸ¬ν•œ μ˜μ‘΄μ„±λ“€μ€ κΈ°μ‘΄ μ˜μ‘΄μ„±λ“€κ³Ό κ°™μ€ λ°©μ‹μœΌλ‘œ μ‹€ν–‰/ν•΄κ²°λ©λ‹ˆλ‹€. κ·ΈλŸ¬λ‚˜ κ°’은 (무엇이든 λ°˜ν™˜ν•œλ‹€λ©΄) *경둜 μž‘동 ν•¨μˆ˜*에 μ œκ³΅λ˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€.
+
+!!! tip "팁"
+    μΌλΆ€ νŽΈμ§‘κΈ°μ—μ„œλŠ” μ‚¬μš©λ˜μ§€ μ•ŠλŠ” ν•¨μˆ˜ λ§€κ°œλ³€μˆ˜λ₯Ό κ²€μ‚¬ν•˜κ³  μ˜€λ₯˜λ‘œ ν‘œμ‹œν•©λ‹ˆλ‹€.
+
+    *경둜 μž‘동 λ°μ½”λ ˆμ΄ν„°*μ—μ„œ `dependencies`λ₯Ό μ‚¬μš©ν•˜λ©΄ νŽΈμ§‘κΈ°/도ꡬ μ˜€λ₯˜λ₯Ό ν”Όν•˜λ©° μ‹€ν–‰λ˜λ„둝 ν•  μˆ˜ μžˆμŠ΅λ‹ˆλ‹€.
+
+    λ˜ν•œ μ½”λ“œμ—μ„œ μ‚¬μš©λ˜μ§€ μ•ŠλŠ” λ§€κ°œλ³€μˆ˜λ₯Ό λ³΄κ³  λΆˆν•„μš”ν•˜λ‹€κ³  μƒκ°ν•  μˆ˜ μžˆλŠ” μƒˆλ‘œμš΄ κ°œλ°œμžμ˜ ν˜Όλž€μ„ λ°©μ§€ν•˜λŠ”λ° λ„움이 λ  μˆ˜ μžˆμŠ΅λ‹ˆλ‹€.
+
+!!! info "정보"
+    μ΄ μ˜ˆμ‹œμ—μ„œ `X-Key`와 `X-Token`μ΄λΌλŠ” μ»€μŠ€ν…€ ν—€λ”λ₯Ό λ§Œλ“€μ–΄ μ‚¬μš©ν–ˆμŠ΅λ‹ˆλ‹€.
+
+    κ·ΈλŸ¬λ‚˜ μ‹€μ œλ‘œ λ³΄μ•ˆμ„ κ΅¬ν˜„ν•  λ•ŒλŠ” ν†΅ν•©λœ [λ³΄μ•ˆ μœ ν‹Έλ¦¬ν‹° (λ‹€μŒ μ±•ν„°)](../security/index.md){.internal-link target=_blank}λ₯Ό μ‚¬μš©ν•˜λŠ” κ²ƒμ΄ λ” λ§Žμ€ μ΄μ μ„ μ–»μ„ μˆ˜ μžˆμŠ΅λ‹ˆλ‹€.
+
+## μ˜μ‘΄μ„± μ˜€λ₯˜μ™€ κ°’ λ°˜ν™˜ν•˜κΈ°
+
+ν‰μ†Œμ— μ‚¬μš©ν•˜λ˜λŒ€λ‘œ κ°™μ€ μ˜μ‘΄μ„± *ν•¨μˆ˜*λ₯Ό μ‚¬μš©ν•  μˆ˜ μžˆμŠ΅λ‹ˆλ‹€.
+
+### μ˜μ‘΄μ„± μš”ꡬ사항
+
+(헀더같은) μš”μ²­ μš”κ΅¬μ‚¬ν•­μ΄λ‚˜ ν•˜μœ„-μ˜μ‘΄μ„±μ„ μ„ μ–Έν•  μˆ˜ μžˆμŠ΅λ‹ˆλ‹€:
+
+=== "Python 3.9+"
+
+    ```Python hl_lines="8  13"
+    {!> ../../../docs_src/dependencies/tutorial006_an_py39.py!}
+    ```
+
+=== "Python 3.8+"
+
+    ```Python hl_lines="7  12"
+    {!> ../../../docs_src/dependencies/tutorial006_an.py!}
+    ```
+
+=== "Python 3.8 Annotatedκ°€ μ—†λŠ” κ²½μš°"
+
+    !!! tip "팁"
+        κ°€λŠ₯ν•˜λ‹€λ©΄ `Annotated`κ°€ λ‹¬λ¦° λ²„전을 κΆŒμž₯ν•©λ‹ˆλ‹€.
+
+    ```Python hl_lines="6  11"
+    {!> ../../../docs_src/dependencies/tutorial006.py!}
+    ```
+
+### μ˜€λ₯˜ λ°œμƒμ‹œν‚€κΈ°
+
+λ‹€μŒ μ˜μ‘΄μ„±μ€ κΈ°μ‘΄ μ˜μ‘΄μ„±κ³Ό λ™μΌν•˜κ²Œ μ˜ˆμ™Έλ₯Ό `raise`λ₯Ό μΌμœΌν‚¬ μˆ˜ μžˆμŠ΅λ‹ˆλ‹€:
+
+=== "Python 3.9+"
+
+    ```Python hl_lines="10  15"
+    {!> ../../../docs_src/dependencies/tutorial006_an_py39.py!}
+    ```
+
+=== "Python 3.8+"
+
+    ```Python hl_lines="9  14"
+    {!> ../../../docs_src/dependencies/tutorial006_an.py!}
+    ```
+
+=== "Python 3.8 Annotatedκ°€ μ—†λŠ” κ²½μš°"
+
+    !!! tip "팁"
+        κ°€λŠ₯ν•˜λ‹€λ©΄ `Annotated`κ°€ λ‹¬λ¦° λ²„전을 κΆŒμž₯ν•©λ‹ˆλ‹€.
+
+    ```Python hl_lines="8  13"
+    {!> ../../../docs_src/dependencies/tutorial006.py!}
+    ```
+
+### κ°’ λ°˜ν™˜ν•˜κΈ°
+
+값을 λ°˜ν™˜ν•˜κ±°λ‚˜, κ·ΈλŸ¬μ§€ μ•Šμ„ μˆ˜ μžˆμœΌλ©° κ°’은 μ‚¬μš©λ˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€.
+
+κ·Έλž˜μ„œ μ΄λ―Έ λ‹€λ₯Έ κ³³μ—μ„œ μ‚¬μš©λœ (값을 λ°˜ν™˜ν•˜λŠ”) μΌλ°˜μ μΈ μ˜μ‘΄μ„±μ„ μž¬μ‚¬μš©ν•  μˆ˜ μžˆκ³ , λΉ„둝 κ°’은 μ‚¬μš©λ˜μ§€ μ•Šμ§€λ§Œ μ˜μ‘΄μ„±μ€ μ‹€ν–‰λ  κ²ƒμž…λ‹ˆλ‹€:
+
+=== "Python 3.9+"
+
+    ```Python hl_lines="11  16"
+    {!> ../../../docs_src/dependencies/tutorial006_an_py39.py!}
+    ```
+
+=== "Python 3.8+"
+
+    ```Python hl_lines="10  15"
+    {!> ../../../docs_src/dependencies/tutorial006_an.py!}
+    ```
+
+=== "Python 3.8 Annotatedκ°€ μ—†λŠ” κ²½μš°"
+
+    !!! tip "팁"
+        κ°€λŠ₯ν•˜λ‹€λ©΄ `Annotated`κ°€ λ‹¬λ¦° λ²„전을 κΆŒμž₯ν•©λ‹ˆλ‹€.
+
+    ```Python hl_lines="9  14"
+    {!> ../../../docs_src/dependencies/tutorial006.py!}
+    ```
+
+## *경둜 μž‘동* λͺ¨μŒμ— λŒ€ν•œ μ˜μ‘΄μ„±
+
+λ‚˜μ€‘μ— μ—¬λŸ¬ νŒŒμΌμ„ κ°€μ§€κ³  μžˆμ„ μˆ˜ μžˆλŠ” λ” ν° μ• ν”Œλ¦¬μΌ€μ΄μ…˜μ„ κ΅¬μ‘°ν™”ν•˜λŠ” λ²•([더 ν° μ• ν”Œλ¦¬μΌ€μ΄μ…˜ - μ—¬λŸ¬ νŒŒμΌλ“€](../../tutorial/bigger-applications.md){.internal-link target=_blank})을 μ½μ„ λ•Œ, *경둜 μž‘동* λͺ¨μŒμ— λŒ€ν•œ λ‹¨μΌ `dependencies` λ§€κ°œλ³€μˆ˜λ₯Ό μ„ μ–Έν•˜λŠ” λ²•에 λŒ€ν•΄μ„œ λ°°μš°κ²Œ λ  κ²ƒμž…λ‹ˆλ‹€.
+
+## μ „μ—­ μ˜μ‘΄μ„±
+
+λ‹€μŒμœΌλ‘œ κ° *경둜 μž‘동*에 μ μš©λ˜λ„둝 `FastAPI` μ• ν”Œλ¦¬μΌ€μ΄μ…˜ μ „체에 μ˜μ‘΄μ„±μ„ μΆ”κ°€ν•˜λŠ” λ²•을 λ³Ό κ²ƒμž…λ‹ˆλ‹€.