Commit 0218ab2c by levphon

新增获取用户可见账号id接口

1 parent 25594e86
......@@ -13,6 +13,7 @@ import org.springframework.web.bind.annotation.RequestParam;
import java.util.Collection;
import java.util.List;
import java.util.Set;
@FeignClient(
name = "${feign.usercenter.name}",
......@@ -46,8 +47,8 @@ public interface UserService {
* @param id
* @return
*/
@GetMapping(value = "/getSuperiorUserById", consumes = MediaType.APPLICATION_JSON_VALUE)
R<User> getSuperiorUserById(@RequestParam("id") Long id);
@GetMapping(value = "/getSuperiorById", consumes = MediaType.APPLICATION_JSON_VALUE)
R<User> getSuperiorById(@RequestParam("id") Long id);
/**
* 根据id获取上级用户信息
......@@ -55,8 +56,17 @@ public interface UserService {
* @param userIds
* @return
*/
@PostMapping(value = "/getSuperiorUserByIds", consumes = MediaType.APPLICATION_JSON_VALUE)
R<List<User>> getSuperiorUserByIds(@RequestBody Collection<Long> userIds);
@PostMapping(value = "/getSuperiorByIds", consumes = MediaType.APPLICATION_JSON_VALUE)
R<List<User>> getSuperiorByIds(@RequestBody Collection<Long> userIds);
/**
* 获取下级(含自己)用户列表
*
* @param userId
* @return
*/
@GetMapping(value = "/getSubordinateById", consumes = MediaType.APPLICATION_JSON_VALUE)
public R<Set<Long>> getSubordinateById(@RequestParam("id") Long userId);
/**
* 根据用户信息查询用户
......
......@@ -10,6 +10,7 @@ import org.springframework.stereotype.Component;
import java.util.Collection;
import java.util.List;
import java.util.Set;
@Slf4j
@Component
......@@ -31,13 +32,19 @@ public class UserServiceFallbackImpl implements UserService {
}
@Override
public R<User> getSuperiorUserById(Long id) {
public R<User> getSuperiorById(Long id) {
log.warn("熔断啦 {}", cause.getMessage());
return R.ok();
}
@Override
public R<List<User>> getSuperiorUserByIds(Collection<Long> userIds) {
public R<List<User>> getSuperiorByIds(Collection<Long> userIds) {
log.warn("熔断啦 {}", cause.getMessage());
return R.ok();
}
@Override
public R<Set<Long>> getSubordinateById(Long userId) {
log.warn("熔断啦 {}", cause.getMessage());
return R.ok();
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!