| | |
| | | package com.gkhy.fourierSpecialGasMonitor.controller; |
| | | |
| | | import com.gkhy.fourierSpecialGasMonitor.annotation.RepeatedClick; |
| | | import com.gkhy.fourierSpecialGasMonitor.api.controller.common.BaseController; |
| | | import com.gkhy.fourierSpecialGasMonitor.commons.domain.Result; |
| | | import com.gkhy.fourierSpecialGasMonitor.commons.enums.SystemCacheKeyEnum; |
| | | import com.gkhy.fourierSpecialGasMonitor.commons.model.PageQuery; |
| | | import com.gkhy.fourierSpecialGasMonitor.entity.query.FindGasCategoryPageQuery; |
| | | import com.gkhy.fourierSpecialGasMonitor.entity.query.FindRegionPageQuery; |
| | |
| | | @Autowired |
| | | private RedissonClient redissonClient; |
| | | |
| | | /** |
| | | * @decription 新增气体 |
| | | * @author Mr.huang |
| | | */ |
| | | @PostMapping("/add") |
| | | @RepeatedClick |
| | | public Result createGasCategory(@RequestBody CreateGasCategoryReqDTO reqDto){ |
| | | Result result = gasCategoryService.createGasCategory(reqDto); |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * @decription 更新气体 |
| | | * @author Mr.huang |
| | | */ |
| | | @PostMapping("/update") |
| | | @RepeatedClick |
| | | public Result updateGasCategory(@RequestBody UpdateGasCategoryReqDTO reqDto){ |
| | | Result result = gasCategoryService.updateGasCategory(reqDto); |
| | | return result; |
| | |
| | | @PostConstruct |
| | | private void gasCategoryListCache(){ |
| | | //清除redis缓存 |
| | | RBucket<Object> bucket = redissonClient.getBucket("gas_category_cache_info"); |
| | | RBucket<Object> bucket = redissonClient.getBucket(SystemCacheKeyEnum.KEY_GAS_CATEGORY.getKey()); |
| | | if (bucket.isExists()) { |
| | | bucket.delete(); |
| | | } |
| | | this.gasCategoryList(); |
| | | logger.info("【气体对照表】已加入缓存"); |
| | | logger.info("[GasCategoryList] cache complete"); |
| | | } |
| | | |
| | | } |