diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/base/config/MybatisConfig.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/base/config/MybatisConfig.java index 5be603899a..df9b4f3e73 100644 --- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/base/config/MybatisConfig.java +++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/base/config/MybatisConfig.java @@ -77,6 +77,7 @@ public PostgreSQLPrepareInterceptor postgreSQLPrepareInterceptor() { public MybatisPlusPropertiesCustomizer mybatisPlusPropertiesCustomizer() { return properties -> { properties.setTypeAliasesPackage("org.apache.streampark.console.*.entity"); + properties.setTypeEnumsPackage("org.apache.streampark.console.*.enums"); properties.setMapperLocations(new String[] {"classpath:mapper/*/*.xml"}); MybatisConfiguration mybatisConfiguration = new MybatisConfiguration(); mybatisConfiguration.setJdbcTypeForNull(JdbcType.NULL); diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/Message.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/Message.java index 1029f06382..bc82dd9296 100644 --- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/Message.java +++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/Message.java @@ -40,7 +40,7 @@ public class Message { private String title; /** 1) build failure report 2) task monitoring exception */ - private Integer type; + private NoticeTypeEnum type; private String context; @@ -54,7 +54,7 @@ public Message( this.appId = appId; this.title = title; this.context = context; - this.type = noticeTypeEnum.get(); + this.type = noticeTypeEnum; this.createTime = new Date(); this.isRead = false; } diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/MessageServiceImpl.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/MessageServiceImpl.java index c7d4d1587e..3fa977f446 100644 --- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/MessageServiceImpl.java +++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/MessageServiceImpl.java @@ -53,7 +53,7 @@ public IPage getUnReadPage(NoticeTypeEnum noticeTypeEnum, RestRequest r new LambdaQueryWrapper() .eq(Message::getIsRead, false) .orderByDesc(Message::getCreateTime) - .eq(Message::getType, noticeTypeEnum.get()); + .eq(Message::getType, noticeTypeEnum); return this.baseMapper.selectPage(page, queryWrapper); } }