File tree Expand file tree Collapse file tree 2 files changed +18
-6
lines changed
src/main/java/site/udtk/sentenceapi/repository Expand file tree Collapse file tree 2 files changed +18
-6
lines changed Original file line number Diff line number Diff line change 44
55- traditional korean proverbs, more than 4,000
66 - from https://www.krpia.co.kr/product/main?plctId=PLCT00004626#none
7- - famous saying (soon)
7+ - quotes, more than 200 (more to be added)
8+ - from https://www.goodreads.com/quotes (soon)
89- maxim (soon)
910
1011---
2829### 3. ` https://sentence.udtk.site/language?language=&count= `
2930
3031- ** description** : return random sentences in chosen language
31- - request parameter : language, count
32+ - request parameter : ` language ` , ` count `
3233 - language : ` kor ` , ` eng `
3334 - default : ` kor `
3435 - count : number of sentences to get
4546 - range : 1 ~ 20
4647 - default : 1
4748
48- ---
49-
5049### response example
5150
5251ex) https://sentence.udtk.site/random?count=2
@@ -67,8 +66,8 @@ ex) https://sentence.udtk.site/random?count=2
6766### ❗️request limit
6867
6968- ** <U >20 requests per 5 minutes</U >**
70- - when the limit is exceeded, the response will be 429 Too Many Requests
71- - time left to reset the limit will be included in the response header X-Rate-Limit-Retry-After-Seconds
69+ - when the limit is exceeded, the response will be ` 429 Too Many Requests `
70+ - time left to reset the limit will be included in the response header ` X-Rate-Limit-Retry-After-Seconds `
7271
7372---
7473
Original file line number Diff line number Diff line change 11package site .udtk .sentenceapi .repository ;
22
3+ import java .util .List ;
4+ import java .util .Optional ;
5+
6+ import org .springframework .data .jpa .repository .EntityGraph ;
37import org .springframework .data .jpa .repository .JpaRepository ;
8+ import org .springframework .data .jpa .repository .Query ;
49import org .springframework .stereotype .Repository ;
510
11+ import io .micrometer .common .lang .NonNullApi ;
612import site .udtk .sentenceapi .domain .Sentence ;
713
814@ Repository
15+ @ NonNullApi
916public interface SentenceRepository extends JpaRepository <Sentence , Long > {
17+ @ EntityGraph (attributePaths = {"category" })
18+ Optional <Sentence > findById (Long id );
19+
20+ @ EntityGraph (attributePaths = {"category" })
21+ @ Query ("SELECT s FROM Sentence s WHERE s.id IN :ids" )
22+ List <Sentence > findAllById (List <Long > ids );
1023}
You can’t perform that action at this time.
0 commit comments