Browse Source

operaccess模块feign测试提交

dev_shibei_match
yinzuomei 6 years ago
parent
commit
d1dea07a71
  1. 10
      epmet-module/oper-access/oper-access-server/src/main/java/com/epmet/controller/OperMenuController.java
  2. 2
      epmet-module/oper-access/oper-access-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java

10
epmet-module/oper-access/oper-access-server/src/main/java/com/epmet/controller/OperMenuController.java

@ -9,8 +9,10 @@ import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.dto.OperMenuDTO; import com.epmet.dto.OperMenuDTO;
import com.epmet.dto.OperUserDTO;
import com.epmet.dto.form.UserInfoDto; import com.epmet.dto.form.UserInfoDto;
import com.epmet.excel.OperMenuExcel; import com.epmet.excel.OperMenuExcel;
import com.epmet.feign.EpmetUserFeignClient;
import com.epmet.service.OperMenuService; import com.epmet.service.OperMenuService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -98,4 +100,12 @@ public class OperMenuController {
Set<String> set = operMenuService.getUserPermissions(userInfo); Set<String> set = operMenuService.getUserPermissions(userInfo);
return new Result<Set<String>>().ok(set); return new Result<Set<String>>().ok(set);
} }
@Autowired
private EpmetUserFeignClient epmetUserFeignClient;
@GetMapping("test")
public Result<OperUserDTO> test(){
System.out.println("==============================================");
return epmetUserFeignClient.info("1");
}
} }

2
epmet-module/oper-access/oper-access-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java

@ -12,7 +12,7 @@ import org.springframework.web.bind.annotation.*;
* @dscription * @dscription
* @date 2020/3/19 9:32 * @date 2020/3/19 9:32
*/ */
@FeignClient(name = ServiceConstant.EPMET_USER_SERVER, path="/epmetuser", fallback = EpmetUserFeignClientFallback.class) @FeignClient(name = ServiceConstant.EPMET_USER_SERVER, path="/epmetuser", fallback = EpmetUserFeignClientFallback.class,url = "http://localhost:8087")
public interface EpmetUserFeignClient { public interface EpmetUserFeignClient {
/** /**

Loading…
Cancel
Save