Commit 0218ab2c by levphon

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

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