Browse Source

fix cache

release_toaliyun_real
xiaohanzi 5 years ago
parent
commit
257435ba67
1 changed files with 6 additions and 5 deletions
  1. +6
    -5
      mallinkService/src/main/java/com/iformall/service/cuser/wx/WxCUserServiceAdapter.java

+ 6
- 5
mallinkService/src/main/java/com/iformall/service/cuser/wx/WxCUserServiceAdapter.java View File

@@ -1,14 +1,12 @@
package com.iformall.service.cuser.wx;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.iformall.common.ErrorCode;
import com.iformall.domain.po.WxCUser;
import com.iformall.domain.po.base.BaseCUserEntity;
import com.iformall.exception.MallinkException;
import com.iformall.mapper.WxCUserMapper;
import com.iformall.service.cuser.CUserServiceApapter;

@@ -24,13 +22,16 @@ public class WxCUserServiceAdapter implements CUserServiceApapter{
entity.setExpireTime(wxCUser.getExpireTime());
entity.setUserId(wxCUser.getUserId());
entity.setToken(wxCUser.getToken());
entity.setRealUser(JSON.parseObject(JSON.toJSONString(wxCUser, SerializerFeature.WriteNullStringAsEmpty, SerializerFeature.WriteNullNumberAsZero, SerializerFeature.WriteMapNullValue), Map.class));
entity.setRealUser(wxCUser);
return entity;
}
@Override
public BaseCUserEntity getByToken(String token) {
WxCUser wxCUser = wxCUserMapper.findByToken(token);
if (null == wxCUser) {
throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(), "WxCUserServiceAdapter token失效");
}
return generateBaseEntity(wxCUser);
}


Loading…
Cancel
Save