1996fanrui commented on code in PR #1792:
URL:
https://github.com/apache/incubator-streampark/pull/1792#discussion_r991821489
##########
streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/service/impl/UserServiceImpl.java:
##########
@@ -177,12 +184,35 @@ public List<User> getNoTokenUser() {
return users;
}
+ @Override
+ public void setLatestTeam(Long teamId, Long userId) {
+ User user = getById(userId);
+ AssertUtils.checkArgument(user != null);
+ user.setTeamId(teamId);
+ this.baseMapper.updateById(user);
+ }
+
+ @Override
+ public void checkTeam(User user) {
+ if (user.getTeamId() == null) {
+ List<Team> teams = memberService.findUserTeams(user.getUserId());
+ if (CollectionUtils.isEmpty(teams)) {
+ throw new ApiException("There is no team to assign, please
contact the administrator!");
Review Comment:
Checked, it's done.
##########
streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/service/UserService.java:
##########
@@ -106,4 +106,8 @@ public interface UserService extends IService<User> {
Set<String> getPermissions(String username);
List<User> getNoTokenUser();
+
+ void setLatestTeam(Long teamId, Long userId);
+
+ void checkTeam(User user);
Review Comment:
Checked, it's done.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]