|
|
@ -186,6 +186,20 @@ public class UserService { |
|
|
|
return new TeamBo(members); |
|
|
|
} |
|
|
|
|
|
|
|
public void bindInviteCode(Integer uid, String inviteCode) { |
|
|
|
Assert.isTrue(StringUtils.hasText(inviteCode), "邀请码不能为空"); |
|
|
|
MatrixUser u = userMapper.selectById(uid); |
|
|
|
Assert.isTrue(u.getUpUid() == null, "不能重复绑定"); |
|
|
|
MatrixUser up = userMapper.selectByInviteCode(inviteCode); |
|
|
|
Assert.isTrue(up != null, "非法邀请码"); |
|
|
|
Assert.isTrue(up.getAppId().equals(u.getAppId()), "非法邀请码"); |
|
|
|
MatrixUser user = new MatrixUser(); |
|
|
|
user.setId(uid); |
|
|
|
user.setUpUid(up.getId()); |
|
|
|
user.setAdminId(up.getAdminId()); |
|
|
|
userMapper.updateById(user); |
|
|
|
} |
|
|
|
|
|
|
|
public void bindAliPay(Integer uid, String aliPayAccount, String name) { |
|
|
|
Assert.isTrue(StringUtils.hasText(aliPayAccount), "支付宝账号不能为空"); |
|
|
|
Assert.isTrue(StringUtils.hasText(name), "支付宝账号姓名不能为空"); |
|
|
|