You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by zh...@apache.org on 2022/08/17 05:06:01 UTC

[incubator-seatunnel] branch dev updated: [Feat][UI] Add task service in the project. (#2438)

This is an automated email from the ASF dual-hosted git repository.

zhongjiajie pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-seatunnel.git


The following commit(s) were added to refs/heads/dev by this push:
     new b620df46c [Feat][UI] Add task service in the project. (#2438)
b620df46c is described below

commit b620df46cfedc7ffd28bafea05fc513f255ebfa7
Author: songjianet <17...@qq.com>
AuthorDate: Wed Aug 17 13:05:56 2022 +0800

    [Feat][UI] Add task service in the project. (#2438)
---
 seatunnel-ui/src/service/task/index.ts | 56 ++++++++++++++++++++++++++++++++++
 seatunnel-ui/src/service/task/types.ts | 46 ++++++++++++++++++++++++++++
 2 files changed, 102 insertions(+)

diff --git a/seatunnel-ui/src/service/task/index.ts b/seatunnel-ui/src/service/task/index.ts
new file mode 100644
index 000000000..29d409797
--- /dev/null
+++ b/seatunnel-ui/src/service/task/index.ts
@@ -0,0 +1,56 @@
+/*
+ * 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.
+ */
+
+import { axios } from '@/service/service'
+import type {
+  TaskList,
+  TaskJobList,
+  TaskRecycle,
+  TaskTmpExecute
+} from '@/service/task/types'
+
+export function taskList(req: TaskList): any {
+  return axios({
+    url: '/task/listInstance',
+    method: 'get',
+    params: { req }
+  })
+}
+
+export function taskJobList(req: TaskJobList): any {
+  return axios({
+    url: '/task/listJob',
+    method: 'get',
+    params: { req }
+  })
+}
+
+export function taskRecycle(req: TaskRecycle): any {
+  return axios({
+    url: '/task/recycle',
+    method: 'put',
+    data: { req }
+  })
+}
+
+export function taskTmpExecute(req: TaskTmpExecute): any {
+  return axios({
+    url: '/task/tmpExecute',
+    method: 'get',
+    params: { req }
+  })
+}
diff --git a/seatunnel-ui/src/service/task/types.ts b/seatunnel-ui/src/service/task/types.ts
new file mode 100644
index 000000000..290d61546
--- /dev/null
+++ b/seatunnel-ui/src/service/task/types.ts
@@ -0,0 +1,46 @@
+/*
+ * 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.
+ */
+
+interface TaskList {
+  name: string
+  pageNo: number
+  pageSize: number
+}
+
+interface TaskJobList {
+  name: string
+  pageNo: number
+  pageSize: number
+}
+
+interface TaskRecycle {
+  scriptId: number
+  operatorId: number
+}
+
+interface TaskTmpExecute {
+  content: string
+  endTime: string
+  executeType: number
+  operatorId: number
+  parallelismNum: number
+  params: object
+  scriptId: number
+  startTime: string
+}
+
+export { TaskList, TaskJobList, TaskRecycle, TaskTmpExecute }