CompanyRest.java 521 B

1234567891011121314151617
  1. package cn.hhj.controller;
  2. import cn.hhj.vo.Company;
  3. import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
  4. import org.springframework.web.bind.annotation.*;
  5. @RestController
  6. public class CompanyRest {
  7. @GetMapping("/company/get/{title}")
  8. @HystrixCommand // 如果需要进行性能监控,那么必须要有此注解
  9. public Object get(@PathVariable("title") String title) {
  10. Company vo = new Company() ;
  11. vo.setTitle(title);
  12. vo.setNote("www.hhj.cn");
  13. return vo ;
  14. }
  15. }