refactor(model): 重构数据模型结构
- 将 Word 和 MemoryRecord 结构体拆分为独立文件 - 创建 request 包用于存放请求结构体 - 创建 response 包用于存放响应结构体 - 将 YoudaoResponse 移至独立模型文件 - 更新服务层接口参数类型为新的请求响应结构体 - 修改处理器层导入路径以使用新包结构
This commit is contained in:
28
memora-api/internal/model/youdao.go
Normal file
28
memora-api/internal/model/youdao.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package model
|
||||
|
||||
type YoudaoResponse struct {
|
||||
Query string `json:"query"`
|
||||
Translation []string `json:"translation"`
|
||||
Basic struct {
|
||||
Phonetic string `json:"phonetic"`
|
||||
UkPhonetic string `json:"uk-phonetic"`
|
||||
UsPhonetic string `json:"us-phonetic"`
|
||||
ExamType []string `json:"exam_type"`
|
||||
Wfs []struct {
|
||||
Wf struct {
|
||||
Name string `json:"name"`
|
||||
} `json:"wf"`
|
||||
Means []struct {
|
||||
Mean struct {
|
||||
Text string `json:"text"`
|
||||
} `json:"mean"`
|
||||
} `json:"means"`
|
||||
} `json:"wfs"`
|
||||
} `json:"basic"`
|
||||
SpeakUrl string `json:"speakUrl"`
|
||||
SpeakFile string `json:"speakFile"`
|
||||
Web []struct {
|
||||
Value []string `json:"value"`
|
||||
} `json:"web"`
|
||||
ErrorCode string `json:"errorCode"`
|
||||
}
|
||||
Reference in New Issue
Block a user