14 changed files with 222 additions and 14 deletions
@ -0,0 +1,29 @@ |
|||||
|
package com.epmet.modules.feign; |
||||
|
|
||||
|
import com.epmet.commons.tools.constant.ServiceConstant; |
||||
|
import com.epmet.commons.tools.utils.Result; |
||||
|
import com.epmet.dto.UserResiInfoDTO; |
||||
|
import com.epmet.dto.form.UserResiInfoFormDTO; |
||||
|
import com.epmet.modules.feign.fallback.EpmetUserFeignClientFallback; |
||||
|
import org.springframework.cloud.openfeign.FeignClient; |
||||
|
import org.springframework.http.MediaType; |
||||
|
import org.springframework.web.bind.annotation.PostMapping; |
||||
|
|
||||
|
/** |
||||
|
* @Description epmet_user服务fegin |
||||
|
* @Author yinzuomei |
||||
|
* @Date 2020/3/16 14:48 |
||||
|
*/ |
||||
|
@FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallback = EpmetUserFeignClientFallback.class ) |
||||
|
public interface EpmetUserFeignClient { |
||||
|
|
||||
|
/** |
||||
|
* @param userResiInfoFormDTO |
||||
|
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.UserResiInfoDTO> |
||||
|
* @Author yinzuomei |
||||
|
* @Description 查询用户注册信息 |
||||
|
* @Date 2020/3/30 10:45 |
||||
|
**/ |
||||
|
@PostMapping(value = "epmetuser/userresiinfo/getUserResiInfoDTO", consumes = MediaType.APPLICATION_JSON_VALUE) |
||||
|
Result<UserResiInfoDTO> getUserResiInfoDTO(UserResiInfoFormDTO userResiInfoFormDTO); |
||||
|
} |
@ -0,0 +1,23 @@ |
|||||
|
package com.epmet.modules.feign.fallback; |
||||
|
|
||||
|
import com.epmet.commons.tools.constant.ServiceConstant; |
||||
|
import com.epmet.commons.tools.utils.ModuleUtils; |
||||
|
import com.epmet.commons.tools.utils.Result; |
||||
|
import com.epmet.dto.UserResiInfoDTO; |
||||
|
import com.epmet.dto.form.UserResiInfoFormDTO; |
||||
|
import com.epmet.modules.feign.EpmetUserFeignClient; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
/** |
||||
|
* @Description epmet_user服务fegin |
||||
|
* @Author yinzuomei |
||||
|
* @Date 2020/3/16 14:53 |
||||
|
*/ |
||||
|
@Component |
||||
|
public class EpmetUserFeignClientFallback implements EpmetUserFeignClient { |
||||
|
|
||||
|
@Override |
||||
|
public Result<UserResiInfoDTO> getUserResiInfoDTO(UserResiInfoFormDTO userResiInfoFormDTO) { |
||||
|
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getUserResiInfoDTO", userResiInfoFormDTO); |
||||
|
} |
||||
|
} |
@ -0,0 +1,29 @@ |
|||||
|
package com.epmet.dto.form; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @Description 居民注册信息查询入参DTO |
||||
|
* @Author yinzuomei |
||||
|
* @Date 2020/3/30 10:26 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class UserResiInfoFormDTO implements Serializable { |
||||
|
private static final long serialVersionUID = 2802831913959599147L; |
||||
|
|
||||
|
/** |
||||
|
* 用户当前网格所属客户不能为空 |
||||
|
*/ |
||||
|
@NotBlank(message = "客户id不能为空") |
||||
|
private String customerId; |
||||
|
|
||||
|
/** |
||||
|
* 用户id |
||||
|
*/ |
||||
|
@NotBlank(message="用户id不能为空") |
||||
|
private String userId; |
||||
|
|
||||
|
} |
Loading…
Reference in new issue