|
@@ -67,26 +67,26 @@ public class GroupServiceImp implements GroupService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
- @Override
|
|
|
|
|
- @Transactional
|
|
|
|
|
- public GroupVO addMember(Integer userId, Integer invitedUserId, Integer groupId) throws EntityNotFoundException {
|
|
|
|
|
- List<Integer> userIds = groupMemberMapper.selectUserIdsByGroupId(groupId);
|
|
|
|
|
- if (!userIds.contains(userId)) {
|
|
|
|
|
- throw new EntityNotFoundException("小组邀请发生错误,用户没有权限!");
|
|
|
|
|
- }
|
|
|
|
|
- if (userIds.contains(invitedUserId)) {
|
|
|
|
|
- throw new RuntimeException("邀请的用户已经加入小组!");
|
|
|
|
|
- }
|
|
|
|
|
- try {
|
|
|
|
|
- gitlabApi.addMemberToGroup(groupId, invitedUserId);
|
|
|
|
|
- } catch (GitLabApiException e) {
|
|
|
|
|
- throw new RuntimeException("将成员加入Group时发生异常[" + e.getMessage() + "]");
|
|
|
|
|
- }
|
|
|
|
|
- groupMemberMapper.insert(groupId,invitedUserId);
|
|
|
|
|
- //todo
|
|
|
|
|
- return null;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- }
|
|
|
|
|
|
|
+// @Override
|
|
|
|
|
+// @Transactional
|
|
|
|
|
+// public GroupVO addMember(Integer userId, Integer invitedUserId, Integer groupId) throws EntityNotFoundException {
|
|
|
|
|
+// List<Integer> userIds = groupMemberMapper.selectUserIdsByGroupId(groupId);
|
|
|
|
|
+// if (!userIds.contains(userId)) {
|
|
|
|
|
+// throw new EntityNotFoundException("小组邀请发生错误,用户没有权限!");
|
|
|
|
|
+// }
|
|
|
|
|
+// if (userIds.contains(invitedUserId)) {
|
|
|
|
|
+// throw new RuntimeException("邀请的用户已经加入小组!");
|
|
|
|
|
+// }
|
|
|
|
|
+// try {
|
|
|
|
|
+// gitlabApi.addMemberToGroup(groupId, invitedUserId);
|
|
|
|
|
+// } catch (GitLabApiException e) {
|
|
|
|
|
+// throw new RuntimeException("将成员加入Group时发生异常[" + e.getMessage() + "]");
|
|
|
|
|
+// }
|
|
|
|
|
+// groupMemberMapper.insert(groupId,invitedUserId);
|
|
|
|
|
+// //todo
|
|
|
|
|
+// return null;
|
|
|
|
|
+// }
|
|
|
|
|
+//
|
|
|
|
|
+// }
|
|
|
|
|
|
|
|
}
|
|
}
|