fix:访问路径

上级 f1f01f41
......@@ -3,7 +3,6 @@ package com.kwan.springcloudalibaba.controller;
import com.alibaba.csp.sentinel.annotation.SentinelResource;
import com.alibaba.csp.sentinel.slots.block.BlockException;
import com.kwan.springcloudalibaba.common.Result;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
......@@ -20,20 +19,18 @@ import org.springframework.web.bind.annotation.RestController;
@RequestMapping("/sentinel")
public class SentinelController {
@Value("${user.name}")
private String nameInfo;
/**
* 获取配置的变量
* http://localhost:8086/sentinel/nameInfo
*/
@GetMapping(value = "/nameInfo", produces = MediaType.APPLICATION_PROBLEM_JSON_VALUE)
public Result nameInfo() {
return Result.ok(nameInfo);
return Result.ok();
}
/**
* http://localhost:18088/sentinel/world
* http://localhost:8086/sentinel/world
*
* @return
*/
......@@ -43,6 +40,12 @@ public class SentinelController {
return "Hello world";
}
/**
* 回调地址
*
* @param e
* @return
*/
public String helloBlock(BlockException e) {
return "你已被流控";
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册