zhuguifei
2025-04-28 442928123f63ee497d766f9a7a14f0a6ee067e25
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package org.jeecg.modules.demo.cloud.controller;
 
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.api.ISysBaseAPI;
import org.jeecg.common.system.vo.DictModel;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
import javax.annotation.Resource;
import java.util.List;
 
/**
 *
 */
@Slf4j
@Api(tags = "Cloud示例")
@RestController
@RequestMapping("/test")
public class JcloudDemoController {
 
 
    @Resource
    private ISysBaseAPI sysBaseAPI;
 
    /**
     * 测试
     *
     * @return
     */
    @GetMapping("/remote")
    @ApiOperation(value = "测试feign", notes = "测试feign")
    public Result remoteDict() {
//        try{
//            //睡5秒,网关Hystrix3秒超时,会触发熔断降级操作
//            Thread.sleep(5000);
//        }catch (Exception e){
//            e.printStackTrace();
//        }
        List<DictModel> list = sysBaseAPI.queryAllDict();
        return Result.OK(list);
    }
 
 
}