Skip to content

Commit

Permalink
refactor🎨:添加api返回值转化
Browse files Browse the repository at this point in the history
  • Loading branch information
wenjianzhang committed Jul 14, 2021
1 parent 4926c76 commit 145dc00
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sdk/api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,10 @@ func (e Api) Custom(data gin.H) {
response.Custum(e.Context, data)
}

func (e Api) Translate(form, to interface{}) {
pkg.Translate(form, to)
}

// getAcceptLanguage 获取当前语言
func (e *Api) getAcceptLanguage() string {
languages := language.ParseAcceptLanguage(e.Context.GetHeader("Accept-Language"), nil)
Expand Down

0 comments on commit 145dc00

Please sign in to comment.