Commit 92b37674 authored by chenweijian's avatar chenweijian

cp翻译

parent ae017461
......@@ -119,6 +119,15 @@ const (
MSG_ID_SEND_GIFT_TO_NO_ONE MsgIdType = 229 // 送礼给没人
MSG_ID_TRAN_GEM MsgIdType = 231 // 转移宝石(粉钻)
MSG_ID_BUY_GEM MsgIdType = 232 // 买宝石(粉钻)
MSG_ID_ALREADY_HAS_CP MsgIdType = 243 // 对方已有CP了
MSG_ID_INVITE_CP MsgIdType = 244 // 你想要和我成为CP吗
MSG_ID_WANT_BE_YOUR_CP MsgIdType = 245 // 我想成为你的CP
MSG_ID_EXPIRES_AFTER_24_H MsgIdType = 246 // 24小时后自动失效
MSG_ID_WANT_UNBIND_CP MsgIdType = 247 // 我想解绑CP
MSG_ID_BIND_CP_SUCCEED MsgIdType = 248 // 绑定成功-我们已经是CP了
MSG_ID_SEND_CP_GIFT MsgIdType = 249 // 发放cp礼物
MSG_ID_REJECTED_CP_INVITE MsgIdType = 250 // %s已拒绝CP邀请
MSG_ID_UNBIND_CP_SUCCEED MsgIdType = 251 // 解绑cp成功
ADD_GROUP_FAILED AddGroupResultType = 0
ADD_GROUP_DONE AddGroupResultType = 1
......
......@@ -19,4 +19,6 @@ var (
DiamondNoEnough = myerr.NewBusinessCode(4000, "Insufficient diamonds", myerr.BusinessData{})
DiamondFrequency = myerr.NewBusinessCode(4001, "Diamond operation frequency too high", myerr.BusinessData{})
DiamondAccountFrozen = myerr.NewBusinessCode(4004, "Diamond Account Frozen", myerr.BusinessData{})
AlreadyHasCp = myerr.NewBusinessCode(90001, "The opponent already has CP", myerr.BusinessData{})
)
......@@ -11,6 +11,7 @@ import (
"git.hilo.cn/hilo-common/myerr"
"git.hilo.cn/hilo-common/resource/mysql"
"git.hilo.cn/hilo-common/utils"
"gorm.io/gorm"
)
// 发送小助手消息
......@@ -58,3 +59,24 @@ func GetErrByLanguage(model *domain.Model, msgId common.MsgIdType, lang string,
}
return myerr.NewBusinessCodeNoCheck(myErr.GetCode(), msg, myerr.BusinessData{})
}
func GetResMultiTextBy(model *domain.Model, msgId uint, Language mysql.Str) (string, error) {
r := res_m.ResMultiText{}
if err := model.DB().Where(&res_m.ResMultiText{
MsgId: msgId,
Language: Language,
}).First(&r).Error; err != nil {
if err == gorm.ErrRecordNotFound {
if err := model.DB().Where(&res_m.ResMultiText{
MsgId: msgId,
Language: common.DEFAULT_LANG,
}).First(&r).Error; err != nil {
return "", myerr.WrapErr(err)
}
} else {
return "", myerr.WrapErr(err)
}
}
return r.Content, nil
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment