|
|
|
@@ -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); |
|
|
|
} |
|
|
|
|
|
|
|
|