Commit de1783ce authored by 张国敬's avatar 张国敬

替换缓存组件,增加品牌批量查询接口

parent 6a61d639
......@@ -2,6 +2,7 @@ package com.qmai.basic.configcenter;
import com.github.benmanes.caffeine.cache.Caffeine;
import com.github.benmanes.caffeine.cache.LoadingCache;
import com.qmai.basic.configcenter.vo.SellerConfigBatchQuery;
import com.qmai.basic.configcenter.vo.SellerConfigQuery;
import com.qmai.basic.configcenter.vo.SellerConfigResponse;
import com.qmai.basic.configcenter.vo.StoreConfigBatchQuery;
......@@ -240,6 +241,34 @@ public class ConfigCenterHelper {
}
}
/**
* 批量查询品牌配置, sellerId + fieldCodes
* 门店id最多不超过10个,字段最多不超过100个
* @param query
* @return
*/
public Result<List<SellerConfigResponse>> batchQuerySellerConfig(SellerConfigBatchQuery query) {
if (configCenterInnerApi == null) {
return ResultUtils.failure(ERROR_NOT_CONFIG);
}
if (query.getSellerId() == null || query.getSellerId() == 0) {
return Result.failureData(ERROR_SELLER_ID_EMPTY);
}
if (CollectionUtils.isEmpty(query.getFieldCodes()) ) {
return Result.failureData(ERROR_FIELD_CODES_EMPTY);
}
if (query.getFieldCodes().size() > MAX_SIZE_FIELD_CODES ) {
return Result.failureData(ERROR_FIELD_CODES_TOO_MANY);
}
try {
return this.configCenterInnerApi.batchQuerySellerConfig(query);
} catch (Exception e) {
logger.error("batch query seller config by config-center SDK error", e);
return ResultUtils.failure(ERROR_QUERY_STORE_FAIL);
}
}
/**
* 删除品牌配置缓存
* @param query
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment