mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-22 03:55:17 +08:00
update 对接内蒙古平台
This commit is contained in:
@@ -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 {
|
||||
/**
|
||||
* 查询对接三方平台配置
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user