Authored by yangchangjiang

分支合并Merge branch 'dev_191129' into test6.9.17

package com.yohoufo.order.controller;
import com.yoho.core.rest.annotation.ServiceDesc;
import com.yohoufo.common.ApiResponse;
import com.yohoufo.common.annotation.IgnoreSession;
import com.yohoufo.common.annotation.IgnoreSignature;
import com.yohoufo.order.service.impl.MetaConfigService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
/**
* @Author: 杨长江
* @Date: 2019-12-06 10:46
* @Description: 说明
*/
@RestController
@ServiceDesc("orderMetaConfig")
public class MetaConfigController {
private final Logger logger = LoggerFactory.getLogger(MetaConfigController.class);
@Autowired
private MetaConfigService metaConfigService;
/**
* 根据code清除redis缓存
* @param code
* @return
*/
@IgnoreSession
@IgnoreSignature
@RequestMapping("/orderMetaConfig/cleanCacheByCode/")
@ResponseBody
public ApiResponse cleanCacheByCode(String code){
logger.info("clean metaConfig cache by code :{}",code);
metaConfigService.clearCacheByCode(code);
return new ApiResponse.ApiResponseBuilder().code(200).build();
}
}
... ...
... ... @@ -431,4 +431,57 @@ public class MetaConfigService {
return bpfMap;
}
/**
* 根据code清除配置缓存
* @param code
*/
public void clearCacheByCode(String code){
switch (code){
case "buyer_penalty":
cacheClient.delete(CacheKeyBuilder.KeyTemp.BUYER_CANCEL_PENALTY.builderKeyOnlyFixed().getKey());
break;
case "seller_enter_threshold":
cacheClient.delete(CacheKeyBuilder.KeyTemp.ENTRY_THRESHOLD.builderKeyOnlyFixed().getKey());
break;
case "seller_earnest_money":
cacheClient.delete(CacheKeyBuilder.KeyTemp.SELLER_EARNEST_MONEY_CONFIG.builderKeyOnlyFixed().getKey());
break;
case "seller_penalty":
cacheClient.delete(CacheKeyBuilder.KeyTemp.SELLER_PENALTY_CONFIG.builderKeyOnlyFixed().getKey());
break;
case "presale_threshold":
cacheClient.delete(CacheKeyBuilder.KeyTemp.PRESALE_THRESHOLD.builderKeyOnlyFixed().getKey());
break;
case "order_code_rule":
cacheClient.delete(CacheKeyBuilder.KeyTemp.ORDER_CODE_RULE.builderKeyOnlyFixed().getKey());
break;
case "seller_goods_fee_rate":
cacheClient.delete(CacheKeyBuilder.KeyTemp.SELLER_GOODS_FEE_RATE.builderKeyOnlyFixed().getKey());
break;
case "seller_goods_platform_fee":
cacheClient.delete(CacheKeyBuilder.KeyTemp.SELLER_GOODS_PLATFORM_FEE.builderKeyOnlyFixed().getKey());
break;
case "buyer_order_fee":
cacheClient.delete(CacheKeyBuilder.KeyTemp.BUYER_ORDER_FEE.builderKeyOnlyFixed().getKey());
break;
case "buyer_overseas_order_cut_policy":
cacheClient.delete(CacheKeyBuilder.KeyTemp.BUYER_ORDER_CUT_POLICY.builderKeyOnlyFixed().getKey());
break;
case "seller_goods_price_limit":
cacheClient.delete(CacheKeyBuilder.KeyTemp.SELLER_SALE_PRICE_LIMIT.builderKeyOnlyFixed().getKey());
break;
case "depositFee":
cacheClient.delete(CacheKeyBuilder.KeyTemp.DEPOSIT_PLATFORM_FEE.builderKeyOnlyFixed().getKey());
break;
case "buyer_bid_config":
cacheClient.delete(CacheKeyBuilder.KeyTemp.BUYER_BID_CONFIG.builderKeyOnlyFixed().getKey());
break;
case "seller_bid_goods_fee_rate":
cacheClient.delete(CacheKeyBuilder.KeyTemp.SELLER_BID_GOODS_FEE_RATE.builderKeyOnlyFixed().getKey());
break;
case "buyer_order_violation_penalty":
cacheClient.delete(CacheKeyBuilder.KeyTemp.BUYER_ORDER_VIOLATION_PENALTY.builderKeyOnlyFixed().getKey());
break;
}
}
}
... ...
商品服务、订单服务、用户服务、资源位服务、促销优惠券服务等功能
### web.xml中的配置
#### `spring active profile` 配置
... ...