| | |
| | | import com.gkhy.fourierSpecialGasMonitor.entity.req.UploadGasConcentrationReqDTO; |
| | | import com.gkhy.fourierSpecialGasMonitor.entity.req.UploadGasFluxReqDTO; |
| | | import com.gkhy.fourierSpecialGasMonitor.service.DataReceiveService; |
| | | import org.redisson.api.RBucket; |
| | | import org.redisson.api.RedissonClient; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.PostConstruct; |
| | | import javax.annotation.Resource; |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | |
| | | /** |
| | | * @author Mr.huang |
| | |
| | | |
| | | @Autowired |
| | | private DataReceiveService dataReceiveService; |
| | | private final Logger logger = LoggerFactory.getLogger(this.getClass()); |
| | | |
| | | //@PostConstruct |
| | | //private void clearGasConcentrationCache(){ |
| | | // LocalDateTime time = LocalDateTime.now(); |
| | | // String cacheName = time.format(formatter); |
| | | // //清除redis缓存 |
| | | // RBucket<Object> bucket = redissonClient.getBucket(gasConcentrationCachePrefix+cacheName); |
| | | // if (bucket.isExists()) { |
| | | // bucket.delete(); |
| | | // } |
| | | //} |
| | | |
| | | @PostMapping("/upload/gasConcentration") |
| | | public ForeignResult uploadGasConcentration(@RequestBody UploadGasConcentrationReqDTO reqDto){ |
| | |
| | | |
| | | @PostMapping("/upload/gasFlux") |
| | | public ForeignResult uploadGasFlux(@RequestBody UploadGasFluxReqDTO reqDto){ |
| | | ForeignResult result = dataReceiveService.uploadGasFlux(reqDto); |
| | | UploadGasFluxReqDTO uploadGasFluxReqDTO = reqDto.expansionFactor(); |
| | | ForeignResult result = dataReceiveService.uploadGasFlux(uploadGasFluxReqDTO); |
| | | return result; |
| | | } |
| | | |