提交 a97e50bb 编写于 作者: dong.an's avatar dong.an

查询用户信息

上级 9495214a
流水线 #12451 已失败 于阶段
in 0 second
......@@ -3,7 +3,8 @@ package com.pica.cloud.account.account.client;
import com.pica.cloud.account.account.common.req.AccountInfoReq;
import com.pica.cloud.foundation.entity.PicaResponse;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.List;
/**
......@@ -13,10 +14,10 @@ import java.util.List;
@FeignClient(name = "13201-pica-cloud-account")
public interface AccountInfoClient {
@GetMapping("/info/count")
PicaResponse<Integer> getCount(AccountInfoReq req);
@PostMapping("/info/count")
PicaResponse<Integer> getCount(@RequestBody AccountInfoReq req);
@GetMapping("/info/doctorIds")
PicaResponse<List<Integer>> getDoctorIds(AccountInfoReq req);
@PostMapping("/info/doctorIds")
PicaResponse<List<Integer>> getDoctorIds(@RequestBody AccountInfoReq req);
}
......@@ -7,9 +7,7 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.Collections;
import java.util.List;
......@@ -26,20 +24,20 @@ public class AccountInfoController {
private AccountInfoService accountInfoService;
@ApiOperation("获取用户数量")
@GetMapping("/count")
public PicaResponse<Integer> getCount(AccountInfoReq req) {
if (req.getProvinceId() == null && req.getCityId() == null && req.getCountyId() == null
&& CollectionUtils.isEmpty(req.getTitleIds()) && CollectionUtils.isEmpty(req.getLevelGrades())) {
@PostMapping("/count")
public PicaResponse<Integer> getCount(@RequestBody AccountInfoReq req) {
if (req == null || (req.getProvinceId() == null && req.getCityId() == null && req.getCountyId() == null
&& CollectionUtils.isEmpty(req.getTitleIds()) && CollectionUtils.isEmpty(req.getLevelGrades()))) {
return PicaResponse.toResponse(accountInfoService.getTotalCount());
}
return PicaResponse.toResponse(accountInfoService.getCount(req));
}
@ApiOperation("获取医生ID列表")
@GetMapping("/doctorIds")
public PicaResponse<List<Integer>> getDoctorIds(AccountInfoReq req) {
if (req.getProvinceId() == null && req.getCityId() == null && req.getCountyId() == null
&& CollectionUtils.isEmpty(req.getTitleIds()) && CollectionUtils.isEmpty(req.getLevelGrades())) {
@PostMapping("/doctorIds")
public PicaResponse<List<Integer>> getDoctorIds(@RequestBody AccountInfoReq req) {
if (req == null || (req.getProvinceId() == null && req.getCityId() == null && req.getCountyId() == null
&& CollectionUtils.isEmpty(req.getTitleIds()) && CollectionUtils.isEmpty(req.getLevelGrades()))) {
return PicaResponse.toResponse(Collections.emptyList());
}
return PicaResponse.toResponse(accountInfoService.getDoctorIds(req));
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册