This is an automated email from the ASF dual-hosted git repository.
benjobs pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-streampark.git
The following commit(s) were added to refs/heads/dev by this push:
new a909bf38b [Feature] Add an interface that returns all variables to
support a better user experience when referencing variables on the front end
(#1923)
a909bf38b is described below
commit a909bf38b91653882fd6c037c516efc463a76684
Author: macksonmu <[email protected]>
AuthorDate: Fri Oct 28 23:23:18 2022 +0800
[Feature] Add an interface that returns all variables to support a better
user experience when referencing variables on the front end (#1923)
* [Feature] Add an interface that returns all variables to support a better
user experience when referencing variables on the front end #1780
---
.../core/controller/VariableController.java | 24 +++++++++++++++++-----
1 file changed, 19 insertions(+), 5 deletions(-)
diff --git
a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/controller/VariableController.java
b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/controller/VariableController.java
index 2c7e9d722..ce52a0bea 100644
---
a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/controller/VariableController.java
+++
b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/controller/VariableController.java
@@ -39,6 +39,8 @@ import org.springframework.web.bind.annotation.RestController;
import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
+import java.util.List;
+
@Slf4j
@Validated
@RestController
@@ -48,6 +50,12 @@ public class VariableController {
@Autowired
private VariableService variableService;
+ /**
+ * Get variable list by page.
+ * @param restRequest
+ * @param variable
+ * @return
+ */
@PostMapping("list")
@RequiresPermissions("variable:view")
public RestResponse variableList(RestRequest restRequest, Variable
variable) {
@@ -55,6 +63,17 @@ public class VariableController {
return RestResponse.success(variableList);
}
+ /**
+ * Get all variables under the current team.
+ * @param teamId
+ * @return
+ */
+ @PostMapping("all")
+ public RestResponse all(@RequestParam Long teamId) {
+ List<Variable> variableList = variableService.findByTeamId(teamId);
+ return RestResponse.success(variableList);
+ }
+
@PostMapping("dependApps")
@RequiresPermissions("variable:dependApps")
public RestResponse dependApps(RestRequest restRequest, Variable variable)
{
@@ -98,9 +117,4 @@ public class VariableController {
boolean result = this.variableService.findByVariableCode(teamId,
variableCode) == null;
return RestResponse.success(result);
}
-
- @PostMapping("select")
- public RestResponse selectVariables(@RequestParam Long teamId) {
- return
RestResponse.success().data(this.variableService.findByTeamId(teamId));
- }
}