update 对接内蒙古平台

This commit is contained in:
2024-04-18 18:06:37 +08:00
parent c8d6859075
commit 75dc7017bc
5 changed files with 46 additions and 10 deletions

View File

@@ -2,6 +2,7 @@ package com.jsowell.thirdparty.mapper;
import com.jsowell.pile.vo.ThirdPartySecretInfoVO;
import com.jsowell.thirdparty.domain.ThirdpartySecretInfo;
import org.springframework.stereotype.Repository;
import java.util.List;
@@ -11,6 +12,7 @@ import java.util.List;
* @author jsowell
* @date 2024-04-18
*/
@Repository
public interface ThirdpartySecretInfoMapper {
/**
* 查询对接三方平台配置

View File

@@ -1,5 +1,7 @@
package com.jsowell.thirdparty.service.impl;
import com.jsowell.common.constant.CacheConstants;
import com.jsowell.common.core.redis.RedisCache;
import com.jsowell.common.util.DateUtils;
import com.jsowell.pile.vo.ThirdPartySecretInfoVO;
import com.jsowell.thirdparty.domain.ThirdpartySecretInfo;
@@ -9,6 +11,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Objects;
/**
* 对接三方平台配置Service业务层处理
@@ -21,6 +24,9 @@ public class ThirdpartySecretInfoServiceImpl implements ThirdpartySecretInfoServ
@Autowired
private ThirdpartySecretInfoMapper thirdpartySecretInfoMapper;
@Autowired
private RedisCache redisCache;
/**
* 查询对接三方平台配置
*
@@ -96,6 +102,15 @@ public class ThirdpartySecretInfoServiceImpl implements ThirdpartySecretInfoServ
*/
@Override
public ThirdPartySecretInfoVO queryByOperatorId(String theirOperatorId) {
return thirdpartySecretInfoMapper.queryByOperatorId(theirOperatorId);
// 加缓存
String redisKey = CacheConstants.THIRD_PARTY_SECRET_INFO + theirOperatorId;
ThirdPartySecretInfoVO result = redisCache.getCacheObject(redisKey);
if (Objects.isNull(result)) {
result = thirdpartySecretInfoMapper.queryByOperatorId(theirOperatorId);
if (Objects.nonNull(result)) {
redisCache.setCacheObject(redisKey, result, CacheConstants.cache_expire_time_1h);
}
}
return result;
}
}