diff --git a/service-producer/src/main/java/cn/hezhaohui/serviceproducer/controller/ProduceController.java b/service-producer/src/main/java/cn/hezhaohui/serviceproducer/controller/ProduceController.java new file mode 100644 index 0000000..9bcec18 --- /dev/null +++ b/service-producer/src/main/java/cn/hezhaohui/serviceproducer/controller/ProduceController.java @@ -0,0 +1,18 @@ +package cn.hezhaohui.serviceproducer.controller; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.Random; + +@RestController +@RequestMapping("/api") +public class ProduceController { + + @GetMapping("/number") + public int getNum() { + Random random = new Random(); + return random.nextInt(101); + } +}