Commit 137b35a2 by 刘宇峰

用户组织feign开放接口

1 parent f678472c
......@@ -4,6 +4,7 @@ import cn.com.glsx.usercenter.api.dto.response.User;
import cn.com.glsx.usercenter.api.feign.factory.UserServiceFallbackFactory;
import com.glsx.plat.core.web.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
......@@ -18,10 +19,10 @@ import java.util.List;
)
public interface ApiUserService {
@GetMapping(value = "/findByAccount")
@GetMapping(value = "/findByAccount", consumes = MediaType.APPLICATION_JSON_VALUE)
R<List<User>> findByAccount(@RequestParam("account") String account);
@GetMapping(value = "/findByUsername")
@GetMapping(value = "/findByUsername", consumes = MediaType.APPLICATION_JSON_VALUE)
R<List<User>> findByUsername(@RequestParam("username") String username);
}
......@@ -4,6 +4,7 @@ import cn.com.glsx.usercenter.api.dto.response.Organization;
import cn.com.glsx.usercenter.api.feign.factory.OrganizationServiceFallbackFactory;
import com.glsx.plat.core.web.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
......@@ -25,18 +26,16 @@ public interface OrganizationService {
* @param userId
* @return
*/
@GetMapping(value = "/getTenantPathsByUserId")
@GetMapping(value = "/getTenantPathsByUserId", consumes = MediaType.APPLICATION_JSON_VALUE)
R<List<Organization>> getTenantPathsByUserId(@RequestParam("userId") Long userId);
/**
* 根据userIds获取租户机构
*
* @param userIds
* @return
*/
@GetMapping(value = "/getTenantByUserIds")
@GetMapping(value = "/getTenantByUserIds", consumes = MediaType.APPLICATION_JSON_VALUE)
R<List<Organization>> getTenantByUserIds(@RequestParam("userIds") List<Long> userIds);
......@@ -45,7 +44,7 @@ public interface OrganizationService {
*
* @return
*/
@GetMapping(value = "/getRootOrgs")
@GetMapping(value = "/getRootOrgs", consumes = MediaType.APPLICATION_JSON_VALUE)
R<List<Organization>> getRootOrganizations();
/**
......@@ -54,7 +53,7 @@ public interface OrganizationService {
* @param orgId
* @return
*/
@GetMapping(value = "/getSubOrgsBySuperiorId")
@GetMapping(value = "/getSubOrgsBySuperiorId", consumes = MediaType.APPLICATION_JSON_VALUE)
R<List<Organization>> getSubOrganizations(@RequestParam("orgId") Long orgId);
/**
......@@ -63,7 +62,7 @@ public interface OrganizationService {
* @param userIds
* @return
*/
@GetMapping(value = "/getOrgsByUserIds")
@GetMapping(value = "/getOrgsByUserIds", consumes = MediaType.APPLICATION_JSON_VALUE)
R<List<Organization>> getOrgsByUserIds(@RequestParam("userIds") Collection<Long> userIds);
/**
......@@ -72,7 +71,7 @@ public interface OrganizationService {
* @param level
* @return
*/
@GetMapping(value = "/getSpecialLevelOrgs")
@GetMapping(value = "/getSpecialLevelOrgs", consumes = MediaType.APPLICATION_JSON_VALUE)
R<List<Organization>> getSpecialLevelOrganizations(@RequestParam("level") Integer level);
}
......@@ -5,6 +5,7 @@ import cn.com.glsx.usercenter.api.dto.response.User;
import cn.com.glsx.usercenter.api.feign.factory.UserServiceFallbackFactory;
import com.glsx.plat.core.web.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
......@@ -19,19 +20,19 @@ import java.util.List;
)
public interface UserService {
@GetMapping(value = "/findAll")
@GetMapping(value = "/findAll", consumes = MediaType.APPLICATION_JSON_VALUE)
R<List<User>> findAll();
@GetMapping(value = "/getById")
@GetMapping(value = "/getById", consumes = MediaType.APPLICATION_JSON_VALUE)
R<User> getById(@RequestParam("id") Long id);
@GetMapping(value = "/findByUser")
@GetMapping(value = "/findByUser", consumes = MediaType.APPLICATION_JSON_VALUE)
R<List<User>> findByUser(FindUserRequest request);
@GetMapping(value = "/findByOrg")
@GetMapping(value = "/findByOrg", consumes = MediaType.APPLICATION_JSON_VALUE)
R<List<User>> findByOrg(FindUserRequest request);
@GetMapping(value = "/findAllByOrg")
public R<List<User>> findAllByOrg(FindUserRequest request);
@GetMapping(value = "/findAllByOrg", consumes = MediaType.APPLICATION_JSON_VALUE)
R<List<User>> findAllByOrg(FindUserRequest request);
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!