package com.hxzk.controller; import com.hxzk.pojo.TbMap; import com.hxzk.service.MapService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import java.text.SimpleDateFormat; import java.util.Date; import java.util.List; @RestController @RequestMapping("/") public class MapController { @Autowired MapService mapService; @PostMapping("qiehuanditu_option.do") public List findmap(){ return mapService.findAll(); } @PostMapping("findFloorMap") public TbMap findFloorMap(String floor){ return mapService.findFloorMap(floor); } public String gettime(){ Date now = new Date(); // 创建日期格式化对象,设置格式为 "yyyy-MM-dd HH:mm" SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm"); // 格式化日期对象,输出字符串结果 String formattedDate = sdf.format(now); return formattedDate; } }