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/16 13:42:17 UTC
[incubator-seatunnel] branch dev updated: [Feat][UI] Add script service in the project. (#2433)
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 e751f21ac [Feat][UI] Add script service in the project. (#2433)
e751f21ac is described below
commit e751f21acd8eb0627b79be3a400ba22b6821f605
Author: songjianet <17...@qq.com>
AuthorDate: Tue Aug 16 21:42:12 2022 +0800
[Feat][UI] Add script service in the project. (#2433)
---
seatunnel-ui/src/service/script/index.ts | 93 ++++++++++++++++++++++++++++++++
seatunnel-ui/src/service/script/types.ts | 53 ++++++++++++++++++
2 files changed, 146 insertions(+)
diff --git a/seatunnel-ui/src/service/script/index.ts b/seatunnel-ui/src/service/script/index.ts
new file mode 100644
index 000000000..d9525f89f
--- /dev/null
+++ b/seatunnel-ui/src/service/script/index.ts
@@ -0,0 +1,93 @@
+/*
+ * 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 {
+ ScriptList,
+ ScriptPublish,
+ ScriptAdd,
+ ScriptContentUpdate,
+ ScriptParamUpdate
+} from '@/service/script/types'
+
+export function scriptList(scriptListReq: ScriptList): any {
+ return axios({
+ url: '/script/list',
+ method: 'post',
+ data: { scriptListReq }
+ })
+}
+
+export function scriptPublish(req: ScriptPublish): any {
+ return axios({
+ url: '/script/publish',
+ method: 'put',
+ data: { req }
+ })
+}
+
+export function scriptDelete(id: number): any {
+ return axios({
+ url: '/script/script',
+ method: 'delete',
+ data: { id }
+ })
+}
+
+export function scriptAdd(addEmptyScriptReq: ScriptAdd): any {
+ return axios({
+ url: '/script/script',
+ method: 'post',
+ data: { addEmptyScriptReq }
+ })
+}
+
+export function scriptContent(id: number): any {
+ return axios({
+ url: '/script/scriptContent',
+ method: 'get',
+ data: { id }
+ })
+}
+
+export function scriptContentUpdate(
+ updateScriptContentReq: ScriptContentUpdate
+): any {
+ return axios({
+ url: '/script/scriptContent',
+ method: 'put',
+ data: { updateScriptContentReq }
+ })
+}
+
+export function scriptParam(id: number): any {
+ return axios({
+ url: '/script/scriptParam',
+ method: 'get',
+ data: { id }
+ })
+}
+
+export function scriptParamUpdate(
+ updateScriptParamReq: ScriptParamUpdate
+): any {
+ return axios({
+ url: '/script/scriptParam',
+ method: 'put',
+ data: { updateScriptParamReq }
+ })
+}
diff --git a/seatunnel-ui/src/service/script/types.ts b/seatunnel-ui/src/service/script/types.ts
new file mode 100644
index 000000000..985563e72
--- /dev/null
+++ b/seatunnel-ui/src/service/script/types.ts
@@ -0,0 +1,53 @@
+/*
+ * 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 ScriptList {
+ name: string
+ pageNo: number
+ pageSize: number
+ status: string
+}
+
+interface ScriptPublish {
+ operatorId: number
+ scriptId: number
+}
+
+interface ScriptAdd {
+ creatorId: number
+ name: string
+ type: string
+}
+
+interface ScriptContentUpdate {
+ content: string
+ id: number
+ menderId: number
+}
+
+interface ScriptParamUpdate {
+ params: object
+ scriptId: number
+}
+
+export {
+ ScriptList,
+ ScriptPublish,
+ ScriptAdd,
+ ScriptContentUpdate,
+ ScriptParamUpdate
+}