|
|
@@ -48,6 +48,7 @@ public class EventMsgService implements GzhMsgService{
|
|
|
.last("limit 1"));
|
|
|
GzhUnionidUserinfo info = weChatService.getUserInfo2(weChatService.getAccessToken(), openId);
|
|
|
if (user == null) {
|
|
|
+ user = new User();
|
|
|
user.setNickname(info.getNickname())
|
|
|
.setSex(info.getSex())
|
|
|
.setCountry(info.getCountry())
|
|
|
@@ -59,6 +60,7 @@ public class EventMsgService implements GzhMsgService{
|
|
|
userMapper.insert(user);
|
|
|
|
|
|
saveGzhUserRelation(msgEvent, user.getId(), openId, info.getUnionid());
|
|
|
+ return "";
|
|
|
} else {
|
|
|
//之前关注过
|
|
|
if (user.getUnionid() == null || !user.getUnionid().equals(info.getUnionid())) {
|
|
|
@@ -70,6 +72,7 @@ public class EventMsgService implements GzhMsgService{
|
|
|
if (userGzhRelation == null) {
|
|
|
saveGzhUserRelation(msgEvent, user.getId(), openId, info.getUnionid());
|
|
|
}
|
|
|
+ return "";
|
|
|
}
|
|
|
} else if (msgEvent.getEvent() == MsgEvent.Event.unsubscribe) {
|
|
|
UserGzhRelation userGzhRelation = userGzhRelationMapper.selectOne(Wrappers.lambdaQuery(UserGzhRelation.class)
|