forked from rongchao/epmet-cloud-rizhao
15 changed files with 262 additions and 11 deletions
@ -0,0 +1,26 @@ |
|||||
|
package com.epmet.feign; |
||||
|
|
||||
|
import com.epmet.commons.tools.constant.ServiceConstant; |
||||
|
import com.epmet.commons.tools.utils.Result; |
||||
|
import com.epmet.dto.form.ThirdPlatformFormDTO; |
||||
|
import com.epmet.feign.fallback.ThirdOpenFeignClientFallback; |
||||
|
import org.springframework.cloud.openfeign.FeignClient; |
||||
|
import org.springframework.web.bind.annotation.PostMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestBody; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
//@FeignClient(name = ServiceConstant.EPMET_THIRD_SERVER, fallback = ThirdOpenFeignClientFallback.class)
|
||||
|
@FeignClient(name = ServiceConstant.EPMET_THIRD_SERVER, fallback = ThirdOpenFeignClientFallback.class, url = "http://localhost:8110") |
||||
|
public interface ThirdOpenFeignClient { |
||||
|
|
||||
|
/** |
||||
|
* @Description 保存或修改客户选中的第三方平台信息 |
||||
|
* @return |
||||
|
* @author wxz |
||||
|
* @date 2021.03.19 15:25 |
||||
|
*/ |
||||
|
@PostMapping("/third/thirdplatform/customer/saveorupdate-selected-platforms") |
||||
|
Result saveOrUpdateSelectedPlatformsInfo(@RequestBody List<ThirdPlatformFormDTO> input); |
||||
|
|
||||
|
} |
@ -0,0 +1,18 @@ |
|||||
|
package com.epmet.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.form.ThirdPlatformFormDTO; |
||||
|
import com.epmet.feign.ThirdOpenFeignClient; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
@Component |
||||
|
public class ThirdOpenFeignClientFallback implements ThirdOpenFeignClient { |
||||
|
@Override |
||||
|
public Result saveOrUpdateSelectedPlatformsInfo(List<ThirdPlatformFormDTO> input) { |
||||
|
return ModuleUtils.feignConError(ServiceConstant.EPMET_THIRD_SERVER, "saveOrUpdateSelectedPlatformsInfo", input); |
||||
|
} |
||||
|
} |
@ -0,0 +1,30 @@ |
|||||
|
package com.epmet.dto.form; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
import javax.validation.constraints.NotEmpty; |
||||
|
import java.util.List; |
||||
|
|
||||
|
@Data |
||||
|
public class ThirdPlatformConfigFormDTO { |
||||
|
|
||||
|
public interface SaveThirdplatformConfig { |
||||
|
} |
||||
|
|
||||
|
@NotBlank(message = "客户ID不能为空", groups = {SaveThirdplatformConfig.class}) |
||||
|
private String customerId; |
||||
|
|
||||
|
@NotBlank(message = "项目协助发送开关状态不能为空", groups = {SaveThirdplatformConfig.class}) |
||||
|
private String sendProjectSwitch; |
||||
|
|
||||
|
private List<CustomerSelectedPlatform> customerSelectedPlatformList; |
||||
|
|
||||
|
@Data |
||||
|
public static class CustomerSelectedPlatform { |
||||
|
private String customerId; |
||||
|
private String platformId; |
||||
|
private String platformName; |
||||
|
private String icon; |
||||
|
} |
||||
|
} |
Loading…
Reference in new issue