-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathapi.apib
77 lines (56 loc) · 1.87 KB
/
api.apib
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
FORMAT: v1
HOST: http://localhost/api/v1/predictive
# Group Predictive-Text
## Vocabulary Collection [/vocabularies/{?ipp,page,prefix,user_mode}]
### 根据前缀补全单词 [GET]
+ Parameters
+ ipp: 7 (number, optional) - 每页提示个数,默认7个
+ page: 1 (number, optional) - 当前页,默认1
+ prefix: `th` (string, required) - 单词前缀
+ user_mode: 1 (number, optional) - 开启用户个性化提示
+ Response 200 (application/json)
+ Attributes (VocabularyResponse)
## Vocabulary [/vocabularies/{id}/]
### 更新用户数据 [PUT]
+ Parameters
+ id: 1 (number, required) - 单词id
+ Response 200 (application/json)
+ Attributes (VocabularyRead)
## Phrase Collection [/phrases/{?ipp,page,word,user_mode}]
### 根据单词提示短语 [GET]
+ Parameters
+ ipp: 7 (number, optional) - 每页提示个数,默认7个
+ page: 1 (number, optional) - 当前页,默认1
+ word: `this` (string, required) - 单词
+ user_mode: 1 (number, optional) - 开启用户个性化提示
+ Response 200 (application/json)
+ Attributes (PhraseResponse)
## Phrase [/phrases/{id}/{?vocab_id}]
### 更新用户数据 [PUT]
+ Parameters
+ id: 1 (number, required) - 短语id
+ Request (application/json)
+ Attributes
+ vocab_id: 1 (number, required) - 短语的第一个单词id
+ Response 200 (application/json)
+ Attributes (PhraseRead)
# Data Structures
## VocabularyRead
+ id: 1 (number)
+ word: `this` (string) - 单词
+ frequency: 1029 (number) - 频率
## PhraseRead
+ id: 1 (number)
+ word: `this` (string) - 单词
+ next_word: `is` (string) - 补全短语
+ frequency: 1029 (number) - 频率
## VocabularyResponse
+ ipp: 7 (number)
+ page: 1 (number)
+ total: 4 (number)
+ objects (array[VocabularyRead])
## PhraseResponse
+ ipp: 7 (number)
+ page: 1 (number)
+ total: 4 (number)
+ objects (array[PhraseRead])