Update: T04/搭建service-producer模块 [2]
This commit is contained in:
+18
@@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user