zhaohai666 commented on code in PR #11:
URL:
https://github.com/apache/rocketmq-eventbridge/pull/11#discussion_r875408272
##########
domain/src/main/java/org/apache/rocketmq/eventbridge/domain/model/connection/EventConnectionWithBLOBs.java:
##########
@@ -0,0 +1,115 @@
+package org.apache.rocketmq.eventbridge.domain.model.connection;
+
+import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
+
+import java.io.Serializable;
+
+public class EventConnectionWithBLOBs extends EventConnection implements
Serializable {
+ /**
+ * This field was generated by MyBatis Generator.
+ * This field corresponds to the database column
event_connection.auth_parameters
+ *
+ * @mbggenerated
+ */
+ private String authParameters;
Review Comment:
processed
##########
domain/src/main/java/org/apache/rocketmq/eventbridge/domain/model/apidestination/ApiDestinationService.java:
##########
@@ -0,0 +1,113 @@
+package org.apache.rocketmq.eventbridge.domain.model.apidestination;
+
+import lombok.extern.slf4j.Slf4j;
+import
org.apache.rocketmq.eventbridge.domain.common.exception.EventBridgeErrorCode;
+import org.apache.rocketmq.eventbridge.domain.model.AbstractResourceService;
+import org.apache.rocketmq.eventbridge.domain.model.PaginationResult;
+import
org.apache.rocketmq.eventbridge.domain.repository.ApiDestinationRepository;
+import org.apache.rocketmq.eventbridge.domain.repository.EventSourceRepository;
+import org.apache.rocketmq.eventbridge.exception.EventBridgeException;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Propagation;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+
+import static
org.apache.rocketmq.eventbridge.domain.common.exception.EventBridgeErrorCode.ApiDestinationCountExceedLimit;
+
+@Slf4j
+@Service
+public class ApiDestinationService extends AbstractResourceService {
+
+ private final ApiDestinationRepository apiDestinationRepository;
+ private final EventSourceRepository eventSourceRepository;
+
+ public ApiDestinationService(ApiDestinationRepository
apiDestinationRepository, EventSourceRepository eventSourceRepository) {
+ this.apiDestinationRepository = apiDestinationRepository;
+ this.eventSourceRepository = eventSourceRepository;
+ }
+
+ @Value("${api.destination.limit}")
+ private String apiDestinationLimit;
+
+ @Transactional(rollbackFor = Exception.class, propagation =
Propagation.REQUIRED)
+ public String createApiDestination(EventApiDestination
eventApiDestination) {
+ try {
+ if (checkApiDestination(eventApiDestination.getAccountId(),
eventApiDestination.getName()) != null) {
+ throw new
EventBridgeException(EventBridgeErrorCode.ApiDestinationAlreadyExist,
eventApiDestination.getName());
+ }
+
super.checkQuota(this.getApiDestinationCount(eventApiDestination.getAccountId(),
eventApiDestination.getName()), Integer.parseInt(apiDestinationLimit),
Review Comment:
processed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]