Commit 71424b07 authored by 王亮's avatar 王亮

log user tag(create session and save user)

parent a7bbd26c
......@@ -20,6 +20,7 @@ public class UserTagLoginEventListener implements ApplicationListener<UserLoginE
/**
* 逻辑 每次登录发送UserLoginEvent,落user_tag表
* 如果没有就新增,如果有就更新
*
* @param userLoginEvent UserLoginEvent
*/
@Override
......@@ -32,9 +33,9 @@ public class UserTagLoginEventListener implements ApplicationListener<UserLoginE
preTag = userTag;
}
preTag.setCreatedAt(LocalDateTime.now());
preTag.setUpdatedAt(LocalDateTime.now());
preTag.setCreatedAt(userTag.getCreatedAt() == null ? LocalDateTime.now() : userTag.getCreatedAt());
preTag.setUpdatedAt(userTag.getUpdatedAt() == null ? LocalDateTime.now() : userTag.getUpdatedAt());
userTagRepository.save(preTag);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment