Commit 0a8b3b4b authored by hujiebin's avatar hujiebin

Feature/3.7.0 up

parent 8d77bc8c
......@@ -49,26 +49,27 @@ var (
GroupMicBanTourist = myerr.NewBusinessCode(12010, "Mic need member", myerr.BusinessData{}) // 游客不能上麦
// 群组
GroupNotFound = myerr.NewBusinessCode(14001, "Group not found", myerr.BusinessData{}) // 找不到该群
NotGroupMember = myerr.NewBusinessCode(14002, "Not a group member", myerr.BusinessData{}) // 不是群成员
IncorrectPassword = myerr.NewBusinessCode(14003, "Incorrect password", myerr.BusinessData{}) // 密码错
NoPrivileges = myerr.NewBusinessCode(14004, "Not enough permission", myerr.BusinessData{}) // 操作权限不够
InBlacklist = myerr.NewBusinessCode(14005, "Can not join the group due to blacklist", myerr.BusinessData{}) // 在群黑名单中,不能进群
GroupInKick = myerr.NewBusinessCode(14007, "Kicked, can not join the group. Try again later", myerr.BusinessData{}) // 在被踢出的有效期中
OwnerCannotLeave = myerr.NewBusinessCode(14008, "Owner can not leave the group", myerr.BusinessData{}) // 群主不能退群
WrongPasswordLength = myerr.NewBusinessCode(14010, "Incorrect password length", myerr.BusinessData{}) // 密码长度错误
GroupIsBanned = myerr.NewBusinessCode(14011, "group is banned by ", myerr.BusinessData{}) // 群已经被管理员封禁
GroupLimitReached = myerr.NewBusinessCode(14012, "Join group limit reached", myerr.BusinessData{}) // 所在群已达上限
RoleLimitReached = myerr.NewBusinessCode(14013, "Role limit reached", myerr.BusinessData{}) // 所任角色已达上限
GroupCreateLimitReached = myerr.NewBusinessCode(14014, "Create group limit reached", myerr.BusinessData{}) // 你创建的群组数已达上限
GroupLimitReachedVip = myerr.NewBusinessCode(14015, "Join group limit reached. Please purchase VIP", myerr.BusinessData{}) // 所在群已达上限,请购买VIP
GroupAlreadyAwarded = myerr.NewBusinessCode(14016, "Group support awarded", myerr.BusinessData{}) // 群支持奖励已经发放过了
NotManagerOrAdmin = myerr.NewBusinessCode(14017, "Not manager or group admin", myerr.BusinessData{}) // 不是经理或管理员
UserAlreadyAwarded = myerr.NewBusinessCode(14018, "User already awarded", myerr.BusinessData{}) // 用户的群支持奖励已经发放过了
ImeiAlreadyAwarded = myerr.NewBusinessCode(14019, "Imei support awarded", myerr.BusinessData{}) // 设备的群支持奖励已经发放过了
GroupCustomThemeLimit = myerr.NewBusinessCode(14020, "Group Custom Theme Limit", myerr.BusinessData{}) //群主题定制数量只能是5个
GroupSupportIpLimit = myerr.NewBusinessCode(14024, "ID:%v is a duplicate account, please select another user to receive the reward", myerr.BusinessData{}) // 群组扶持ip限制
GroupNoPowerToSvip6 = myerr.NewBusinessCode(14026, "Cannot use this permission for SVIP6", myerr.BusinessData{}) // 踢出,无法对SVIP6使用此权限
GroupNotFound = myerr.NewBusinessCode(14001, "Group not found", myerr.BusinessData{}) // 找不到该群
NotGroupMember = myerr.NewBusinessCode(14002, "Not a group member", myerr.BusinessData{}) // 不是群成员
IncorrectPassword = myerr.NewBusinessCode(14003, "Incorrect password", myerr.BusinessData{}) // 密码错
NoPrivileges = myerr.NewBusinessCode(14004, "Not enough permission", myerr.BusinessData{}) // 操作权限不够
InBlacklist = myerr.NewBusinessCode(14005, "Can not join the group due to blacklist", myerr.BusinessData{}) // 在群黑名单中,不能进群
GroupInKick = myerr.NewBusinessCode(14007, "Kicked, can not join the group. Try again later", myerr.BusinessData{}) // 在被踢出的有效期中
OwnerCannotLeave = myerr.NewBusinessCode(14008, "Owner can not leave the group", myerr.BusinessData{}) // 群主不能退群
WrongPasswordLength = myerr.NewBusinessCode(14010, "Incorrect password length", myerr.BusinessData{}) // 密码长度错误
GroupIsBanned = myerr.NewBusinessCode(14011, "group is banned by ", myerr.BusinessData{}) // 群已经被管理员封禁
GroupLimitReached = myerr.NewBusinessCode(14012, "Join group limit reached", myerr.BusinessData{}) // 所在群已达上限
RoleLimitReached = myerr.NewBusinessCode(14013, "Role limit reached", myerr.BusinessData{}) // 所任角色已达上限
GroupCreateLimitReached = myerr.NewBusinessCode(14014, "Create group limit reached", myerr.BusinessData{}) // 你创建的群组数已达上限
GroupLimitReachedVip = myerr.NewBusinessCode(14015, "Join group limit reached. Please purchase VIP", myerr.BusinessData{}) // 所在群已达上限,请购买VIP
GroupAlreadyAwarded = myerr.NewBusinessCode(14016, "Group support awarded", myerr.BusinessData{}) // 群支持奖励已经发放过了
NotManagerOrAdmin = myerr.NewBusinessCode(14017, "Not manager or group admin", myerr.BusinessData{}) // 不是经理或管理员
UserAlreadyAwarded = myerr.NewBusinessCode(14018, "User already awarded", myerr.BusinessData{}) // 用户的群支持奖励已经发放过了
ImeiAlreadyAwarded = myerr.NewBusinessCode(14019, "Imei support awarded", myerr.BusinessData{}) // 设备的群支持奖励已经发放过了
GroupCustomThemeLimit = myerr.NewBusinessCode(14020, "Group Custom Theme Limit", myerr.BusinessData{}) //群主题定制数量只能是5个
GroupSupportIpLimit = myerr.NewBusinessCode(14024, "ID:%v is a duplicate account, please select another user to receive the reward", myerr.BusinessData{}) // 群组扶持ip限制
GroupNoPowerToSvip6 = myerr.NewBusinessCode(14026, "Cannot use this permission for SVIP6", myerr.BusinessData{}) // 踢出,无法对SVIP6使用此权限
GroupSupportWealthLevel8 = myerr.NewBusinessCode(14027, "Wealth level not reach 8", myerr.BusinessData{}) // 财富等级8级
// 家族
GroupPowerHasJoinOther = myerr.NewBusinessCode(15001, "You already have joined power, please exit first", myerr.BusinessData{}) // 已经加入了其它国家势力
......
......@@ -179,7 +179,7 @@ func GetSupportDetail(c *gin.Context) (*mycontext.MyContext, error) {
func TryAddSupporter(c *gin.Context) (*mycontext.MyContext, error) {
myContext := mycontext.CreateMyContext(c.Keys)
myUserId, err := req.GetUserId(c)
myUserId, lang, err := req.GetUserIdLang(c, myContext)
if err != nil {
return myContext, err
}
......@@ -222,7 +222,17 @@ func TryAddSupporter(c *gin.Context) (*mycontext.MyContext, error) {
if role != group_e.GROUP_MANAGER && role != group_e.GROUP_ADMIN {
return myContext, bizerr.NotManagerOrAdmin
}
// 判断财富等级必须要大于等于8级
wealthGrade, _, err := user_m.GetWealthGrade(model, userId)
if err != nil {
return myContext, err
}
if wealthGrade < 8 {
if msg, _ := res_m.GetResMultiTextBy(model.DB(), 187, lang); msg != nil { // 187:res_multi_text 财富等级为到8级
return myContext, myerr.NewBusinessCodeNoCheck(bizerr.GroupSupportWealthLevel8.GetCode(), msg.Content, myerr.BusinessData{})
}
return myContext, bizerr.GroupSupportWealthLevel8
}
// 判断用户是否作为助手领取过奖励
sameImeiUsers, err := user_m.GetSameImeiMap(model, userId)
if err != 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