|
|
|
|
@ -28,6 +28,7 @@ import org.springframework.data.redis.core.RedisTemplate;
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
|
|
import java.util.*;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* SSO服务端控制器
|
|
|
|
|
@ -360,4 +361,21 @@ public class SsoServerController {
|
|
|
|
|
return SaResult.error("用户不存在");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@GetMapping("/sso/listUsers")
|
|
|
|
|
public SaResult listUsers() {
|
|
|
|
|
List<User> users = userService.lambdaQuery()
|
|
|
|
|
.select(User::getId, User::getAccount)
|
|
|
|
|
.eq(User::getIsDeleted, 0)
|
|
|
|
|
.list();
|
|
|
|
|
List<Map<String, String>> records = users.stream()
|
|
|
|
|
.map(user -> {
|
|
|
|
|
Map<String, String> record = new HashMap<>(2);
|
|
|
|
|
record.put("id", user.getId() == null ? null : String.valueOf(user.getId()));
|
|
|
|
|
record.put("account", user.getAccount());
|
|
|
|
|
return record;
|
|
|
|
|
})
|
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
return SaResult.ok().setData(records);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|