Skip to content

Commit f98446e

Browse files
authored
Merge pull request #239 from Liu-XinYuan/i238
fix create topic failed when not specify peak_byte_in
2 parents d6559be + 57a48da commit f98446e

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/dto/op/topic/TopicCreationDTO.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ public class TopicCreationDTO extends ClusterTopicDTO {
4040
@ApiModelProperty(value = "Topic属性列表")
4141
private Properties properties;
4242

43+
@ApiModelProperty(value = "最大写入字节数")
44+
private Long peakBytesIn;
45+
4346
public String getAppId() {
4447
return appId;
4548
}
@@ -104,6 +107,14 @@ public void setProperties(Properties properties) {
104107
this.properties = properties;
105108
}
106109

110+
public Long getPeakBytesIn() {
111+
return peakBytesIn;
112+
}
113+
114+
public void setPeakBytesIn(Long peakBytesIn) {
115+
this.peakBytesIn = peakBytesIn;
116+
}
117+
107118
@Override
108119
public String toString() {
109120
return "TopicCreationDTO{" +
@@ -135,4 +146,4 @@ public boolean paramLegal() {
135146
}
136147
return true;
137148
}
138-
}
149+
}

kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/entity/pojo/TopicDO.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.xiaojukeji.kafka.manager.common.entity.pojo;
22

33
import com.xiaojukeji.kafka.manager.common.entity.dto.op.topic.TopicCreationDTO;
4+
import com.xiaojukeji.kafka.manager.common.utils.ValidateUtils;
45

56
import java.util.Date;
67

@@ -95,6 +96,7 @@ public static TopicDO buildFrom(TopicCreationDTO dto) {
9596
topicDO.setClusterId(dto.getClusterId());
9697
topicDO.setTopicName(dto.getTopicName());
9798
topicDO.setDescription(dto.getDescription());
99+
topicDO.setPeakBytesIn(ValidateUtils.isNull(dto.getPeakBytesIn()) ? -1L : dto.getPeakBytesIn());
98100
return topicDO;
99101
}
100-
}
102+
}

0 commit comments

Comments
 (0)