9 changed files with 135 additions and 5 deletions
@ -0,0 +1,41 @@ |
|||||
|
package com.elink.esua.epdc.feign; |
||||
|
|
||||
|
import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; |
||||
|
import com.elink.esua.epdc.commons.tools.utils.Result; |
||||
|
import com.elink.esua.epdc.dto.*; |
||||
|
import com.elink.esua.epdc.dto.epdc.GridLeaderRegisterDTO; |
||||
|
import com.elink.esua.epdc.dto.epdc.result.EpdcAppIndexPanelResultDTO; |
||||
|
import com.elink.esua.epdc.feign.fallback.AdminFeignClientFallback; |
||||
|
import com.elink.esua.epdc.feign.fallback.MasterGroupFeignClientFallback; |
||||
|
import org.springframework.cloud.openfeign.FeignClient; |
||||
|
import org.springframework.http.MediaType; |
||||
|
import org.springframework.web.bind.annotation.GetMapping; |
||||
|
import org.springframework.web.bind.annotation.PathVariable; |
||||
|
import org.springframework.web.bind.annotation.PostMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestParam; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 管理端接口 |
||||
|
* |
||||
|
* @author yujintao |
||||
|
* @email yujintao@elink-cn.com |
||||
|
* @date 2019/9/7 9:27 |
||||
|
*/ |
||||
|
@FeignClient(name = ServiceConstant.EPDC_CLOUD_ANALYSIS_SERVER, fallback = MasterGroupFeignClientFallback.class) |
||||
|
public interface MasterGroupFeignClient { |
||||
|
|
||||
|
/** |
||||
|
* 获取消息数 |
||||
|
* |
||||
|
* @param userId |
||||
|
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.lang.Integer> |
||||
|
* @author lipf |
||||
|
* @date 2020/5/7 9:40 |
||||
|
*/ |
||||
|
@GetMapping("cloudAnalysis/messageStatistics/{userId}") |
||||
|
Result<Integer> messageStatistics(@PathVariable("userId") Long userId); |
||||
|
|
||||
|
} |
@ -0,0 +1,28 @@ |
|||||
|
package com.elink.esua.epdc.feign.fallback; |
||||
|
|
||||
|
import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; |
||||
|
import com.elink.esua.epdc.commons.tools.utils.ModuleUtils; |
||||
|
import com.elink.esua.epdc.commons.tools.utils.Result; |
||||
|
import com.elink.esua.epdc.dto.*; |
||||
|
import com.elink.esua.epdc.dto.epdc.GridLeaderRegisterDTO; |
||||
|
import com.elink.esua.epdc.dto.epdc.result.EpdcAppIndexPanelResultDTO; |
||||
|
import com.elink.esua.epdc.feign.AdminFeignClient; |
||||
|
import com.elink.esua.epdc.feign.MasterGroupFeignClient; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* @author yujintao |
||||
|
* @email yujintao@elink-cn.com |
||||
|
* @date 2019/9/7 9:30 |
||||
|
*/ |
||||
|
@Component |
||||
|
public class MasterGroupFeignClientFallback implements MasterGroupFeignClient { |
||||
|
|
||||
|
@Override |
||||
|
public Result<Integer> messageStatistics(Long userId) { |
||||
|
return ModuleUtils.feignConError(ServiceConstant.EPDC_CLOUD_ANALYSIS_SERVER, "messageStatistics", userId); |
||||
|
} |
||||
|
} |
@ -0,0 +1,22 @@ |
|||||
|
package com.elink.esua.epdc.service; |
||||
|
|
||||
|
import com.elink.esua.epdc.commons.tools.utils.Result; |
||||
|
|
||||
|
/** |
||||
|
* 书记在线相关接口 |
||||
|
* |
||||
|
* @author lipf |
||||
|
* @date 2020/5/7 9:40 |
||||
|
*/ |
||||
|
public interface MasterGroupService { |
||||
|
|
||||
|
/** |
||||
|
* 获取消息数 |
||||
|
* |
||||
|
* @param userId |
||||
|
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.lang.Integer> |
||||
|
* @author lipf |
||||
|
* @date 2020/5/7 9:40 |
||||
|
*/ |
||||
|
Result<Integer> messageStatistics(Long userId); |
||||
|
} |
@ -0,0 +1,26 @@ |
|||||
|
package com.elink.esua.epdc.service.impl; |
||||
|
|
||||
|
import com.elink.esua.epdc.commons.tools.utils.Result; |
||||
|
|
||||
|
import com.elink.esua.epdc.feign.MasterGroupFeignClient; |
||||
|
import com.elink.esua.epdc.service.MasterGroupService; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
/** |
||||
|
* @author lipf |
||||
|
* @date 2020/5/7 9:40 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class MasterGroupServiceImpl implements MasterGroupService { |
||||
|
|
||||
|
|
||||
|
@Autowired |
||||
|
private MasterGroupFeignClient masterGroupFeignClient; |
||||
|
|
||||
|
@Override |
||||
|
public Result<Integer> messageStatistics(Long userId) { |
||||
|
Result<Integer> messageResult = masterGroupFeignClient.messageStatistics(userId); |
||||
|
return messageResult; |
||||
|
} |
||||
|
} |
@ -1,4 +1,4 @@ |
|||||
nacos: |
nacos: |
||||
config: |
config: |
||||
server-addr: 47.104.224.45:8848 |
server-addr: 47.104.224.45:8848 |
||||
namespace: 6a3577b4-7b79-43f6-aebb-9c3f31263f6a |
namespace: a746dde3-7a13-4521-b986-7369b0b7c269 |
||||
|
Loading…
Reference in new issue