package com.qiwuai.garden.controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RestController; @RestController @RequestMapping("/garden") public class GardenController { @RequestMapping(value = "/stolen", method = RequestMethod.GET) public String steal() { return "偷菜成功"; } @RequestMapping(value = "/BeHarvested", method = RequestMethod.GET) public String harvest() { System.out.println("有人来帮忙收获了"); return "收获成功"; } }