Browse Source

微信第三方平台-逻辑删除更改物理删除

master
zxc 5 years ago
parent
commit
ff8c31c88b
  1. 2
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/AuthorizationInfoDao.java
  2. 2
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/ComponentAccessTokenDao.java
  3. 10
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/ComponentVerifyTicketServiceImpl.java
  4. 6
      epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/AuthorizationInfoDao.xml
  5. 9
      epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/ComponentAccessTokenDao.xml

2
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/AuthorizationInfoDao.java

@ -81,7 +81,7 @@ public interface AuthorizationInfoDao extends BaseDao<AuthorizationInfoEntity> {
* @param customerId
* @author zxc
*/
void updateOldAuthorizerAccessToken(@Param("customerId")String customerId,@Param("clientType")String clientType);
void deleteOldAuthorizerAccessToken(@Param("customerId")String customerId,@Param("clientType")String clientType);
/**
* @Description 根据 authAppId 查询客户ID和客户端类型

2
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/ComponentAccessTokenDao.java

@ -45,7 +45,7 @@ public interface ComponentAccessTokenDao extends BaseDao<ComponentAccessTokenEnt
* @param
* @author zxc
*/
void updateOldComponentAccessToken();
void deleteOldComponentAccessToken();
/**
* @Description 查询component_access_token 数量

10
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/ComponentVerifyTicketServiceImpl.java

@ -211,7 +211,7 @@ public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketSe
formDTO.setExpiresInTime(expiresInTime);
//先逻辑删,在插入
log.info(ThirdRunTimeInfoConstant.START_DELETE_COMPONENT_ACCESS_TOKEN);
componentAccessTokenDao.updateOldComponentAccessToken();
componentAccessTokenDao.deleteOldComponentAccessToken();
componentAccessTokenDao.insertComponentAccessToken(formDTO);
//存缓存
redisThird.setComponentAccessToken(componentAccessToken);
@ -348,14 +348,10 @@ public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketSe
formDTO.setAuthAppid(authAppId);
formDTO.setClientType(clientType);
AuthorizationInfoFormDTO authorizationInfo = new AuthorizationInfoFormDTO();
BeanUtils.copyProperties(formDTO,authorizationInfo);
authorizationInfo.setAuthorizerAppid(authAppId);
authorizationInfo.setClientType(clientType);
authorizationInfo.setCustomerId(customerId);
authorizationInfo.setAuthorizerRefreshToken(authorizerRefreshToken);
authorizationInfo.setAuthorizerAccessToken(authorizerAccessToken);
authorizationInfo.setExpiresInTime(expiresInTime);
//先逻辑删除,在插入
authorizationInfoDao.updateOldAuthorizerAccessToken(customerId, clientType);
authorizationInfoDao.deleteOldAuthorizerAccessToken(customerId, clientType);
authorizationInfoDao.insertAuthorizerAccessToken(formDTO);
//缓存 refreshAuthorizerAccessToken
redisThird.setAuthorizerRefreshToken(authorizationInfo);

6
epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/AuthorizationInfoDao.xml

@ -65,9 +65,9 @@
</insert>
<!-- 逻辑删 authorizer_access_token -->
<update id="updateOldAuthorizerAccessToken">
update authorization_info set del_flag = 1 where customer_id = #{customerId} AND client_type = #{clientType}
</update>
<delete id="deleteOldAuthorizerAccessToken">
delete from authorization_info where customer_id = #{customerId} AND client_type = #{clientType}
</delete>
<select id="getAuthInfoByCustomer" resultType="com.epmet.dto.AuthorizationInfoDTO">
SELECT AUTHORIZER_APPID,

9
epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/ComponentAccessTokenDao.xml

@ -19,10 +19,11 @@
)
</insert>
<!-- 逻辑删除旧的 component_access_token信息 -->
<update id="updateOldComponentAccessToken">
update component_access_token set del_flag = 1
</update>
<!-- 删除旧的 component_access_token信息 -->
<delete id="deleteOldComponentAccessToken">
delete from component_access_token where del_flag = 0
</delete>
<select id="getComponentAccessToken" resultType="java.lang.String">
SELECT
COMPONENT_ACCESS_TOKEN

Loading…
Cancel
Save