package com.hxzk.controller; import com.github.pagehelper.PageInfo; import com.hxzk.pojo.TbAchor; import com.hxzk.pojo.TbRealinwarning; import com.hxzk.pojo.TbRtkanchor; import com.hxzk.service.RealinWarningService; import com.hxzk.service.RtkService; import com.hxzk.util.result; import com.hxzk.util.resultutil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; 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 RealinWarningController { @Autowired RealinWarningService realinWarningService; //实时告警 @GetMapping("findshishigaojing") result> findshishigaojing(Integer page, Integer limit){ PageInfo cz= realinWarningService.findAll(page, limit); return resultutil.returnSuccess(cz.getTotal(), cz.getList()); } @PostMapping("findtableShiShiGaoJing") result> findanchorSearch(Integer page, Integer limit, TbRealinwarning realinwarning){ PageInfo cz= realinWarningService.findSearch(page, limit,realinwarning); return resultutil.returnSuccess(cz.getTotal(), cz.getList()); } 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; } }