Commit e6b3b6b7 authored by hujiebin's avatar hujiebin

feat: 家族昵称和家族铭牌延长可以设置15个字符

parent 8dd1a38c
......@@ -67,3 +67,7 @@ const (
PowerSuppportAwarded PowerSupportAwardState = 1 // 已经领取
PowerSuppportWaiting PowerSupportAwardState = 2 // 待领取
)
const (
LongestNameplate = 15
)
......@@ -140,8 +140,8 @@ func UpdateFamily(model *domain.Model, familyId uint64, name, nameplate, declara
if groupPower.ModifyNameplate != mysql.YES {
// 同步修改铭牌
n := len([]rune(name))
if n > 6 {
n = 6
if n > groupPower_e.LongestNameplate {
n = groupPower_e.LongestNameplate
}
updateMap["nameplate"] = string([]rune(name[0:n]))
}
......
......@@ -1510,7 +1510,7 @@ func GroupPowerSetInfo(c *gin.Context) (*mycontext.MyContext, error) {
return myContext, res_m.GetErrByLanguage(model.Db, common.MSG_ID_SET_FAMILY_NAMEPL, lang, bizerr.GroupPowerChangeNameplate)
}
// 检查铭牌长度和唯一性
if len(para.Nameplate) > 6 {
if len(para.Nameplate) > groupPower_e.LongestNameplate {
return myContext, bizerr.GroupPowerHaveTooLong
}
if groupPower_m.IsExistsNameplate(model, para.Nameplate) {
......
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