You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by GitBox <gi...@apache.org> on 2022/07/01 12:57:42 UTC

[GitHub] [incubator-seatunnel] dijiekstra opened a new pull request, #2112: [seatunnel-1947][seatunnel-server] init & add interface for script/user

dijiekstra opened a new pull request, #2112:
URL: https://github.com/apache/incubator-seatunnel/pull/2112

   <!--
   
   Thank you for contributing to SeaTunnel! Please make sure that your code changes
   are covered with tests. And in case of new features or big changes
   remember to adjust the documentation.
   
   Feel free to ping committers for the review!
   
   ## Contribution Checklist
   
     - Make sure that the pull request corresponds to a [GITHUB issue](https://github.com/apache/incubator-seatunnel/issues).
   
     - Name the pull request in the form "[Feature] [component] Title of the pull request", where *Feature* can be replaced by `Hotfix`, `Bug`, etc.
   
     - Minor fixes should be named following this pattern: `[hotfix] [docs] Fix typo in README.md doc`.
   
   -->
   
   ## Purpose of this pull request
   Follow https://github.com/apache/incubator-seatunnel/issues/1947
   
   add interface for script & user.
   
   ## Check list
   
   * [X] Code changed are covered with tests, or it does not need tests for reason:
   * [X] If any new Jar binary package adding in your PR, please add License Notice according
     [New License Guide](https://github.com/apache/incubator-seatunnel/blob/dev/docs/en/contribution/new-license.md)
   * [ ] If necessary, please update the documentation to describe the new feature. https://github.com/apache/incubator-seatunnel/tree/dev/docs
   


-- 
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@seatunnel.apache.org

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


[GitHub] [incubator-seatunnel] dijiekstra commented on a diff in pull request #2112: [seatunnel-1947][seatunnel-server] init & add interface for script/user

Posted by GitBox <gi...@apache.org>.
dijiekstra commented on code in PR #2112:
URL: https://github.com/apache/incubator-seatunnel/pull/2112#discussion_r912356218


##########
seatunnel-server/seatunnel-app/src/main/java/org/apache/seatunnel/app/dal/entity/ScriptParam.java:
##########
@@ -0,0 +1,92 @@
+/*
+ * 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.seatunnel.app.dal.entity;
+
+import java.util.Date;
+
+public class ScriptParam {
+    private Integer id;
+
+    private Integer scriptId;
+
+    private String key;
+
+    private String value;
+
+    private Byte status;

Review Comment:
   `Byte` takes up less database disk



-- 
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@seatunnel.apache.org

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


[GitHub] [incubator-seatunnel] CalvinKirs commented on a diff in pull request #2112: [seatunnel-1947][seatunnel-server] init & add interface for script/user

Posted by GitBox <gi...@apache.org>.
CalvinKirs commented on code in PR #2112:
URL: https://github.com/apache/incubator-seatunnel/pull/2112#discussion_r912564075


##########
seatunnel-server/pom.xml:
##########
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>seatunnel</artifactId>
+        <groupId>org.apache.seatunnel</groupId>
+        <version>${revision}</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>seatunnel-server</artifactId>
+    <packaging>pom</packaging>
+    <modules>
+        <module>seatunnel-app</module>
+    </modules>
+
+    <properties>
+        <maven.compiler.source>8</maven.compiler.source>
+        <maven.compiler.target>8</maven.compiler.target>
+    </properties>

Review Comment:
   This is redundant.



-- 
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@seatunnel.apache.org

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


[GitHub] [incubator-seatunnel] dijiekstra commented on pull request #2112: [seatunnel-1947][seatunnel-server] init & add interface for script/user

Posted by GitBox <gi...@apache.org>.
dijiekstra commented on PR #2112:
URL: https://github.com/apache/incubator-seatunnel/pull/2112#issuecomment-1172854946

   Could u help reivew this pr ? @CalvinKirs @ruanwenjun 


-- 
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@seatunnel.apache.org

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


[GitHub] [incubator-seatunnel] CalvinKirs commented on a diff in pull request #2112: [seatunnel-1947][seatunnel-server] init & add interface for script/user

Posted by GitBox <gi...@apache.org>.
CalvinKirs commented on code in PR #2112:
URL: https://github.com/apache/incubator-seatunnel/pull/2112#discussion_r913685972


##########
seatunnel-server/seatunnel-app/src/main/java/org/apache/seatunnel/app/controller/ScriptController.java:
##########
@@ -0,0 +1,106 @@
+/*
+ * 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.seatunnel.app.controller;
+
+import org.apache.seatunnel.app.common.Result;
+import org.apache.seatunnel.app.domain.request.script.AddEmptyScriptReq;
+import org.apache.seatunnel.app.domain.request.script.ScriptListReq;
+import org.apache.seatunnel.app.domain.request.script.UpdateScriptContentReq;
+import org.apache.seatunnel.app.domain.request.script.UpdateScriptParamReq;
+import org.apache.seatunnel.app.domain.response.script.AddEmptyScriptRes;
+import org.apache.seatunnel.app.domain.response.script.ScriptParamRes;
+import org.apache.seatunnel.app.domain.response.script.ScriptSimpleInfoRes;
+import org.apache.seatunnel.app.service.IScriptService;
+
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+import javax.validation.constraints.NotNull;
+
+import java.util.List;
+
+@RequestMapping("/api/v1/script")
+@RestController
+public class ScriptController {
+    @Resource
+    private IScriptService iScriptService;
+
+    @PostMapping("/script")
+    @ApiOperation(value = "add an empty script", httpMethod = "POST")
+    public Result<AddEmptyScriptRes> addEmptyScript(@RequestBody @NotNull AddEmptyScriptReq addEmptyScriptReq) {
+        return Result.success(iScriptService.addEmptyScript(addEmptyScriptReq));
+    }
+
+    @PutMapping("/scriptContent")
+    @ApiOperation(value = "update script", httpMethod = "POST")
+    public Result<Void> updateScriptContent(@RequestBody @NotNull UpdateScriptContentReq updateScriptContentReq) {
+        iScriptService.updateScriptContent(updateScriptContentReq);
+        return Result.success();
+    }
+
+    @DeleteMapping("/script")
+    @ApiOperation(value = "delete script", httpMethod = "POST")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id", value = "script id", dataType = "Integer"),
+    })
+    public Result<Void> delete(@RequestParam @NotNull Integer id) {
+        iScriptService.delete(id);
+        return Result.success();
+    }
+
+    @PostMapping("/list")
+    @ApiOperation(value = "script list", httpMethod = "POST")
+    public Result<List<ScriptSimpleInfoRes>> list(@RequestBody @NotNull ScriptListReq scriptListReq) {
+        return Result.success(iScriptService.list(scriptListReq));
+    }
+
+    @GetMapping("/scriptContent")
+    @ApiOperation(value = "fetch script content", httpMethod = "POST")
+    @ApiImplicitParams({

Review Comment:
   httpMethod is wrong



-- 
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@seatunnel.apache.org

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


[GitHub] [incubator-seatunnel] dijiekstra commented on a diff in pull request #2112: [seatunnel-1947][seatunnel-server] init & add interface for script/user

Posted by GitBox <gi...@apache.org>.
dijiekstra commented on code in PR #2112:
URL: https://github.com/apache/incubator-seatunnel/pull/2112#discussion_r913688661


##########
seatunnel-server/seatunnel-app/src/main/java/org/apache/seatunnel/app/controller/ScriptController.java:
##########
@@ -0,0 +1,106 @@
+/*
+ * 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.seatunnel.app.controller;
+
+import org.apache.seatunnel.app.common.Result;
+import org.apache.seatunnel.app.domain.request.script.AddEmptyScriptReq;
+import org.apache.seatunnel.app.domain.request.script.ScriptListReq;
+import org.apache.seatunnel.app.domain.request.script.UpdateScriptContentReq;
+import org.apache.seatunnel.app.domain.request.script.UpdateScriptParamReq;
+import org.apache.seatunnel.app.domain.response.script.AddEmptyScriptRes;
+import org.apache.seatunnel.app.domain.response.script.ScriptParamRes;
+import org.apache.seatunnel.app.domain.response.script.ScriptSimpleInfoRes;
+import org.apache.seatunnel.app.service.IScriptService;
+
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+import javax.validation.constraints.NotNull;
+
+import java.util.List;
+
+@RequestMapping("/api/v1/script")
+@RestController
+public class ScriptController {
+    @Resource
+    private IScriptService iScriptService;
+
+    @PostMapping("/script")
+    @ApiOperation(value = "add an empty script", httpMethod = "POST")
+    public Result<AddEmptyScriptRes> addEmptyScript(@RequestBody @NotNull AddEmptyScriptReq addEmptyScriptReq) {
+        return Result.success(iScriptService.addEmptyScript(addEmptyScriptReq));
+    }
+
+    @PutMapping("/scriptContent")
+    @ApiOperation(value = "update script", httpMethod = "POST")
+    public Result<Void> updateScriptContent(@RequestBody @NotNull UpdateScriptContentReq updateScriptContentReq) {
+        iScriptService.updateScriptContent(updateScriptContentReq);
+        return Result.success();
+    }
+
+    @DeleteMapping("/script")
+    @ApiOperation(value = "delete script", httpMethod = "POST")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id", value = "script id", dataType = "Integer"),
+    })
+    public Result<Void> delete(@RequestParam @NotNull Integer id) {
+        iScriptService.delete(id);
+        return Result.success();

Review Comment:
   If throw any exception , will been catch by globalexceptionhandle, and then return error msg



-- 
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@seatunnel.apache.org

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


[GitHub] [incubator-seatunnel] ruanwenjun commented on a diff in pull request #2112: [seatunnel-1947][seatunnel-server] init & add interface for script/user

Posted by GitBox <gi...@apache.org>.
ruanwenjun commented on code in PR #2112:
URL: https://github.com/apache/incubator-seatunnel/pull/2112#discussion_r912358655


##########
seatunnel-server/seatunnel-app/src/main/java/org/apache/seatunnel/app/dal/entity/ScriptParam.java:
##########
@@ -0,0 +1,92 @@
+/*
+ * 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.seatunnel.app.dal.entity;
+
+import java.util.Date;
+
+public class ScriptParam {
+    private Integer id;
+
+    private Integer scriptId;
+
+    private String key;
+
+    private String value;
+
+    private Byte status;

Review Comment:
   I didn't see your table schema, in my knowledge, we can use tinyint for this field, tinyint only need 1 byte.



-- 
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@seatunnel.apache.org

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


[GitHub] [incubator-seatunnel] CalvinKirs commented on a diff in pull request #2112: [seatunnel-1947][seatunnel-server] init & add interface for script/user

Posted by GitBox <gi...@apache.org>.
CalvinKirs commented on code in PR #2112:
URL: https://github.com/apache/incubator-seatunnel/pull/2112#discussion_r913685317


##########
seatunnel-server/seatunnel-app/src/main/java/org/apache/seatunnel/app/controller/ScriptController.java:
##########
@@ -0,0 +1,106 @@
+/*
+ * 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.seatunnel.app.controller;
+
+import org.apache.seatunnel.app.common.Result;
+import org.apache.seatunnel.app.domain.request.script.AddEmptyScriptReq;
+import org.apache.seatunnel.app.domain.request.script.ScriptListReq;
+import org.apache.seatunnel.app.domain.request.script.UpdateScriptContentReq;
+import org.apache.seatunnel.app.domain.request.script.UpdateScriptParamReq;
+import org.apache.seatunnel.app.domain.response.script.AddEmptyScriptRes;
+import org.apache.seatunnel.app.domain.response.script.ScriptParamRes;
+import org.apache.seatunnel.app.domain.response.script.ScriptSimpleInfoRes;
+import org.apache.seatunnel.app.service.IScriptService;
+
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+import javax.validation.constraints.NotNull;
+
+import java.util.List;
+
+@RequestMapping("/api/v1/script")
+@RestController
+public class ScriptController {
+    @Resource
+    private IScriptService iScriptService;
+
+    @PostMapping("/script")
+    @ApiOperation(value = "add an empty script", httpMethod = "POST")
+    public Result<AddEmptyScriptRes> addEmptyScript(@RequestBody @NotNull AddEmptyScriptReq addEmptyScriptReq) {
+        return Result.success(iScriptService.addEmptyScript(addEmptyScriptReq));
+    }
+
+    @PutMapping("/scriptContent")
+    @ApiOperation(value = "update script", httpMethod = "POST")
+    public Result<Void> updateScriptContent(@RequestBody @NotNull UpdateScriptContentReq updateScriptContentReq) {
+        iScriptService.updateScriptContent(updateScriptContentReq);
+        return Result.success();
+    }
+
+    @DeleteMapping("/script")
+    @ApiOperation(value = "delete script", httpMethod = "POST")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id", value = "script id", dataType = "Integer"),
+    })
+    public Result<Void> delete(@RequestParam @NotNull Integer id) {
+        iScriptService.delete(id);
+        return Result.success();

Review Comment:
   Why does deletion do not need to judge the deletion result, and we may also have other exception situations



-- 
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@seatunnel.apache.org

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


[GitHub] [incubator-seatunnel] dijiekstra commented on pull request #2112: [seatunnel-1947][seatunnel-server] init & add interface for script/user

Posted by GitBox <gi...@apache.org>.
dijiekstra commented on PR #2112:
URL: https://github.com/apache/incubator-seatunnel/pull/2112#issuecomment-1172886729

   Hi @ruanwenjun :
   Thanks for your review , i whill fix them soon😁


-- 
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@seatunnel.apache.org

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


[GitHub] [incubator-seatunnel] CalvinKirs commented on a diff in pull request #2112: [seatunnel-1947][seatunnel-server] init & add interface for script/user

Posted by GitBox <gi...@apache.org>.
CalvinKirs commented on code in PR #2112:
URL: https://github.com/apache/incubator-seatunnel/pull/2112#discussion_r913686391


##########
seatunnel-server/seatunnel-app/src/main/java/org/apache/seatunnel/app/controller/ScriptController.java:
##########
@@ -0,0 +1,106 @@
+/*
+ * 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.seatunnel.app.controller;
+
+import org.apache.seatunnel.app.common.Result;
+import org.apache.seatunnel.app.domain.request.script.AddEmptyScriptReq;
+import org.apache.seatunnel.app.domain.request.script.ScriptListReq;
+import org.apache.seatunnel.app.domain.request.script.UpdateScriptContentReq;
+import org.apache.seatunnel.app.domain.request.script.UpdateScriptParamReq;
+import org.apache.seatunnel.app.domain.response.script.AddEmptyScriptRes;
+import org.apache.seatunnel.app.domain.response.script.ScriptParamRes;
+import org.apache.seatunnel.app.domain.response.script.ScriptSimpleInfoRes;
+import org.apache.seatunnel.app.service.IScriptService;
+
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+import javax.validation.constraints.NotNull;
+
+import java.util.List;
+
+@RequestMapping("/api/v1/script")
+@RestController
+public class ScriptController {
+    @Resource
+    private IScriptService iScriptService;
+
+    @PostMapping("/script")
+    @ApiOperation(value = "add an empty script", httpMethod = "POST")
+    public Result<AddEmptyScriptRes> addEmptyScript(@RequestBody @NotNull AddEmptyScriptReq addEmptyScriptReq) {
+        return Result.success(iScriptService.addEmptyScript(addEmptyScriptReq));
+    }
+
+    @PutMapping("/scriptContent")
+    @ApiOperation(value = "update script", httpMethod = "POST")
+    public Result<Void> updateScriptContent(@RequestBody @NotNull UpdateScriptContentReq updateScriptContentReq) {
+        iScriptService.updateScriptContent(updateScriptContentReq);
+        return Result.success();
+    }
+
+    @DeleteMapping("/script")
+    @ApiOperation(value = "delete script", httpMethod = "POST")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id", value = "script id", dataType = "Integer"),
+    })
+    public Result<Void> delete(@RequestParam @NotNull Integer id) {
+        iScriptService.delete(id);
+        return Result.success();
+    }
+
+    @PostMapping("/list")
+    @ApiOperation(value = "script list", httpMethod = "POST")
+    public Result<List<ScriptSimpleInfoRes>> list(@RequestBody @NotNull ScriptListReq scriptListReq) {
+        return Result.success(iScriptService.list(scriptListReq));
+    }
+
+    @GetMapping("/scriptContent")
+    @ApiOperation(value = "fetch script content", httpMethod = "POST")
+    @ApiImplicitParams({

Review Comment:
   and please check other case



-- 
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@seatunnel.apache.org

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


[GitHub] [incubator-seatunnel] CalvinKirs merged pull request #2112: [seatunnel-1947][seatunnel-server] init & add interface for script/user

Posted by GitBox <gi...@apache.org>.
CalvinKirs merged PR #2112:
URL: https://github.com/apache/incubator-seatunnel/pull/2112


-- 
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@seatunnel.apache.org

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


[GitHub] [incubator-seatunnel] ruanwenjun commented on a diff in pull request #2112: [seatunnel-1947][seatunnel-server] init & add interface for script/user

Posted by GitBox <gi...@apache.org>.
ruanwenjun commented on code in PR #2112:
URL: https://github.com/apache/incubator-seatunnel/pull/2112#discussion_r912351266


##########
seatunnel-server/seatunnel-app/src/main/java/org/apache/seatunnel/app/controller/ScriptController.java:
##########
@@ -0,0 +1,104 @@
+/*
+ * 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.seatunnel.app.controller;
+
+import org.apache.seatunnel.app.common.JsonResult;
+import org.apache.seatunnel.app.domain.request.script.AddEmptyScriptReq;
+import org.apache.seatunnel.app.domain.request.script.ScriptListReq;
+import org.apache.seatunnel.app.domain.request.script.UpdateScriptContentReq;
+import org.apache.seatunnel.app.domain.request.script.UpdateScriptParamReq;
+import org.apache.seatunnel.app.domain.response.script.ScriptParamRes;
+import org.apache.seatunnel.app.domain.response.script.ScriptSimpleInfoRes;
+import org.apache.seatunnel.app.service.IScriptService;
+
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+import javax.validation.constraints.NotNull;
+
+import java.util.List;
+
+@RequestMapping("/script")
+@RestController
+public class ScriptController {
+    @Resource
+    private IScriptService iScriptService;
+
+    @PostMapping("/addEmptyScript")
+    @ApiOperation(value = "add an empty script", httpMethod = "POST")
+    public JsonResult<Void> addEmptyScript(@RequestBody @NotNull AddEmptyScriptReq addEmptyScriptReq) {
+        iScriptService.addEmptyScript(addEmptyScriptReq);
+        return JsonResult.success();
+    }
+
+    @PostMapping("/updateScriptContent")
+    @ApiOperation(value = "update script", httpMethod = "POST")
+    public JsonResult<Void> updateScriptContent(@RequestBody @NotNull UpdateScriptContentReq updateScriptContentReq) {
+        iScriptService.updateScriptContent(updateScriptContentReq);
+        return JsonResult.success();
+    }
+
+    @PostMapping("/delete")

Review Comment:
   Use DeleteMapping if you want to use restful style 



##########
seatunnel-server/seatunnel-app/src/main/java/org/apache/seatunnel/app/dal/entity/Script.java:
##########
@@ -0,0 +1,122 @@
+/*
+ * 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.seatunnel.app.dal.entity;
+
+import java.util.Date;
+
+public class Script {

Review Comment:
   Please use lombok.



##########
seatunnel-server/seatunnel-app/src/main/java/org/apache/seatunnel/app/service/impl/ScriptServiceImpl.java:
##########
@@ -0,0 +1,196 @@
+/*
+ * 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.seatunnel.app.service.impl;
+
+import static org.apache.seatunnel.app.common.SeatunnelErrorEnum.NO_SUCH_SCRIPT;
+import static com.google.common.base.Preconditions.checkState;
+
+import org.apache.seatunnel.app.common.JsonResult;
+import org.apache.seatunnel.app.common.ScriptParamStatusEnum;
+import org.apache.seatunnel.app.common.ScriptStatusEnum;
+import org.apache.seatunnel.app.dal.dao.IScriptDao;
+import org.apache.seatunnel.app.dal.dao.IScriptParamDao;
+import org.apache.seatunnel.app.dal.entity.Script;
+import org.apache.seatunnel.app.dal.entity.ScriptParam;
+import org.apache.seatunnel.app.domain.dto.script.AddEmptyScriptDto;
+import org.apache.seatunnel.app.domain.dto.script.CheckScriptDuplicateDto;
+import org.apache.seatunnel.app.domain.dto.script.ListScriptsDto;
+import org.apache.seatunnel.app.domain.dto.script.UpdateScriptContentDto;
+import org.apache.seatunnel.app.domain.dto.script.UpdateScriptParamDto;
+import org.apache.seatunnel.app.domain.request.script.AddEmptyScriptReq;
+import org.apache.seatunnel.app.domain.request.script.ScriptListReq;
+import org.apache.seatunnel.app.domain.request.script.UpdateScriptContentReq;
+import org.apache.seatunnel.app.domain.request.script.UpdateScriptParamReq;
+import org.apache.seatunnel.app.domain.response.script.AddEmptyScriptRes;
+import org.apache.seatunnel.app.domain.response.script.ScriptParamRes;
+import org.apache.seatunnel.app.domain.response.script.ScriptSimpleInfoRes;
+import org.apache.seatunnel.app.service.IScriptService;
+import org.apache.seatunnel.app.util.Md5Utils;
+
+import com.google.common.base.Strings;
+import org.springframework.stereotype.Component;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.CollectionUtils;
+
+import javax.annotation.Resource;
+
+import java.util.Collections;
+import java.util.List;
+import java.util.Objects;
+import java.util.stream.Collectors;
+
+@Component
+public class ScriptServiceImpl implements IScriptService {
+
+    @Resource
+    private IScriptDao scriptDaoImpl;
+
+    @Resource
+    private IScriptParamDao scriptParamDaoImpl;
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)

Review Comment:
   This transaction is not necessary here.



##########
seatunnel-server/seatunnel-app/src/main/java/org/apache/seatunnel/app/domain/dto/script/ListUserDto.java:
##########
@@ -0,0 +1,27 @@
+/*
+ * 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.seatunnel.app.domain.dto.script;

Review Comment:
   ```suggestion
   package org.apache.seatunnel.app.domain.dto.user;
   ```



##########
seatunnel-server/seatunnel-app/src/main/java/org/apache/seatunnel/app/common/JsonResult.java:
##########
@@ -0,0 +1,97 @@
+/*
+ * 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.seatunnel.app.common;
+
+public class JsonResult<T> {

Review Comment:
   Directly using Result here is better, someone will guess if there have xxResult.



##########
seatunnel-server/seatunnel-app/src/main/java/org/apache/seatunnel/app/controller/ScriptController.java:
##########
@@ -0,0 +1,104 @@
+/*
+ * 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.seatunnel.app.controller;
+
+import org.apache.seatunnel.app.common.JsonResult;
+import org.apache.seatunnel.app.domain.request.script.AddEmptyScriptReq;
+import org.apache.seatunnel.app.domain.request.script.ScriptListReq;
+import org.apache.seatunnel.app.domain.request.script.UpdateScriptContentReq;
+import org.apache.seatunnel.app.domain.request.script.UpdateScriptParamReq;
+import org.apache.seatunnel.app.domain.response.script.ScriptParamRes;
+import org.apache.seatunnel.app.domain.response.script.ScriptSimpleInfoRes;
+import org.apache.seatunnel.app.service.IScriptService;
+
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+import javax.validation.constraints.NotNull;
+
+import java.util.List;
+
+@RequestMapping("/script")

Review Comment:
   I suggest we can add v1 to all API URLs.



##########
seatunnel-server/seatunnel-app/src/main/java/org/apache/seatunnel/app/domain/request/user/AddUserReq.java:
##########
@@ -0,0 +1,24 @@
+/*
+ * 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.seatunnel.app.domain.request.user;
+
+import io.swagger.annotations.ApiModel;
+
+@ApiModel(value = "addUserReq", description = "add a new user request")
+public class AddUserReq extends BaseUserReq{

Review Comment:
   It's Ok to use different request class for CRUD, but in most time, there is no need to create so many class. In most of time you just send a User DTO to the back-end.



##########
seatunnel-server/seatunnel-app/src/main/java/org/apache/seatunnel/app/controller/ScriptController.java:
##########
@@ -0,0 +1,104 @@
+/*
+ * 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.seatunnel.app.controller;
+
+import org.apache.seatunnel.app.common.JsonResult;
+import org.apache.seatunnel.app.domain.request.script.AddEmptyScriptReq;
+import org.apache.seatunnel.app.domain.request.script.ScriptListReq;
+import org.apache.seatunnel.app.domain.request.script.UpdateScriptContentReq;
+import org.apache.seatunnel.app.domain.request.script.UpdateScriptParamReq;
+import org.apache.seatunnel.app.domain.response.script.ScriptParamRes;
+import org.apache.seatunnel.app.domain.response.script.ScriptSimpleInfoRes;
+import org.apache.seatunnel.app.service.IScriptService;
+
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+import javax.validation.constraints.NotNull;
+
+import java.util.List;
+
+@RequestMapping("/script")
+@RestController
+public class ScriptController {
+    @Resource
+    private IScriptService iScriptService;
+
+    @PostMapping("/addEmptyScript")
+    @ApiOperation(value = "add an empty script", httpMethod = "POST")
+    public JsonResult<Void> addEmptyScript(@RequestBody @NotNull AddEmptyScriptReq addEmptyScriptReq) {
+        iScriptService.addEmptyScript(addEmptyScriptReq);
+        return JsonResult.success();
+    }
+
+    @PostMapping("/updateScriptContent")

Review Comment:
   You can use PutMapping



##########
seatunnel-server/seatunnel-app/src/main/java/org/apache/seatunnel/app/dal/entity/ScriptParam.java:
##########
@@ -0,0 +1,92 @@
+/*
+ * 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.seatunnel.app.dal.entity;
+
+import java.util.Date;
+
+public class ScriptParam {
+    private Integer id;
+
+    private Integer scriptId;
+
+    private String key;
+
+    private String value;
+
+    private Byte status;

Review Comment:
   I think use` int` is enough.
   ```suggestion
       private Integer status;
   ```



##########
seatunnel-server/seatunnel-app/pom.xml:
##########
@@ -0,0 +1,165 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>seatunnel-server</artifactId>
+        <groupId>org.apache.seatunnel</groupId>
+        <version>${revision}</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>seatunnel-app</artifactId>
+
+    <properties>
+        <maven.compiler.source>8</maven.compiler.source>
+        <maven.compiler.target>8</maven.compiler.target>
+    </properties>
+
+    <dependencies>
+
+        <!--springboot-->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.springframework.boot</groupId>
+                    <artifactId>spring-boot-starter-tomcat</artifactId>
+                </exclusion>
+                <exclusion>
+                    <artifactId>log4j-to-slf4j</artifactId>
+                    <groupId>org.apache.logging.log4j</groupId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-jetty</artifactId>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.eclipse.jetty.websocket</groupId>
+                    <artifactId>javax-websocket-server-impl</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>org.eclipse.jetty.websocket</groupId>
+                    <artifactId>websocket-server</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+
+        <dependency>
+            <groupId>org.mybatis.spring.boot</groupId>
+            <artifactId>mybatis-spring-boot-starter</artifactId>
+            <version>${mybatis-spring-boot-starter.version}</version>
+            <exclusions>
+                <exclusion>
+                    <artifactId>spring-beans</artifactId>
+                    <groupId>org.springframework</groupId>
+                </exclusion>
+                <exclusion>
+                    <artifactId>spring-boot-autoconfigure</artifactId>
+                    <groupId>org.springframework.boot</groupId>
+                </exclusion>
+                <exclusion>
+                    <artifactId>spring-core</artifactId>
+                    <groupId>org.springframework</groupId>
+                </exclusion>
+                <exclusion>
+                    <artifactId>spring-boot-starter</artifactId>
+                    <groupId>org.springframework.boot</groupId>
+                </exclusion>
+                <exclusion>
+                    <artifactId>HikariCP</artifactId>
+                    <groupId>com.zaxxer</groupId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>druid-spring-boot-starter</artifactId>

Review Comment:
   Can we use HikariCP? This is the default datasource of springboot https://docs.spring.io/spring-boot/docs/current/reference/html/data.html#data.sql.datasource.connection-pool



##########
seatunnel-server/seatunnel-app/src/main/java/org/apache/seatunnel/app/SeatunnelApplication.java:
##########
@@ -0,0 +1,40 @@
+/*
+ * 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.seatunnel.app;
+
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
+import org.springframework.scheduling.annotation.EnableAsync;
+import org.springframework.scheduling.annotation.EnableScheduling;
+import org.springframework.transaction.annotation.EnableTransactionManagement;
+import org.springframework.web.bind.annotation.RestController;
+
+@SpringBootApplication(scanBasePackages = "org.apache.seatunnel")
+@EnableTransactionManagement
+@EnableConfigurationProperties
+@EnableScheduling
+@RestController
+@EnableAsync(proxyTargetClass = true)
+@MapperScan({"org.apache.seatunnel.app.dal"})

Review Comment:
   ```suggestion
   @SpringBootApplication()
   @EnableTransactionManagement
   @EnableConfigurationProperties
   @EnableScheduling
   @EnableAsync(proxyTargetClass = true)
   @MapperScan({"org.apache.seatunnel.app.dal"})
   ```



-- 
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@seatunnel.apache.org

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


[GitHub] [incubator-seatunnel] dijiekstra commented on a diff in pull request #2112: [seatunnel-1947][seatunnel-server] init & add interface for script/user

Posted by GitBox <gi...@apache.org>.
dijiekstra commented on code in PR #2112:
URL: https://github.com/apache/incubator-seatunnel/pull/2112#discussion_r912568581


##########
seatunnel-server/seatunnel-app/src/main/java/org/apache/seatunnel/app/controller/ScriptController.java:
##########
@@ -0,0 +1,106 @@
+/*
+ * 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.seatunnel.app.controller;
+
+import org.apache.seatunnel.app.common.Result;
+import org.apache.seatunnel.app.domain.request.script.AddEmptyScriptReq;
+import org.apache.seatunnel.app.domain.request.script.ScriptListReq;
+import org.apache.seatunnel.app.domain.request.script.UpdateScriptContentReq;
+import org.apache.seatunnel.app.domain.request.script.UpdateScriptParamReq;
+import org.apache.seatunnel.app.domain.response.script.ScriptParamRes;
+import org.apache.seatunnel.app.domain.response.script.ScriptSimpleInfoRes;
+import org.apache.seatunnel.app.service.IScriptService;
+
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+import javax.validation.constraints.NotNull;
+
+import java.util.List;
+
+@RequestMapping("/api/v1/script")
+@RestController
+public class ScriptController {
+    @Resource
+    private IScriptService iScriptService;
+
+    @PostMapping("/addEmptyScript")
+    @ApiOperation(value = "add an empty script", httpMethod = "POST")
+    public Result<Void> addEmptyScript(@RequestBody @NotNull AddEmptyScriptReq addEmptyScriptReq) {
+        iScriptService.addEmptyScript(addEmptyScriptReq);
+        return Result.success();
+    }
+
+    @PutMapping("/updateScriptContent")
+    @ApiOperation(value = "update script", httpMethod = "POST")
+    public Result<Void> updateScriptContent(@RequestBody @NotNull UpdateScriptContentReq updateScriptContentReq) {
+        iScriptService.updateScriptContent(updateScriptContentReq);
+        return Result.success();
+    }
+
+    @DeleteMapping("/delete")
+    @ApiOperation(value = "delete script", httpMethod = "POST")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id", value = "script id", dataType = "Integer"),
+    })
+    public Result<Void> delete(@RequestParam @NotNull Integer id) {
+        iScriptService.delete(id);
+        return Result.success();
+    }
+
+    @PostMapping("/list")
+    @ApiOperation(value = "script list", httpMethod = "POST")
+    public Result<List<ScriptSimpleInfoRes>> list(@RequestBody @NotNull ScriptListReq scriptListReq) {
+        return Result.success(iScriptService.list(scriptListReq));

Review Comment:
   OK, so I'm going to remove all the `verbs`
   



-- 
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@seatunnel.apache.org

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


[GitHub] [incubator-seatunnel] dijiekstra commented on a diff in pull request #2112: [seatunnel-1947][seatunnel-server] init & add interface for script/user

Posted by GitBox <gi...@apache.org>.
dijiekstra commented on code in PR #2112:
URL: https://github.com/apache/incubator-seatunnel/pull/2112#discussion_r912432132


##########
seatunnel-server/seatunnel-app/src/main/java/org/apache/seatunnel/app/dal/entity/ScriptParam.java:
##########
@@ -0,0 +1,92 @@
+/*
+ * 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.seatunnel.app.dal.entity;
+
+import java.util.Date;
+
+public class ScriptParam {
+    private Integer id;
+
+    private Integer scriptId;
+
+    private String key;
+
+    private String value;
+
+    private Byte status;

Review Comment:
   > I didn't see your table schema, in my knowledge, we can use tinyint for this field, tinyint only need 1 byte.
   
   Yes, I'm using tinyInt, which in JAVA type is Byte.
   
   I will show ddl after all entity's api been completed.



-- 
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@seatunnel.apache.org

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


[GitHub] [incubator-seatunnel] dijiekstra commented on a diff in pull request #2112: [seatunnel-1947][seatunnel-server] init & add interface for script/user

Posted by GitBox <gi...@apache.org>.
dijiekstra commented on code in PR #2112:
URL: https://github.com/apache/incubator-seatunnel/pull/2112#discussion_r913693028


##########
seatunnel-server/seatunnel-app/src/main/java/org/apache/seatunnel/app/controller/ScriptController.java:
##########
@@ -0,0 +1,106 @@
+/*
+ * 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.seatunnel.app.controller;
+
+import org.apache.seatunnel.app.common.Result;
+import org.apache.seatunnel.app.domain.request.script.AddEmptyScriptReq;
+import org.apache.seatunnel.app.domain.request.script.ScriptListReq;
+import org.apache.seatunnel.app.domain.request.script.UpdateScriptContentReq;
+import org.apache.seatunnel.app.domain.request.script.UpdateScriptParamReq;
+import org.apache.seatunnel.app.domain.response.script.AddEmptyScriptRes;
+import org.apache.seatunnel.app.domain.response.script.ScriptParamRes;
+import org.apache.seatunnel.app.domain.response.script.ScriptSimpleInfoRes;
+import org.apache.seatunnel.app.service.IScriptService;
+
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+import javax.validation.constraints.NotNull;
+
+import java.util.List;
+
+@RequestMapping("/api/v1/script")
+@RestController
+public class ScriptController {
+    @Resource
+    private IScriptService iScriptService;
+
+    @PostMapping("/script")
+    @ApiOperation(value = "add an empty script", httpMethod = "POST")
+    public Result<AddEmptyScriptRes> addEmptyScript(@RequestBody @NotNull AddEmptyScriptReq addEmptyScriptReq) {
+        return Result.success(iScriptService.addEmptyScript(addEmptyScriptReq));
+    }
+
+    @PutMapping("/scriptContent")
+    @ApiOperation(value = "update script", httpMethod = "POST")
+    public Result<Void> updateScriptContent(@RequestBody @NotNull UpdateScriptContentReq updateScriptContentReq) {
+        iScriptService.updateScriptContent(updateScriptContentReq);
+        return Result.success();
+    }
+
+    @DeleteMapping("/script")
+    @ApiOperation(value = "delete script", httpMethod = "POST")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id", value = "script id", dataType = "Integer"),
+    })
+    public Result<Void> delete(@RequestParam @NotNull Integer id) {
+        iScriptService.delete(id);
+        return Result.success();
+    }
+
+    @PostMapping("/list")
+    @ApiOperation(value = "script list", httpMethod = "POST")
+    public Result<List<ScriptSimpleInfoRes>> list(@RequestBody @NotNull ScriptListReq scriptListReq) {
+        return Result.success(iScriptService.list(scriptListReq));
+    }
+
+    @GetMapping("/scriptContent")
+    @ApiOperation(value = "fetch script content", httpMethod = "POST")
+    @ApiImplicitParams({

Review Comment:
   DONE.



-- 
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@seatunnel.apache.org

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


[GitHub] [incubator-seatunnel] dijiekstra commented on a diff in pull request #2112: [seatunnel-1947][seatunnel-server] init & add interface for script/user

Posted by GitBox <gi...@apache.org>.
dijiekstra commented on code in PR #2112:
URL: https://github.com/apache/incubator-seatunnel/pull/2112#discussion_r912356649


##########
seatunnel-server/seatunnel-app/src/main/java/org/apache/seatunnel/app/domain/request/user/AddUserReq.java:
##########
@@ -0,0 +1,24 @@
+/*
+ * 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.seatunnel.app.domain.request.user;
+
+import io.swagger.annotations.ApiModel;
+
+@ApiModel(value = "addUserReq", description = "add a new user request")
+public class AddUserReq extends BaseUserReq{

Review Comment:
   If you use the same Class, it can be confusing for the front end or other API users
   
   



-- 
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@seatunnel.apache.org

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


[GitHub] [incubator-seatunnel] CalvinKirs commented on a diff in pull request #2112: [seatunnel-1947][seatunnel-server] init & add interface for script/user

Posted by GitBox <gi...@apache.org>.
CalvinKirs commented on code in PR #2112:
URL: https://github.com/apache/incubator-seatunnel/pull/2112#discussion_r912563663


##########
seatunnel-server/seatunnel-app/src/main/java/org/apache/seatunnel/app/controller/ScriptController.java:
##########
@@ -0,0 +1,106 @@
+/*
+ * 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.seatunnel.app.controller;
+
+import org.apache.seatunnel.app.common.Result;
+import org.apache.seatunnel.app.domain.request.script.AddEmptyScriptReq;
+import org.apache.seatunnel.app.domain.request.script.ScriptListReq;
+import org.apache.seatunnel.app.domain.request.script.UpdateScriptContentReq;
+import org.apache.seatunnel.app.domain.request.script.UpdateScriptParamReq;
+import org.apache.seatunnel.app.domain.response.script.ScriptParamRes;
+import org.apache.seatunnel.app.domain.response.script.ScriptSimpleInfoRes;
+import org.apache.seatunnel.app.service.IScriptService;
+
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+import javax.validation.constraints.NotNull;
+
+import java.util.List;
+
+@RequestMapping("/api/v1/script")
+@RestController
+public class ScriptController {
+    @Resource
+    private IScriptService iScriptService;
+
+    @PostMapping("/addEmptyScript")
+    @ApiOperation(value = "add an empty script", httpMethod = "POST")
+    public Result<Void> addEmptyScript(@RequestBody @NotNull AddEmptyScriptReq addEmptyScriptReq) {
+        iScriptService.addEmptyScript(addEmptyScriptReq);
+        return Result.success();
+    }
+
+    @PutMapping("/updateScriptContent")
+    @ApiOperation(value = "update script", httpMethod = "POST")
+    public Result<Void> updateScriptContent(@RequestBody @NotNull UpdateScriptContentReq updateScriptContentReq) {
+        iScriptService.updateScriptContent(updateScriptContentReq);
+        return Result.success();
+    }
+
+    @DeleteMapping("/delete")
+    @ApiOperation(value = "delete script", httpMethod = "POST")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id", value = "script id", dataType = "Integer"),
+    })
+    public Result<Void> delete(@RequestParam @NotNull Integer id) {
+        iScriptService.delete(id);
+        return Result.success();
+    }
+
+    @PostMapping("/list")
+    @ApiOperation(value = "script list", httpMethod = "POST")
+    public Result<List<ScriptSimpleInfoRes>> list(@RequestBody @NotNull ScriptListReq scriptListReq) {
+        return Result.success(iScriptService.list(scriptListReq));

Review Comment:
   We use the standard Restful style, so the operation methods of add and delete will not need to be reflected in the Url



-- 
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@seatunnel.apache.org

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


[GitHub] [incubator-seatunnel] github-code-scanning[bot] commented on a diff in pull request #2112: [seatunnel-1947][seatunnel-server] init & add interface for script/user

Posted by GitBox <gi...@apache.org>.
github-code-scanning[bot] commented on code in PR #2112:
URL: https://github.com/apache/incubator-seatunnel/pull/2112#discussion_r913115820


##########
seatunnel-server/seatunnel-app/src/main/java/org/apache/seatunnel/app/util/Md5Utils.java:
##########
@@ -0,0 +1,66 @@
+/*
+ * 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.seatunnel.app.util;
+
+import java.security.MessageDigest;
+
+public class Md5Utils {
+    private static final String[] HEX_DIGITS = new String[]{"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"};
+
+    public Md5Utils() {
+    }
+
+    public static String byteArrayToHexString(byte[] b) {
+        StringBuilder resultSb = new StringBuilder();
+        byte[] var2 = b;
+        int var3 = b.length;
+
+        for (int var4 = 0; var4 < var3; ++var4) {
+            byte aB = var2[var4];
+            resultSb.append(byteToHexString(aB));
+        }
+
+        return resultSb.toString();
+    }
+
+    @SuppressWarnings("magicnumber")
+    private static String byteToHexString(byte b) {
+        int n = b;
+        if (b < 0) {
+            n = 256 + b;
+        }
+
+        int d1 = n / 16;
+        int d2 = n % 16;
+        return HEX_DIGITS[d1] + HEX_DIGITS[d2];
+    }
+
+    public static String md5Encode(String origin) {
+        String resultString = null;
+        String charsetname = "UTF-8";
+
+        try {
+            MessageDigest md = MessageDigest.getInstance("MD5");

Review Comment:
   ## Use of a broken or risky cryptographic algorithm
   
   Cryptographic algorithm [MD5](1) is weak and should not be used.
   
   [Show more details](https://github.com/apache/incubator-seatunnel/security/code-scanning/6)



-- 
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@seatunnel.apache.org

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


[GitHub] [incubator-seatunnel] dijiekstra commented on a diff in pull request #2112: [seatunnel-1947][seatunnel-server] init & add interface for script/user

Posted by GitBox <gi...@apache.org>.
dijiekstra commented on code in PR #2112:
URL: https://github.com/apache/incubator-seatunnel/pull/2112#discussion_r913320269


##########
seatunnel-server/seatunnel-app/src/main/java/org/apache/seatunnel/app/util/Md5Utils.java:
##########
@@ -0,0 +1,66 @@
+/*
+ * 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.seatunnel.app.util;
+
+import java.security.MessageDigest;
+
+public class Md5Utils {
+    private static final String[] HEX_DIGITS = new String[]{"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"};
+
+    public Md5Utils() {
+    }
+
+    public static String byteArrayToHexString(byte[] b) {
+        StringBuilder resultSb = new StringBuilder();
+        byte[] var2 = b;
+        int var3 = b.length;
+
+        for (int var4 = 0; var4 < var3; ++var4) {
+            byte aB = var2[var4];
+            resultSb.append(byteToHexString(aB));
+        }
+
+        return resultSb.toString();
+    }
+
+    @SuppressWarnings("magicnumber")
+    private static String byteToHexString(byte b) {
+        int n = b;
+        if (b < 0) {
+            n = 256 + b;
+        }
+
+        int d1 = n / 16;
+        int d2 = n % 16;
+        return HEX_DIGITS[d1] + HEX_DIGITS[d2];
+    }
+
+    public static String md5Encode(String origin) {
+        String resultString = null;
+        String charsetname = "UTF-8";
+
+        try {
+            MessageDigest md = MessageDigest.getInstance("MD5");

Review Comment:
   It's not an encryption. It just calculate md5 value of a string 



-- 
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@seatunnel.apache.org

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