|
@@ -1,14 +1,19 @@
|
|
|
package com.chelvc.cloud.admin.controller;
|
|
|
+import com.chelvc.cloud.uc.api.model.Scope;
|
|
|
import com.chelvc.cloud.vehicle.api.dto.TeamDTO;
|
|
|
import com.chelvc.cloud.vehicle.api.param.TeamInvitePageParam;
|
|
|
import com.chelvc.cloud.vehicle.api.service.UserInviteService;
|
|
|
import com.chelvc.framework.base.annotation.ResponseWrapping;
|
|
|
+import com.chelvc.framework.base.context.SessionContextHolder;
|
|
|
+import com.chelvc.framework.common.util.ObjectUtils;
|
|
|
+import com.chelvc.framework.common.util.StringUtils;
|
|
|
import org.apache.dubbo.config.annotation.DubboReference;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import javax.validation.Valid;
|
|
|
+import java.util.List;
|
|
|
|
|
|
/**
|
|
|
* 用户分销接口
|
|
@@ -31,6 +36,12 @@ public class InviteUserController {
|
|
|
*/
|
|
|
@GetMapping("/userInvite/paging")
|
|
|
public TeamDTO getUserInvitePaging(@Valid TeamInvitePageParam param) {
|
|
|
- return this.userInviteService.inviteList(param);
|
|
|
+ Long userId = SessionContextHolder.getId();
|
|
|
+ Scope scope = StringUtils.ifEmpty(SessionContextHolder.getScope(), Scope::parse);
|
|
|
+ if (scope == Scope.ADMIN) {
|
|
|
+ return this.userInviteService.inviteList(param);
|
|
|
+ }else {
|
|
|
+ return this.userInviteService.teamList(param,userId);
|
|
|
+ }
|
|
|
}
|
|
|
}
|