mirror of
https://github.com/halejohn/Cloudreve.git
synced 2026-01-26 09:34:57 +08:00
i18n: logs in rest pkgs
This commit is contained in:
@@ -221,7 +221,7 @@ const (
|
||||
// DBErr 数据库操作失败
|
||||
func DBErr(msg string, err error) Response {
|
||||
if msg == "" {
|
||||
msg = "数据库操作失败"
|
||||
msg = "Database operation failed."
|
||||
}
|
||||
return Err(CodeDBError, msg, err)
|
||||
}
|
||||
@@ -229,7 +229,7 @@ func DBErr(msg string, err error) Response {
|
||||
// ParamErr 各种参数错误
|
||||
func ParamErr(msg string, err error) Response {
|
||||
if msg == "" {
|
||||
msg = "参数错误"
|
||||
msg = "Invalid parameters."
|
||||
}
|
||||
return Err(CodeParamErr, msg, err)
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ func NewResponseWithGobData(data interface{}) Response {
|
||||
var w bytes.Buffer
|
||||
encoder := gob.NewEncoder(&w)
|
||||
if err := encoder.Encode(data); err != nil {
|
||||
return Err(CodeInternalSetting, "无法编码返回结果", err)
|
||||
return Err(CodeInternalSetting, "Failed to encode response content", err)
|
||||
}
|
||||
|
||||
return Response{Data: w.Bytes()}
|
||||
|
||||
@@ -13,7 +13,7 @@ import (
|
||||
func CheckLogin() Response {
|
||||
return Response{
|
||||
Code: CodeCheckLogin,
|
||||
Msg: "未登录",
|
||||
Msg: "Login required",
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user