【新增】 rabbitmq手动连接,推送数据,接收数据并保存在数据库内
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
package pc.exam.pp.framework.mybatis.core.dataobject;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonParser;
|
||||
import com.fasterxml.jackson.databind.DeserializationContext;
|
||||
import com.fasterxml.jackson.databind.JsonDeserializer;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.time.Instant;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZoneId;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
|
||||
/**
|
||||
* @author REN
|
||||
*/
|
||||
public class CustomLocalDateTimeDeserializer extends JsonDeserializer<LocalDateTime> {
|
||||
@Override
|
||||
public LocalDateTime deserialize(JsonParser p, DeserializationContext ctxt) throws IOException, IOException {
|
||||
// 读取时间戳(毫秒)
|
||||
long timestamp = p.getLongValue();
|
||||
return LocalDateTime.ofInstant(
|
||||
Instant.ofEpochMilli(timestamp),
|
||||
// 使用系统默认时区
|
||||
ZoneId.systemDefault()
|
||||
);
|
||||
}
|
||||
}
|
@@ -90,6 +90,17 @@ public class SecurityFrameworkUtils {
|
||||
return loginUser != null ? loginUser.getId() : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获得当前用户的租户ID,从上下文中
|
||||
*
|
||||
* @return 租户ID
|
||||
*/
|
||||
@Nullable
|
||||
public static Long getLoginTenantId() {
|
||||
LoginUser loginUser = getLoginUser();
|
||||
return loginUser != null ? loginUser.getTenantId() : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获得当前用户的昵称,从上下文中
|
||||
*
|
||||
|
Reference in New Issue
Block a user