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 07:53:26 UTC

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

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 b838b750d [Feat][UI] Add user service in the project. (#2442)
b838b750d is described below

commit b838b750d6f9f639e16830ee016117c0aea09c23
Author: songjianet <17...@qq.com>
AuthorDate: Wed Aug 17 15:53:19 2022 +0800

    [Feat][UI] Add user service in the project. (#2442)
---
 seatunnel-ui/src/service/user/index.ts | 67 ++++++++++++++++++++++++++++++++++
 seatunnel-ui/src/service/user/types.ts | 39 ++++++++++++++++++++
 2 files changed, 106 insertions(+)

diff --git a/seatunnel-ui/src/service/user/index.ts b/seatunnel-ui/src/service/user/index.ts
new file mode 100644
index 000000000..809d12371
--- /dev/null
+++ b/seatunnel-ui/src/service/user/index.ts
@@ -0,0 +1,67 @@
+/*
+ * 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 { UserList, UserAdd, UserUpdate } from '@/service/user/types'
+
+export function userDisable(id: number): any {
+  return axios({
+    url: '/user/disable',
+    method: 'put',
+    data: { id }
+  })
+}
+
+export function userEnable(id: number): any {
+  return axios({
+    url: '/user/enable',
+    method: 'put',
+    data: { id }
+  })
+}
+
+export function userList(userListReq: UserList): any {
+  return axios({
+    url: '/user/list',
+    method: 'post',
+    data: { userListReq }
+  })
+}
+
+export function userDelete(id: number): any {
+  return axios({
+    url: '/user/user',
+    method: 'delete',
+    data: { id }
+  })
+}
+
+export function userAdd(addReq: UserAdd): any {
+  return axios({
+    url: '/user/user',
+    method: 'post',
+    data: { addReq }
+  })
+}
+
+export function userUpdate(updateReq: UserUpdate): any {
+  return axios({
+    url: '/user/user',
+    method: 'put',
+    data: { updateReq }
+  })
+}
\ No newline at end of file
diff --git a/seatunnel-ui/src/service/user/types.ts b/seatunnel-ui/src/service/user/types.ts
new file mode 100644
index 000000000..cef3768b0
--- /dev/null
+++ b/seatunnel-ui/src/service/user/types.ts
@@ -0,0 +1,39 @@
+/*
+ * 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 UserList {
+  name: string
+  pageNo: number
+  pageSize: number
+}
+
+interface UserAdd {
+  password: string
+  status: string
+  type: string
+  username: string
+}
+
+interface UserUpdate extends UserAdd {
+  id: number
+}
+
+export {
+  UserList,
+  UserAdd,
+  UserUpdate
+}
\ No newline at end of file