diff --git a/dolphinscheduler-ui-next/src/service/modules/process-instances/index.ts b/dolphinscheduler-ui-next/src/service/modules/process-instances/index.ts index 3e7c6c26f5..832262b427 100644 --- a/dolphinscheduler-ui-next/src/service/modules/process-instances/index.ts +++ b/dolphinscheduler-ui-next/src/service/modules/process-instances/index.ts @@ -14,3 +14,98 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + +import { axios } from '@/service/service' +import { + CodeReq, + ProcessInstanceListReq, + BatchDeleteReq, + SubIdReq, + TaskReq, + LongestReq, + IdReq, + ProcessInstanceReq +} from './types' + +export function queryProcessInstanceListPaging(params: ProcessInstanceListReq, code: CodeReq): any { + return axios({ + url: `/projects/${code}/process-instances`, + method: 'get', + params, + }) +} + +export function batchDeleteProcessInstanceByIds(data: BatchDeleteReq, code: CodeReq): any { + return axios({ + url: `/projects/${code}/process-instances/batch-delete`, + method: 'post', + data, + }) +} + +export function queryParentInstanceBySubId(params: SubIdReq, code: CodeReq): any { + return axios({ + url: `/projects/${code}/process-instances/query-parent-by-sub`, + method: 'get', + params, + }) +} + +export function querySubProcessInstanceByTaskCode(params: TaskReq, code: CodeReq): any { + return axios({ + url: `/projects/${code}/process-instances/query-sub-by-parent`, + method: 'get', + params, + }) +} + +export function queryTopNLongestRunningProcessInstance(params: LongestReq, code: CodeReq): any { + return axios({ + url: `/projects/${code}/process-instances/top-n`, + method: 'get', + params, + }) +} + +export function queryProcessInstanceById(id: IdReq, code: CodeReq): any { + return axios({ + url: `/projects/${code}/process-instances/${id}`, + method: 'get', + }) +} + +export function updateProcessInstance(data: ProcessInstanceReq, id: IdReq, code: CodeReq): any { + return axios({ + url: `/projects/${code}/process-instances/${id}`, + method: 'put', + data + }) +} + +export function deleteProcessInstanceById(id: IdReq, code: CodeReq): any { + return axios({ + url: `/projects/${code}/process-instances/${id}`, + method: 'delete', + }) +} + +export function queryTaskListByProcessId(id: IdReq, code: CodeReq): any { + return axios({ + url: `/projects/${code}/process-instances/${id}/tasks`, + method: 'get', + }) +} + +export function vieGanttTree(id: IdReq, code: CodeReq): any { + return axios({ + url: `/projects/${code}/process-instances/${id}/view-gantt`, + method: 'get', + }) +} + +export function viewVariables(id: IdReq, code: CodeReq): any { + return axios({ + url: `/projects/${code}/process-instances/${id}/view-variables`, + method: 'get', + }) +} diff --git a/dolphinscheduler-ui-next/src/service/modules/process-instances/types.ts b/dolphinscheduler-ui-next/src/service/modules/process-instances/types.ts index 12bee2f860..488a142b88 100644 --- a/dolphinscheduler-ui-next/src/service/modules/process-instances/types.ts +++ b/dolphinscheduler-ui-next/src/service/modules/process-instances/types.ts @@ -69,3 +69,26 @@ interface LongestReq { interface IdReq { id: number } + +interface ProcessInstanceReq { + syncDefine: string + flag?: string + globalParams?: string + locations?: string + scheduleTime?: string + taskDefinitionJson?: string + taskRelationJson?: string + tenantCode?: string + timeout?: string +} + +export { + CodeReq, + ProcessInstanceListReq, + BatchDeleteReq, + SubIdReq, + TaskReq, + LongestReq, + IdReq, + ProcessInstanceReq +} diff --git a/dolphinscheduler-ui-next/src/service/modules/projects/index.ts b/dolphinscheduler-ui-next/src/service/modules/projects/index.ts new file mode 100644 index 0000000000..43c22911e8 --- /dev/null +++ b/dolphinscheduler-ui-next/src/service/modules/projects/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 { + ListReq, + ProjectsReq, + UserIdReq, + CodeReq, + UpdateProjectsReq +} from './types' + +export function queryProjectListPaging(params: ListReq): any { + return axios({ + url: `/projects`, + method: 'get', + params, + }) +} + +export function createProject(data: ProjectsReq): any { + return axios({ + url: `/projects`, + method: 'post', + data, + }) +} + +export function queryAuthorizedProject(params: UserIdReq): any { + return axios({ + url: `/projects/authed-project`, + method: 'get', + params, + }) +} + +export function queryProjectCreatedAndAuthorizedByUser(): any { + return axios({ + url: `/projects/created-and-authed`, + method: 'get', + }) +} + +export function queryAllProjectList(): any { + return axios({ + url: `/projects/list`, + method: 'get', + }) +} + +export function queryUnauthorizedProject(params: UserIdReq): any { + return axios({ + url: `/projects/unauth-project`, + method: 'get', + params + }) +} + +export function queryProjectByCode(code: CodeReq): any { + return axios({ + url: `/projects/${code}`, + method: 'get', + }) +} + +export function updateProject(data: UpdateProjectsReq, code: CodeReq): any { + return axios({ + url: `/projects/${code}`, + method: 'put', + data + }) +} + +export function deleteProject(code: CodeReq): any { + return axios({ + url: `/projects/${code}`, + method: 'delete', + }) +} diff --git a/dolphinscheduler-ui-next/src/service/modules/projects/types.ts b/dolphinscheduler-ui-next/src/service/modules/projects/types.ts new file mode 100644 index 0000000000..288f1c129f --- /dev/null +++ b/dolphinscheduler-ui-next/src/service/modules/projects/types.ts @@ -0,0 +1,47 @@ +/* + * 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 ListReq { + pageNo: number + pageSize: number + searchVal?: string +} + +interface ProjectsReq { + description?: string + projectName?: string +} + +interface UserIdReq { + userId?: number +} + +interface CodeReq { + code: number +} + +interface UpdateProjectsReq extends ProjectsReq { + userName?: string +} + +export { + ListReq, + ProjectsReq, + UserIdReq, + CodeReq, + UpdateProjectsReq +} diff --git a/dolphinscheduler-ui-next/src/service/modules/queues/index.ts b/dolphinscheduler-ui-next/src/service/modules/queues/index.ts new file mode 100644 index 0000000000..32e17c5201 --- /dev/null +++ b/dolphinscheduler-ui-next/src/service/modules/queues/index.ts @@ -0,0 +1,58 @@ +/* + * 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 {ListReq, QueueReq, IdReq} from './types' + +export function queryQueueListPaging(params: ListReq): any { + return axios({ + url: `/queues`, + method: 'get', + params + }) +} + +export function createQueue(data: QueueReq): any { + return axios({ + url: `/queues`, + method: 'post', + data + }) +} + +export function queryList(): any { + return axios({ + url: `/queues/list`, + method: 'get', + }) +} + +export function verifyQueue(data: QueueReq): any { + return axios({ + url: `/queues/verify`, + method: 'post', + data + }) +} + +export function updateQueue(data: QueueReq, id: IdReq): any { + return axios({ + url: `/queues/${id}`, + method: 'put', + data + }) +} diff --git a/dolphinscheduler-ui-next/src/service/modules/queues/types.ts b/dolphinscheduler-ui-next/src/service/modules/queues/types.ts new file mode 100644 index 0000000000..f214bfab36 --- /dev/null +++ b/dolphinscheduler-ui-next/src/service/modules/queues/types.ts @@ -0,0 +1,33 @@ +/* + * 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 ListReq { + pageNo: number + pageSize: number + searchVal?: string +} + +interface QueueReq { + queue: string + queueName: string +} + +interface IdReq { + id: number +} + +export { ListReq, QueueReq, IdReq } diff --git a/dolphinscheduler-ui-next/src/service/modules/resources/index.ts b/dolphinscheduler-ui-next/src/service/modules/resources/index.ts new file mode 100644 index 0000000000..3e7c6c26f5 --- /dev/null +++ b/dolphinscheduler-ui-next/src/service/modules/resources/index.ts @@ -0,0 +1,16 @@ +/* + * 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. + */ diff --git a/dolphinscheduler-ui-next/src/service/modules/resources/types.ts b/dolphinscheduler-ui-next/src/service/modules/resources/types.ts new file mode 100644 index 0000000000..b98d0f7f16 --- /dev/null +++ b/dolphinscheduler-ui-next/src/service/modules/resources/types.ts @@ -0,0 +1,55 @@ +/* + * 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 FileReq { + file: any +} + +interface TypeReq { + type: 'FILE' | 'UDF' +} + +interface NameReqReq { + name: string +} + +interface FileNameReq { + fileName: string +} + +interface ListReq { + id: number + pageNo: number + pageSize: number + type: 'FILE' | 'UDF' + searchVal?: string +} + +interface CreateReq extends TypeReq { + currentDir: string + pid: number + description?: string +} + +interface UserIdReq { + userId: number +} + +interface OnlineCreateReq extends CreateReq { + content: string + suffix: string +}