zhangf
2024-09-11 d4020168658efdee89a633083cd9c14b06c4d863
src/main/java/com/gkhy/fourierSpecialGasMonitor/controller/GasCategoryController.java
@@ -1,7 +1,9 @@
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;
@@ -30,13 +32,23 @@
    @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;
@@ -64,12 +76,12 @@
    @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");
    }
}