13 changed files with 152 additions and 33 deletions
@ -0,0 +1,37 @@ |
|||
package com.elink.esua.epdc.controller; |
|||
|
|||
import com.elink.esua.epdc.common.token.dto.TokenDto; |
|||
import com.elink.esua.epdc.commons.tools.annotation.LoginUser; |
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.service.AnalysisItemService; |
|||
import com.elink.esua.epdc.service.AnalysisUserService; |
|||
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; |
|||
|
|||
/** |
|||
* 移动端接口-数据分析模块(项目) |
|||
* @Author LPF |
|||
* @Date 2019/11/18 13:32 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("analysis/user") |
|||
public class ApiAnalysisUserController { |
|||
|
|||
@Autowired |
|||
private AnalysisUserService analysisUserService; |
|||
|
|||
|
|||
/** |
|||
* 测试demo |
|||
|
|||
* @Return: com.elink.esua.epdc.commons.tools.utils.Result<> |
|||
* @Author: lipengfei |
|||
* @Date: 2019/11/19 16:34 |
|||
*/ |
|||
@GetMapping("test") |
|||
public Result test(@LoginUser TokenDto tokenDto) { |
|||
return analysisUserService.test(); |
|||
} |
|||
} |
|||
@ -0,0 +1,33 @@ |
|||
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.config.FeignRequestInterceptor; |
|||
import com.elink.esua.epdc.feign.fallback.AnalysisIssueFeignClientFallback; |
|||
import com.elink.esua.epdc.feign.fallback.AnalysisUserFeignClientFallback; |
|||
import org.springframework.cloud.openfeign.FeignClient; |
|||
import org.springframework.http.MediaType; |
|||
import org.springframework.web.bind.annotation.GetMapping; |
|||
|
|||
/** |
|||
* 评价模块调用-移动app端 |
|||
* @Author LPF |
|||
* @Date 2019/11/18 16:39 |
|||
*/ |
|||
@FeignClient(name = ServiceConstant.EPDC_ANALYSIS_SERVER, fallback = AnalysisUserFeignClientFallback.class, configuration = FeignRequestInterceptor.class) |
|||
public interface AnalysisUserFeignClient { |
|||
|
|||
|
|||
|
|||
/** |
|||
* 测试 |
|||
* @Return: com.elink.esua.epdc.commons.tools.utils.Result |
|||
* @Author: lipengfei |
|||
* @Date: 2019/11/19 16:42 |
|||
*/ |
|||
@GetMapping(value = "analysis/user/test", consumes = MediaType.APPLICATION_JSON_VALUE) |
|||
Result test(); |
|||
|
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,23 @@ |
|||
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.feign.AnalysisIssueFeignClient; |
|||
import com.elink.esua.epdc.feign.AnalysisUserFeignClient; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
/** |
|||
* @Author LPF |
|||
* @Date 2019/11/18 16:39 |
|||
*/ |
|||
@Component |
|||
public class AnalysisUserFeignClientFallback implements AnalysisUserFeignClient { |
|||
|
|||
|
|||
@Override |
|||
public Result test() { |
|||
return ModuleUtils.feignConError(ServiceConstant.EPDC_ANALYSIS_SERVER, "test"); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,22 @@ |
|||
package com.elink.esua.epdc.service; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
|
|||
/** |
|||
* 项目模块-数据分析移动端 |
|||
* @Author LPF |
|||
* @Date 2019/11/18 13:34 |
|||
*/ |
|||
public interface AnalysisUserService { |
|||
|
|||
|
|||
/** |
|||
* 测试模块 |
|||
* @Return: com.elink.esua.epdc.commons.tools.utils.Result<> |
|||
* @Author: lipengfei |
|||
* @Date: 2019/11/19 16:37 |
|||
*/ |
|||
Result test(); |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,29 @@ |
|||
package com.elink.esua.epdc.service.impl; |
|||
|
|||
|
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.feign.AnalysisIssueFeignClient; |
|||
import com.elink.esua.epdc.feign.AnalysisUserFeignClient; |
|||
import com.elink.esua.epdc.service.AnalysisIssueService; |
|||
import com.elink.esua.epdc.service.AnalysisUserService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
/** |
|||
* 项目模块-移动app端 |
|||
* @Author LPF |
|||
* @Date 2019/11/18 16:34 |
|||
*/ |
|||
@Service |
|||
public class AnalysisUserServiceImpl implements AnalysisUserService { |
|||
|
|||
@Autowired |
|||
private AnalysisUserFeignClient analysisUserFeignClient; |
|||
|
|||
|
|||
|
|||
@Override |
|||
public Result test() { |
|||
return analysisUserFeignClient.test(); |
|||
} |
|||
} |
|||
Loading…
Reference in new issue