24 lines
698 B
Java
24 lines
698 B
Java
package cn.hezhaohui.serviceconsumer.controller;
|
|
|
|
import cn.hezhaohui.serviceconsumer.client.ServiceProducerClient;
|
|
import jakarta.annotation.Resource;
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
import org.springframework.web.client.RestTemplate;
|
|
|
|
@RestController
|
|
@RequestMapping("/api")
|
|
public class ConsumeController {
|
|
|
|
@Resource
|
|
private ServiceProducerClient serviceProducerClient;
|
|
|
|
@GetMapping("/print")
|
|
public String print() {
|
|
String number = serviceProducerClient.getNumber();
|
|
return "[Generate]: " + number;
|
|
}
|
|
|
|
}
|