package com.xkrs.controller; import com.xkrs.common.encapsulation.PromptMessageEnum; import com.xkrs.model.entity.Fire; import com.xkrs.service.FireService; import com.xkrs.util.Query; import org.springframework.cache.annotation.Cacheable; import org.springframework.context.i18n.LocaleContextHolder; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; import java.util.List; import java.util.Locale; import static com.xkrs.common.encapsulation.OutputEncapsulation.outputEncapsulationObject; /** * @Author: XinYi Song * @Date: 2022/2/11 9:03 */ @RestController public class FireController { @Resource private FireService fireService; /** * 根据设备编号获取火情信息 * @param code * @return */ @GetMapping("/getFireInformation") public String getFireInformation(@RequestParam("code") String code){ return fireService.getFireInformation(code); } /** * 根据设备编码和时间段查询火情信息 * @param code * @param startTime * @param endTime * @return */ @GetMapping("/selectFireBetweenTime") public String selectFireBetweenTime(@RequestParam("code") String code, @RequestParam("startTime") String startTime, @RequestParam("endTime") String endTime){ return fireService.selectFireBetweenTime(code,startTime,endTime); } /** * 查询最新的300条火情信息 * @return */ @GetMapping("/findThreeHundredData") public String findThreeHundredData(){ return fireService.findThreeHundredData(); } }