You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by GitBox <gi...@apache.org> on 2022/07/04 09:19:02 UTC

[GitHub] [inlong] leosanqing opened a new pull request, #4861: [INLONG-4841][Manager] Optimize the service validation method

leosanqing opened a new pull request, #4861:
URL: https://github.com/apache/inlong/pull/4861

   ### Prepare a Pull Request
   
   - Fixes #4841 
   
   ### Motivation
   
   - The current validation method does not use annotations like controller
   - If multiple conditions are not met at the same time, only the first exception message will be returned.
   - 
   ### Modifications
   - Delete unused validation
   - Add validation utils for service layer
   *Describe the modifications you've done.*
   
   ### Verifying this change
   
   *(Please pick either of the following options)*
   
   - [x] This change is already covered by existing tests, such as:
     - GroupServiceTest
   
   
   


-- 
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: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [inlong] healchow merged pull request #4861: [INLONG-4841][Manager] Optimize the service validation method

Posted by GitBox <gi...@apache.org>.
healchow merged PR #4861:
URL: https://github.com/apache/inlong/pull/4861


-- 
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: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [inlong] leosanqing commented on a diff in pull request #4861: [INLONG-4841][Manager] Optimize the service validation method

Posted by GitBox <gi...@apache.org>.
leosanqing commented on code in PR #4861:
URL: https://github.com/apache/inlong/pull/4861#discussion_r913356761


##########
inlong-dashboard/package-lock.json:
##########
@@ -11486,7 +11486,7 @@
     "json2mq": {
       "version": "0.2.0",
       "resolved": "https://registry.npmjs.org/json2mq/-/json2mq-0.2.0.tgz",
-      "integrity": "sha512-SzoRg7ux5DWTII9J2qkrZrqV1gt+rTaoufMxEzXbS26Uid0NwaJd123HcoB80TgubEppxxIGdNxCx50fEoEWQA==",
+      "integrity": "sha1-tje9O6nqvhIsg+lyBIOusQ0skEo=",

Review Comment:
   I rolled back



-- 
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: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [inlong] healchow commented on a diff in pull request #4861: [INLONG-4841][Manager] Optimize the service validation method

Posted by GitBox <gi...@apache.org>.
healchow commented on code in PR #4861:
URL: https://github.com/apache/inlong/pull/4861#discussion_r912922313


##########
inlong-dashboard/package-lock.json:
##########
@@ -11486,7 +11486,7 @@
     "json2mq": {
       "version": "0.2.0",
       "resolved": "https://registry.npmjs.org/json2mq/-/json2mq-0.2.0.tgz",
-      "integrity": "sha512-SzoRg7ux5DWTII9J2qkrZrqV1gt+rTaoufMxEzXbS26Uid0NwaJd123HcoB80TgubEppxxIGdNxCx50fEoEWQA==",
+      "integrity": "sha1-tje9O6nqvhIsg+lyBIOusQ0skEo=",

Review Comment:
   Does this file need to be changed?



-- 
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: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [inlong] healchow commented on a diff in pull request #4861: [INLONG-4841][Manager] Optimize the service validation method

Posted by GitBox <gi...@apache.org>.
healchow commented on code in PR #4861:
URL: https://github.com/apache/inlong/pull/4861#discussion_r912923785


##########
inlong-manager/manager-service/src/test/java/org/apache/inlong/manager/service/group/GroupServiceTest.java:
##########
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.inlong.manager.service.group;
+
+import org.apache.inlong.manager.common.pojo.group.InlongGroupApproveRequest;
+import org.apache.inlong.manager.common.pojo.group.tube.InlongTubeRequest;
+import org.apache.inlong.manager.service.ServiceBaseTest;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+
+import javax.annotation.Resource;
+import javax.validation.ConstraintViolationException;
+
+class GroupServiceTest extends ServiceBaseTest {

Review Comment:
   Please add Java doc for class.



-- 
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: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [inlong] healchow commented on a diff in pull request #4861: [INLONG-4841][Manager] Optimize the service validation method

Posted by GitBox <gi...@apache.org>.
healchow commented on code in PR #4861:
URL: https://github.com/apache/inlong/pull/4861#discussion_r912924334


##########
inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/util/ValidationUtils.java:
##########
@@ -0,0 +1,42 @@
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.inlong.manager.common.util;
+
+import lombok.experimental.UtilityClass;
+import org.apache.commons.collections.CollectionUtils;
+
+import javax.validation.ConstraintViolation;
+import javax.validation.ConstraintViolationException;
+import javax.validation.Validator;
+import java.util.Set;
+
+/**
+ * With various annotations of javax, it is used to verify object properties, mainly used in the service layer
+ */
+@UtilityClass
+public class ValidationUtils {
+
+    public static void validate(Validator validator, Object object, Class<?>... groups) {

Review Comment:
   Please add Java doc for static methods.



-- 
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: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org