package com.qiwuai.garden.controller; import com.qiwuai.garden.dto.request.PlantConfigReq; import com.qiwuai.garden.dto.request.PlantPeriodConfigReq; import com.qiwuai.garden.pojo.PlantPeriodPojo; import com.qiwuai.garden.pojo.PlantPojo; import com.qiwuai.garden.service.plantService.PlantService; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.util.List; @Slf4j @RestController @RequestMapping("/config") public class GameConfigController { @Autowired private PlantService plantService; @GetMapping("/plant/search") public List PlantSearch(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) { System.out.println("开始查询植物配置信息"); return plantService.plantSearch(); } @PostMapping(value ="/plant/add", produces = "application/json;charset=UTF-8") public int plantAdd(@RequestBody PlantConfigReq plantConfigReq, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) { System.out.println("开始新增植物配置信息"); return plantService.plantAdd(plantConfigReq); } @PostMapping(value ="/plantPeriod/search", produces = "application/json;charset=UTF-8") public List plantPeriodSearch(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) { System.out.println("开始查询植物配置信息"); return plantService.plantPeriodSearch(); } @PostMapping(value ="/plantPeriod/add", produces = "application/json;charset=UTF-8") public int plantPeriodAdd(@RequestBody PlantPeriodConfigReq plantPeriodConfigReq, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) { System.out.println("开始新增植物配置信息"); return plantService.plantPeriodAdd(plantPeriodConfigReq); } }