diff --git a/data-processing/data_manipulation/common/config.py b/data-processing/data_manipulation/common/config.py index 6a21b72a8..1a0755b77 100644 --- a/data-processing/data_manipulation/common/config.py +++ b/data-processing/data_manipulation/common/config.py @@ -22,3 +22,6 @@ # zhipuai api_key zhipuai_api_key = os.getenv('ZHIPUAI_API_KEY', 'xxxxx') + +knowledge_chunk_size = os.getenv("KNOWLEDGE_CHUNK_SIZE", 500) +knowledge_chunk_overlap = os.getenv("KNOWLEDGE_CHUNK_OVERLAP", 50) \ No newline at end of file diff --git a/data-processing/data_manipulation/file_handle/csv_handle.py b/data-processing/data_manipulation/file_handle/csv_handle.py index d1a8de73f..d2c78f38c 100644 --- a/data-processing/data_manipulation/file_handle/csv_handle.py +++ b/data-processing/data_manipulation/file_handle/csv_handle.py @@ -65,8 +65,6 @@ async def text_manipulate(opt={}): # 获取CSV文件的内容 data = pd.read_csv(file_path) - logger.info('data') - logger.info("start text manipulate!") text_data = data['prompt'] @@ -81,7 +79,7 @@ async def text_manipulate(opt={}): return clean_result text_data = clean_result['data'] - + # 将清洗后的文件保存为final new_file_name = await file_utils.get_file_name({ 'file_name': file_name, @@ -117,6 +115,8 @@ async def text_manipulate(opt={}): # content: # 1) 基本功能实现 ### + + async def data_clean(opt={}): logger.info("csv text data clean start!") support_type = opt['support_type'] @@ -138,7 +138,9 @@ async def data_clean(opt={}): } clean_data.append(result['data']) + data = clean_data + data.insert(0, ['prompt']) # 将文件存为middle file_name = await file_utils.get_file_name({ @@ -171,6 +173,8 @@ async def data_clean(opt={}): # content: # 1) 基本功能实现 ### + + async def remove_invisible_characters(opt={}): return await clean_transform.remove_invisible_characters({ 'text': opt['text'] @@ -221,10 +225,6 @@ async def save_csv(opt={}): with open(file_path, 'w', newline='') as file: writer = csv.writer(file) - - writer.writerow(['prompt']) - - for row in data: - writer.writerow([row]) + writer.writerows(data) return file_path diff --git a/data-processing/data_manipulation/file_handle/pdf_handle.py b/data-processing/data_manipulation/file_handle/pdf_handle.py new file mode 100644 index 000000000..7739aa68d --- /dev/null +++ b/data-processing/data_manipulation/file_handle/pdf_handle.py @@ -0,0 +1,237 @@ +# Copyright 2023 KubeAGI. +# +# Licensed 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. + +### +# PDF文件处理 +# @author: wangxinbiao +# @date: 2023-11-01 16:43:01 +# modify history +# ==== 2023-11-01 16:43:01 ==== +# author: wangxinbiao +# content: +# 1) 基本功能实现 +### + +import logging +import os +import pandas as pd + +from common import config +from file_handle import csv_handle +from langchain.document_loaders import PyPDFLoader +from langchain.text_splitter import SpacyTextSplitter +from pypdf import PdfReader +from transform.text import clean_transform, privacy_transform, QA_transform +from utils import file_utils + + + +logger = logging.getLogger('pdf_handle') + +### +# 文本数据处理 +# @author: wangxinbiao +# @date: 2023-11-17 16:14:01 +# modify history +# ==== 2023-11-17 16:14:01 ==== +# author: wangxinbiao +# content: +# 1) 基本功能实现 +### + + +async def text_manipulate(request, opt={}): + logger.info("pdf text manipulate!") + + """ + 数据处理逻辑: + 处理某条数据时,如果某个方式(比如:去除不可见字符)处理失败了,则直接结束,不在处理,整个文件都视作处理失败 + + """ + + try: + + file_name = opt['file_name'] + support_type = opt['support_type'] + + pdf_file_path = await file_utils.get_temp_file_path() + file_path = pdf_file_path + 'original/' + file_name + + + # 获取PDF文件的内容 + content = await get_content({ + "file_path": file_path + }) + + logger.info("start text manipulate!") + + # 数据清洗 + clean_result = await data_clean({ + 'support_type': support_type, + 'file_name': file_name, + 'data': content + }) + + if clean_result['status'] != 200: + return clean_result + + content = clean_result['data'] + + # 去隐私 + + + # QA拆分 + if 'qa_split' in support_type: + qa_data = await generate_QA(request, { + 'support_type': support_type, + 'data': content + }) + + # 将生成的QA数据保存为CSV文件 + new_file_name = await file_utils.get_file_name({ + 'file_name': file_name, + 'handle_name': 'final' + }) + + file_name_without_extension = file_name.rsplit('.', 1)[0] + + await csv_handle.save_csv({ + 'file_name': file_name_without_extension + '.csv', + 'phase_value': 'final', + 'data': qa_data + }) + + return { + 'status': 200, + 'message': '', + 'data': '' + } + except Exception as ex: + return { + 'status': 400, + 'message': '', + 'data': '' + } + +### +# 数据异常清洗 +# @author: wangxinbiao +# @date: 2023-11-17 16:14:01 +# modify history +# ==== 2023-11-17 16:14:01 ==== +# author: wangxinbiao +# content: +# 1) 基本功能实现 +### + + +async def data_clean(opt={}): + logger.info("pdf text data clean start!") + support_type = opt['support_type'] + data = opt['data'] + + # 去除不可见字符 + if 'remove_invisible_characters' in support_type: + result = await clean_transform.remove_invisible_characters({ + 'text': data + }) + + if result['status'] != 200: + return { + 'status': 400, + 'message': '去除不可见字符失败', + 'data': '' + } + + data = result['data'] + + logger.info("pdf text data clean stop!") + + return { + 'status': 200, + 'message': '', + 'data': data + } + + +### +# 获取PDF内容 +# @author: wangxinbiao +# @date: 2023-11-17 16:14:01 +# modify history +# ==== 2023-11-17 16:14:01 ==== +# author: wangxinbiao +# content: +# 1) 基本功能实现 +### + + +async def get_content(opt={}): + file_path = opt['file_path'] + + reader = PdfReader(file_path) + number_of_pages = len(reader.pages) + pages = reader.pages + content = "" + for page in pages: + content += page.extract_text() + + return content + +### +# QA拆分 +# @author: wangxinbiao +# @date: 2023-11-17 16:14:01 +# modify history +# ==== 2023-11-17 16:14:01 ==== +# author: wangxinbiao +# content: +# 1) 基本功能实现 +### + + +async def generate_QA(request, opt={}): + request_json = request.json + + # 文本分段 + chunk_size = config.knowledge_chunk_size + if "chunk_size" in request_json: + chunk_size = request_json['chunk_size'] + + chunk_overlap = config.knowledge_chunk_overlap + if "chunk_overlap" in request_json: + chunk_overlap = request_json['chunk_overlap'] + + separator = "\n\n" + + text_splitter = SpacyTextSplitter( + separator=separator, + pipeline="zh_core_web_sm", + chunk_size=chunk_size, + chunk_overlap=chunk_overlap, + ) + texts = text_splitter.split_text(opt['data']) + + # 生成QA + qa_list = [['q', 'a']] + + for item in texts: + text = item.replace("\n", "") + data = await QA_transform.generate_QA({ + 'text': text + }) + + qa_list.extend(data) + + return qa_list diff --git a/data-processing/data_manipulation/server.py b/data-processing/data_manipulation/server.py index bd652a425..9f886cb6a 100644 --- a/data-processing/data_manipulation/server.py +++ b/data-processing/data_manipulation/server.py @@ -72,7 +72,8 @@ async def text_manipulate(request): Args: type: 对文本数据需要进行那些处理; - file_path: 文本路径 + bucket_name: minio桶名称; + folder_prefix: minio中文件目录 Returns: diff --git a/data-processing/data_manipulation/service/minio_store_process_service.py b/data-processing/data_manipulation/service/minio_store_process_service.py index c506e0885..478cb2f0f 100644 --- a/data-processing/data_manipulation/service/minio_store_process_service.py +++ b/data-processing/data_manipulation/service/minio_store_process_service.py @@ -28,7 +28,7 @@ import os import pandas as pd -from file_handle import csv_handle +from file_handle import csv_handle, pdf_handle from minio import Minio from minio.commonconfig import Tags from minio.error import S3Error @@ -80,6 +80,13 @@ async def text_manipulate(request): 'support_type': support_type }) + elif file_extension in ['pdf']: + # 处理PDF文件 + result = await pdf_handle.text_manipulate(request, { + 'file_name': item, + 'support_type': support_type + }) + # 将清洗后的文件上传到MinIO中 # 上传middle文件夹下的文件,并添加tag tags = Tags(for_object=True) @@ -135,14 +142,16 @@ async def download(opt={}): for obj in objects: file_name = obj.object_name[len(folder_prefix):] - data = minio_client.get_object(bucket_name, obj.object_name) - df = pd.read_csv(data) + csv_file_path = await file_utils.get_temp_file_path() + + # 如果文件夹不存在,则创建 + directory_path = csv_file_path + 'original' + if not os.path.exists(directory_path): + os.makedirs(directory_path) + + file_path = directory_path + '/' + file_name - await csv_handle.save_csv({ - 'file_name': file_name, - 'phase_value': 'original', - 'data': df['prompt'] - }) + minio_client.fget_object(bucket_name, obj.object_name, file_path) file_names.append(file_name) return file_names diff --git a/data-processing/data_manipulation/transform/text/QA_transform.py b/data-processing/data_manipulation/transform/text/QA_transform.py index 85a607bc1..1457ef605 100644 --- a/data-processing/data_manipulation/transform/text/QA_transform.py +++ b/data-processing/data_manipulation/transform/text/QA_transform.py @@ -87,9 +87,6 @@ async def formatSplitText(text): q = match[1] a = match[4] if q and a: - result.append({ - 'q': q, - 'a': a - }) + result.append([q, a]) return result diff --git a/data-processing/requirements.txt b/data-processing/requirements.txt index b45e4c6e8..0cde39b26 100644 --- a/data-processing/requirements.txt +++ b/data-processing/requirements.txt @@ -5,4 +5,7 @@ sanic_cors==2.2.0 aiohttp==3.8.6 ulid==1.1 minio==7.1.17 -zhipuai==1.0.7 \ No newline at end of file +zhipuai==1.0.7 +langchain==0.0.336 +spacy==3.5.4 +pypdf==3.17.1 \ No newline at end of file diff --git a/gqlgen.yaml b/gqlgen.yaml index e98134f12..6c534f922 100644 --- a/gqlgen.yaml +++ b/gqlgen.yaml @@ -141,6 +141,10 @@ models: resolver: true listKnowledgeBases: resolver: true + DataProcessQuery: + fields: + allDataProcessListByPage: + resolver: true DatasetQuery: fields: getDataset: diff --git a/graphql-server/go-server/graph/generated/generated.go b/graphql-server/go-server/graph/generated/generated.go index f1e515e0d..afa3d670c 100644 --- a/graphql-server/go-server/graph/generated/generated.go +++ b/graphql-server/go-server/graph/generated/generated.go @@ -38,6 +38,7 @@ type Config struct { } type ResolverRoot interface { + DataProcessQuery() DataProcessQueryResolver Dataset() DatasetResolver DatasetMutation() DatasetMutationResolver DatasetQuery() DatasetQueryResolver @@ -60,6 +61,29 @@ type DirectiveRoot struct { } type ComplexityRoot struct { + DataProcessItem struct { + ID func(childComplexity int) int + Name func(childComplexity int) int + Postdatasetname func(childComplexity int) int + Postdatasetversion func(childComplexity int) int + Predatasetname func(childComplexity int) int + Predatasetversion func(childComplexity int) int + StartDatetime func(childComplexity int) int + Status func(childComplexity int) int + } + + DataProcessMutation struct { + CreateDataProcessTask func(childComplexity int) int + DeleteDataProcessTask func(childComplexity int) int + ExecuteDataProcessTask func(childComplexity int) int + } + + DataProcessQuery struct { + AllDataProcessListByCount func(childComplexity int, input *AllDataProcessListByPageInput) int + AllDataProcessListByPage func(childComplexity int, input *AllDataProcessListByPageInput) int + DetailInfoByDataProcessTask func(childComplexity int) int + } + Dataset struct { Annotations func(childComplexity int) int ContentType func(childComplexity int) int @@ -199,6 +223,7 @@ type ComplexityRoot struct { } Mutation struct { + DataProcess func(childComplexity int) int Dataset func(childComplexity int) int Datasource func(childComplexity int) int Embedder func(childComplexity int) int @@ -213,6 +238,12 @@ type ComplexityRoot struct { Object func(childComplexity int) int } + PaginatedDataProcessItem struct { + Data func(childComplexity int) int + Message func(childComplexity int) int + Status func(childComplexity int) int + } + PaginatedResult struct { HasNextPage func(childComplexity int) int Nodes func(childComplexity int) int @@ -222,6 +253,7 @@ type ComplexityRoot struct { } Query struct { + DataProcess func(childComplexity int) int Dataset func(childComplexity int) int Datasource func(childComplexity int) int Embedder func(childComplexity int) int @@ -273,6 +305,9 @@ type ComplexityRoot struct { } } +type DataProcessQueryResolver interface { + AllDataProcessListByPage(ctx context.Context, obj *DataProcessQuery, input *AllDataProcessListByPageInput) (*PaginatedDataProcessItem, error) +} type DatasetResolver interface { Versions(ctx context.Context, obj *Dataset, input ListVersionedDatasetInput) (*PaginatedResult, error) } @@ -323,6 +358,7 @@ type ModelQueryResolver interface { } type MutationResolver interface { Hello(ctx context.Context, name string) (string, error) + DataProcess(ctx context.Context) (*DataProcessMutation, error) Dataset(ctx context.Context) (*DatasetMutation, error) Datasource(ctx context.Context) (*DatasourceMutation, error) Embedder(ctx context.Context) (*EmbedderMutation, error) @@ -332,6 +368,7 @@ type MutationResolver interface { } type QueryResolver interface { Hello(ctx context.Context, name string) (string, error) + DataProcess(ctx context.Context) (*DataProcessQuery, error) Dataset(ctx context.Context) (*DatasetQuery, error) Datasource(ctx context.Context) (*DatasourceQuery, error) Embedder(ctx context.Context) (*EmbedderQuery, error) @@ -371,6 +408,114 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in _ = ec switch typeName + "." + field { + case "DataProcessItem.id": + if e.complexity.DataProcessItem.ID == nil { + break + } + + return e.complexity.DataProcessItem.ID(childComplexity), true + + case "DataProcessItem.name": + if e.complexity.DataProcessItem.Name == nil { + break + } + + return e.complexity.DataProcessItem.Name(childComplexity), true + + case "DataProcessItem.postdatasetname": + if e.complexity.DataProcessItem.Postdatasetname == nil { + break + } + + return e.complexity.DataProcessItem.Postdatasetname(childComplexity), true + + case "DataProcessItem.postdatasetversion": + if e.complexity.DataProcessItem.Postdatasetversion == nil { + break + } + + return e.complexity.DataProcessItem.Postdatasetversion(childComplexity), true + + case "DataProcessItem.predatasetname": + if e.complexity.DataProcessItem.Predatasetname == nil { + break + } + + return e.complexity.DataProcessItem.Predatasetname(childComplexity), true + + case "DataProcessItem.predatasetversion": + if e.complexity.DataProcessItem.Predatasetversion == nil { + break + } + + return e.complexity.DataProcessItem.Predatasetversion(childComplexity), true + + case "DataProcessItem.start_datetime": + if e.complexity.DataProcessItem.StartDatetime == nil { + break + } + + return e.complexity.DataProcessItem.StartDatetime(childComplexity), true + + case "DataProcessItem.status": + if e.complexity.DataProcessItem.Status == nil { + break + } + + return e.complexity.DataProcessItem.Status(childComplexity), true + + case "DataProcessMutation.createDataProcessTask": + if e.complexity.DataProcessMutation.CreateDataProcessTask == nil { + break + } + + return e.complexity.DataProcessMutation.CreateDataProcessTask(childComplexity), true + + case "DataProcessMutation.deleteDataProcessTask": + if e.complexity.DataProcessMutation.DeleteDataProcessTask == nil { + break + } + + return e.complexity.DataProcessMutation.DeleteDataProcessTask(childComplexity), true + + case "DataProcessMutation.executeDataProcessTask": + if e.complexity.DataProcessMutation.ExecuteDataProcessTask == nil { + break + } + + return e.complexity.DataProcessMutation.ExecuteDataProcessTask(childComplexity), true + + case "DataProcessQuery.allDataProcessListByCount": + if e.complexity.DataProcessQuery.AllDataProcessListByCount == nil { + break + } + + args, err := ec.field_DataProcessQuery_allDataProcessListByCount_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.DataProcessQuery.AllDataProcessListByCount(childComplexity, args["input"].(*AllDataProcessListByPageInput)), true + + case "DataProcessQuery.allDataProcessListByPage": + if e.complexity.DataProcessQuery.AllDataProcessListByPage == nil { + break + } + + args, err := ec.field_DataProcessQuery_allDataProcessListByPage_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.DataProcessQuery.AllDataProcessListByPage(childComplexity, args["input"].(*AllDataProcessListByPageInput)), true + + case "DataProcessQuery.detailInfoByDataProcessTask": + if e.complexity.DataProcessQuery.DetailInfoByDataProcessTask == nil { + break + } + + return e.complexity.DataProcessQuery.DetailInfoByDataProcessTask(childComplexity), true + case "Dataset.annotations": if e.complexity.Dataset.Annotations == nil { break @@ -1110,6 +1255,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.ModelQuery.ListModels(childComplexity, args["input"].(ListModelInput)), true + case "Mutation.dataProcess": + if e.complexity.Mutation.DataProcess == nil { + break + } + + return e.complexity.Mutation.DataProcess(childComplexity), true + case "Mutation.Dataset": if e.complexity.Mutation.Dataset == nil { break @@ -1178,6 +1330,27 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Oss.Object(childComplexity), true + case "PaginatedDataProcessItem.data": + if e.complexity.PaginatedDataProcessItem.Data == nil { + break + } + + return e.complexity.PaginatedDataProcessItem.Data(childComplexity), true + + case "PaginatedDataProcessItem.message": + if e.complexity.PaginatedDataProcessItem.Message == nil { + break + } + + return e.complexity.PaginatedDataProcessItem.Message(childComplexity), true + + case "PaginatedDataProcessItem.status": + if e.complexity.PaginatedDataProcessItem.Status == nil { + break + } + + return e.complexity.PaginatedDataProcessItem.Status(childComplexity), true + case "PaginatedResult.hasNextPage": if e.complexity.PaginatedResult.HasNextPage == nil { break @@ -1213,6 +1386,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.PaginatedResult.TotalCount(childComplexity), true + case "Query.dataProcess": + if e.complexity.Query.DataProcess == nil { + break + } + + return e.complexity.Query.DataProcess(childComplexity), true + case "Query.Dataset": if e.complexity.Query.Dataset == nil { break @@ -1487,6 +1667,7 @@ func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler { rc := graphql.GetOperationContext(ctx) ec := executionContext{rc, e, 0, 0, make(chan graphql.DeferredResult)} inputUnmarshalMap := graphql.BuildUnmarshalerMap( + ec.unmarshalInputAllDataProcessListByPageInput, ec.unmarshalInputCreateDatasetInput, ec.unmarshalInputCreateDatasourceInput, ec.unmarshalInputCreateEmbedderInput, @@ -1614,6 +1795,73 @@ func (ec *executionContext) introspectType(name string) (*introspection.Type, er } var sources = []*ast.Source{ + {Name: "../schema/dataprocess.graphqls", Input: `# 数据处理 Mutation +type DataProcessMutation { + # 创建数据处理任务 + createDataProcessTask: String + # 删除数据处理任务 + deleteDataProcessTask: String + # 实行数据处理任务 + executeDataProcessTask: String +} + + +# 数据处理 Query +type DataProcessQuery { + # 数据处理列表 分页 + allDataProcessListByPage(input: AllDataProcessListByPageInput): PaginatedDataProcessItem + # 数据处理配置列表 + allDataProcessListByCount(input: AllDataProcessListByPageInput): Int! + # 详情信息根据数据处理任务 + detailInfoByDataProcessTask: String +} + + +input AllDataProcessListByPageInput { + page: Int! + pageSize: Int! + keyword: String! +} + + +# 数据处理列表分页 +type PaginatedDataProcessItem { + status: Int! + data: [DataProcessItem!] + message: String! +} + +# 数据处理条目 +type DataProcessItem { + # 主键 + id: String! + # 任务名称 + name: String! + # 状态 + status: String! + # 处理前数据集 + predatasetname: String! + # 处理前数据集版本 + predatasetversion: String! + # 处理后数据集 + postdatasetname:String! + # 处理后数据集版本 + postdatasetversion: String + # 开始时间 + start_datetime: String! +} + + + +# mutation +extend type Mutation { + dataProcess: DataProcessMutation +} + +# query +extend type Query { + dataProcess: DataProcessQuery +}`, BuiltIn: false}, {Name: "../schema/dataset.graphqls", Input: `""" Dataset 数据集代表用户纳管的一组相似属性的文件,采用相同的方式进行数据处理并用于后续的 @@ -2406,6 +2654,36 @@ var parsedSchema = gqlparser.MustLoadSchema(sources...) // region ***************************** args.gotpl ***************************** +func (ec *executionContext) field_DataProcessQuery_allDataProcessListByCount_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *AllDataProcessListByPageInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalOAllDataProcessListByPageInput2ᚖgithubᚗcomᚋkubeagiᚋarcadiaᚋgraphqlᚑserverᚋgoᚑserverᚋgraphᚋgeneratedᚐAllDataProcessListByPageInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_DataProcessQuery_allDataProcessListByPage_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *AllDataProcessListByPageInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalOAllDataProcessListByPageInput2ᚖgithubᚗcomᚋkubeagiᚋarcadiaᚋgraphqlᚑserverᚋgoᚑserverᚋgraphᚋgeneratedᚐAllDataProcessListByPageInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + func (ec *executionContext) field_DatasetMutation_createDataset_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} @@ -2996,32 +3274,660 @@ func (ec *executionContext) field___Type_enumValues_args(ctx context.Context, ra return nil, err } } - args["includeDeprecated"] = arg0 - return args, nil + args["includeDeprecated"] = arg0 + return args, nil +} + +func (ec *executionContext) field___Type_fields_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 bool + if tmp, ok := rawArgs["includeDeprecated"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) + arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) + if err != nil { + return nil, err + } + } + args["includeDeprecated"] = arg0 + return args, nil +} + +// endregion ***************************** args.gotpl ***************************** + +// region ************************** directives.gotpl ************************** + +// endregion ************************** directives.gotpl ************************** + +// region **************************** field.gotpl ***************************** + +func (ec *executionContext) _DataProcessItem_id(ctx context.Context, field graphql.CollectedField, obj *DataProcessItem) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DataProcessItem_id(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DataProcessItem_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DataProcessItem", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _DataProcessItem_name(ctx context.Context, field graphql.CollectedField, obj *DataProcessItem) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DataProcessItem_name(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DataProcessItem_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DataProcessItem", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _DataProcessItem_status(ctx context.Context, field graphql.CollectedField, obj *DataProcessItem) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DataProcessItem_status(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Status, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DataProcessItem_status(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DataProcessItem", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _DataProcessItem_predatasetname(ctx context.Context, field graphql.CollectedField, obj *DataProcessItem) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DataProcessItem_predatasetname(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Predatasetname, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DataProcessItem_predatasetname(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DataProcessItem", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _DataProcessItem_predatasetversion(ctx context.Context, field graphql.CollectedField, obj *DataProcessItem) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DataProcessItem_predatasetversion(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Predatasetversion, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DataProcessItem_predatasetversion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DataProcessItem", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _DataProcessItem_postdatasetname(ctx context.Context, field graphql.CollectedField, obj *DataProcessItem) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DataProcessItem_postdatasetname(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Postdatasetname, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DataProcessItem_postdatasetname(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DataProcessItem", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _DataProcessItem_postdatasetversion(ctx context.Context, field graphql.CollectedField, obj *DataProcessItem) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DataProcessItem_postdatasetversion(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Postdatasetversion, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DataProcessItem_postdatasetversion(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DataProcessItem", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _DataProcessItem_start_datetime(ctx context.Context, field graphql.CollectedField, obj *DataProcessItem) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DataProcessItem_start_datetime(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.StartDatetime, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DataProcessItem_start_datetime(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DataProcessItem", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _DataProcessMutation_createDataProcessTask(ctx context.Context, field graphql.CollectedField, obj *DataProcessMutation) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DataProcessMutation_createDataProcessTask(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.CreateDataProcessTask, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DataProcessMutation_createDataProcessTask(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DataProcessMutation", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _DataProcessMutation_deleteDataProcessTask(ctx context.Context, field graphql.CollectedField, obj *DataProcessMutation) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DataProcessMutation_deleteDataProcessTask(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.DeleteDataProcessTask, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DataProcessMutation_deleteDataProcessTask(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DataProcessMutation", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _DataProcessMutation_executeDataProcessTask(ctx context.Context, field graphql.CollectedField, obj *DataProcessMutation) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DataProcessMutation_executeDataProcessTask(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ExecuteDataProcessTask, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DataProcessMutation_executeDataProcessTask(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DataProcessMutation", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _DataProcessQuery_allDataProcessListByPage(ctx context.Context, field graphql.CollectedField, obj *DataProcessQuery) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DataProcessQuery_allDataProcessListByPage(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.DataProcessQuery().AllDataProcessListByPage(rctx, obj, fc.Args["input"].(*AllDataProcessListByPageInput)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*PaginatedDataProcessItem) + fc.Result = res + return ec.marshalOPaginatedDataProcessItem2ᚖgithubᚗcomᚋkubeagiᚋarcadiaᚋgraphqlᚑserverᚋgoᚑserverᚋgraphᚋgeneratedᚐPaginatedDataProcessItem(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DataProcessQuery_allDataProcessListByPage(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DataProcessQuery", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "status": + return ec.fieldContext_PaginatedDataProcessItem_status(ctx, field) + case "data": + return ec.fieldContext_PaginatedDataProcessItem_data(ctx, field) + case "message": + return ec.fieldContext_PaginatedDataProcessItem_message(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type PaginatedDataProcessItem", field.Name) + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_DataProcessQuery_allDataProcessListByPage_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _DataProcessQuery_allDataProcessListByCount(ctx context.Context, field graphql.CollectedField, obj *DataProcessQuery) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DataProcessQuery_allDataProcessListByCount(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.AllDataProcessListByCount, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DataProcessQuery_allDataProcessListByCount(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DataProcessQuery", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Int does not have child fields") + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_DataProcessQuery_allDataProcessListByCount_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil } -func (ec *executionContext) field___Type_fields_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 bool - if tmp, ok := rawArgs["includeDeprecated"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) - arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) - if err != nil { - return nil, err +func (ec *executionContext) _DataProcessQuery_detailInfoByDataProcessTask(ctx context.Context, field graphql.CollectedField, obj *DataProcessQuery) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DataProcessQuery_detailInfoByDataProcessTask(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.DetailInfoByDataProcessTask, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null } - args["includeDeprecated"] = arg0 - return args, nil + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -// endregion ***************************** args.gotpl ***************************** - -// region ************************** directives.gotpl ************************** - -// endregion ************************** directives.gotpl ************************** - -// region **************************** field.gotpl ***************************** +func (ec *executionContext) fieldContext_DataProcessQuery_detailInfoByDataProcessTask(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DataProcessQuery", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} func (ec *executionContext) _Dataset_name(ctx context.Context, field graphql.CollectedField, obj *Dataset) (ret graphql.Marshaler) { fc, err := ec.fieldContext_Dataset_name(ctx, field) @@ -7553,6 +8459,55 @@ func (ec *executionContext) fieldContext_Mutation_hello(ctx context.Context, fie return fc, nil } +func (ec *executionContext) _Mutation_dataProcess(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_dataProcess(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().DataProcess(rctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*DataProcessMutation) + fc.Result = res + return ec.marshalODataProcessMutation2ᚖgithubᚗcomᚋkubeagiᚋarcadiaᚋgraphqlᚑserverᚋgoᚑserverᚋgraphᚋgeneratedᚐDataProcessMutation(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_dataProcess(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "createDataProcessTask": + return ec.fieldContext_DataProcessMutation_createDataProcessTask(ctx, field) + case "deleteDataProcessTask": + return ec.fieldContext_DataProcessMutation_deleteDataProcessTask(ctx, field) + case "executeDataProcessTask": + return ec.fieldContext_DataProcessMutation_executeDataProcessTask(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type DataProcessMutation", field.Name) + }, + } + return fc, nil +} + func (ec *executionContext) _Mutation_Dataset(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { fc, err := ec.fieldContext_Mutation_Dataset(ctx, field) if err != nil { @@ -7929,6 +8884,153 @@ func (ec *executionContext) fieldContext_Oss_Object(ctx context.Context, field g return fc, nil } +func (ec *executionContext) _PaginatedDataProcessItem_status(ctx context.Context, field graphql.CollectedField, obj *PaginatedDataProcessItem) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PaginatedDataProcessItem_status(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Status, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_PaginatedDataProcessItem_status(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PaginatedDataProcessItem", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Int does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _PaginatedDataProcessItem_data(ctx context.Context, field graphql.CollectedField, obj *PaginatedDataProcessItem) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PaginatedDataProcessItem_data(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Data, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*DataProcessItem) + fc.Result = res + return ec.marshalODataProcessItem2ᚕᚖgithubᚗcomᚋkubeagiᚋarcadiaᚋgraphqlᚑserverᚋgoᚑserverᚋgraphᚋgeneratedᚐDataProcessItemᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_PaginatedDataProcessItem_data(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PaginatedDataProcessItem", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_DataProcessItem_id(ctx, field) + case "name": + return ec.fieldContext_DataProcessItem_name(ctx, field) + case "status": + return ec.fieldContext_DataProcessItem_status(ctx, field) + case "predatasetname": + return ec.fieldContext_DataProcessItem_predatasetname(ctx, field) + case "predatasetversion": + return ec.fieldContext_DataProcessItem_predatasetversion(ctx, field) + case "postdatasetname": + return ec.fieldContext_DataProcessItem_postdatasetname(ctx, field) + case "postdatasetversion": + return ec.fieldContext_DataProcessItem_postdatasetversion(ctx, field) + case "start_datetime": + return ec.fieldContext_DataProcessItem_start_datetime(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type DataProcessItem", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _PaginatedDataProcessItem_message(ctx context.Context, field graphql.CollectedField, obj *PaginatedDataProcessItem) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PaginatedDataProcessItem_message(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Message, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_PaginatedDataProcessItem_message(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PaginatedDataProcessItem", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + func (ec *executionContext) _PaginatedResult_hasNextPage(ctx context.Context, field graphql.CollectedField, obj *PaginatedResult) (ret graphql.Marshaler) { fc, err := ec.fieldContext_PaginatedResult_hasNextPage(ctx, field) if err != nil { @@ -8161,37 +9263,86 @@ func (ec *executionContext) _Query_hello(ctx context.Context, field graphql.Coll return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_hello(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Query", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + defer func() { + if r := recover(); r != nil { + err = ec.Recover(ctx, r) + ec.Error(ctx, err) + } + }() + ctx = graphql.WithFieldContext(ctx, fc) + if fc.Args, err = ec.field_Query_hello_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Query_dataProcess(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_dataProcess(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().DataProcess(rctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { return graphql.Null } - res := resTmp.(string) + res := resTmp.(*DataProcessQuery) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalODataProcessQuery2ᚖgithubᚗcomᚋkubeagiᚋarcadiaᚋgraphqlᚑserverᚋgoᚑserverᚋgraphᚋgeneratedᚐDataProcessQuery(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Query_hello(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Query_dataProcess(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Query", Field: field, IsMethod: true, IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") + switch field.Name { + case "allDataProcessListByPage": + return ec.fieldContext_DataProcessQuery_allDataProcessListByPage(ctx, field) + case "allDataProcessListByCount": + return ec.fieldContext_DataProcessQuery_allDataProcessListByCount(ctx, field) + case "detailInfoByDataProcessTask": + return ec.fieldContext_DataProcessQuery_detailInfoByDataProcessTask(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type DataProcessQuery", field.Name) }, } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_hello_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } @@ -11696,6 +12847,53 @@ func (ec *executionContext) fieldContext_filegroup_path(ctx context.Context, fie // region **************************** input.gotpl ***************************** +func (ec *executionContext) unmarshalInputAllDataProcessListByPageInput(ctx context.Context, obj interface{}) (AllDataProcessListByPageInput, error) { + var it AllDataProcessListByPageInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"page", "pageSize", "keyword"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "page": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("page")) + data, err := ec.unmarshalNInt2int(ctx, v) + if err != nil { + return it, err + } + it.Page = data + case "pageSize": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pageSize")) + data, err := ec.unmarshalNInt2int(ctx, v) + if err != nil { + return it, err + } + it.PageSize = data + case "keyword": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("keyword")) + data, err := ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + it.Keyword = data + } + } + + return it, nil +} + func (ec *executionContext) unmarshalInputCreateDatasetInput(ctx context.Context, obj interface{}) (CreateDatasetInput, error) { var it CreateDatasetInput asMap := map[string]interface{}{} @@ -13849,102 +15047,287 @@ func (ec *executionContext) unmarshalInputfilegroupinput(ctx context.Context, ob asMap[k] = v } - fieldsInOrder := [...]string{"source", "path"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "source": - var err error + fieldsInOrder := [...]string{"source", "path"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "source": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("source")) + data, err := ec.unmarshalNTypedObjectReferenceInput2githubᚗcomᚋkubeagiᚋarcadiaᚋgraphqlᚑserverᚋgoᚑserverᚋgraphᚋgeneratedᚐTypedObjectReferenceInput(ctx, v) + if err != nil { + return it, err + } + it.Source = data + case "path": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("path")) + data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + it.Path = data + } + } + + return it, nil +} + +// endregion **************************** input.gotpl ***************************** + +// region ************************** interface.gotpl *************************** + +func (ec *executionContext) _PageNode(ctx context.Context, sel ast.SelectionSet, obj PageNode) graphql.Marshaler { + switch obj := (obj).(type) { + case nil: + return graphql.Null + case Datasource: + return ec._Datasource(ctx, sel, &obj) + case *Datasource: + if obj == nil { + return graphql.Null + } + return ec._Datasource(ctx, sel, obj) + case Model: + return ec._Model(ctx, sel, &obj) + case *Model: + if obj == nil { + return graphql.Null + } + return ec._Model(ctx, sel, obj) + case Embedder: + return ec._Embedder(ctx, sel, &obj) + case *Embedder: + if obj == nil { + return graphql.Null + } + return ec._Embedder(ctx, sel, obj) + case KnowledgeBase: + return ec._KnowledgeBase(ctx, sel, &obj) + case *KnowledgeBase: + if obj == nil { + return graphql.Null + } + return ec._KnowledgeBase(ctx, sel, obj) + case Dataset: + return ec._Dataset(ctx, sel, &obj) + case *Dataset: + if obj == nil { + return graphql.Null + } + return ec._Dataset(ctx, sel, obj) + case VersionedDataset: + return ec._VersionedDataset(ctx, sel, &obj) + case *VersionedDataset: + if obj == nil { + return graphql.Null + } + return ec._VersionedDataset(ctx, sel, obj) + case F: + return ec._F(ctx, sel, &obj) + case *F: + if obj == nil { + return graphql.Null + } + return ec._F(ctx, sel, obj) + default: + panic(fmt.Errorf("unexpected type %T", obj)) + } +} + +// endregion ************************** interface.gotpl *************************** + +// region **************************** object.gotpl **************************** + +var dataProcessItemImplementors = []string{"DataProcessItem"} + +func (ec *executionContext) _DataProcessItem(ctx context.Context, sel ast.SelectionSet, obj *DataProcessItem) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, dataProcessItemImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("DataProcessItem") + case "id": + out.Values[i] = ec._DataProcessItem_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "name": + out.Values[i] = ec._DataProcessItem_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "status": + out.Values[i] = ec._DataProcessItem_status(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "predatasetname": + out.Values[i] = ec._DataProcessItem_predatasetname(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "predatasetversion": + out.Values[i] = ec._DataProcessItem_predatasetversion(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "postdatasetname": + out.Values[i] = ec._DataProcessItem_postdatasetname(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "postdatasetversion": + out.Values[i] = ec._DataProcessItem_postdatasetversion(ctx, field, obj) + case "start_datetime": + out.Values[i] = ec._DataProcessItem_start_datetime(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var dataProcessMutationImplementors = []string{"DataProcessMutation"} + +func (ec *executionContext) _DataProcessMutation(ctx context.Context, sel ast.SelectionSet, obj *DataProcessMutation) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, dataProcessMutationImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("DataProcessMutation") + case "createDataProcessTask": + out.Values[i] = ec._DataProcessMutation_createDataProcessTask(ctx, field, obj) + case "deleteDataProcessTask": + out.Values[i] = ec._DataProcessMutation_deleteDataProcessTask(ctx, field, obj) + case "executeDataProcessTask": + out.Values[i] = ec._DataProcessMutation_executeDataProcessTask(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + +var dataProcessQueryImplementors = []string{"DataProcessQuery"} + +func (ec *executionContext) _DataProcessQuery(ctx context.Context, sel ast.SelectionSet, obj *DataProcessQuery) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, dataProcessQueryImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("DataProcessQuery") + case "allDataProcessListByPage": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._DataProcessQuery_allDataProcessListByPage(ctx, field, obj) + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("source")) - data, err := ec.unmarshalNTypedObjectReferenceInput2githubᚗcomᚋkubeagiᚋarcadiaᚋgraphqlᚑserverᚋgoᚑserverᚋgraphᚋgeneratedᚐTypedObjectReferenceInput(ctx, v) - if err != nil { - return it, err + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue } - it.Source = data - case "path": - var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("path")) - data, err := ec.unmarshalOString2ᚕstringᚄ(ctx, v) - if err != nil { - return it, err + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "allDataProcessListByCount": + out.Values[i] = ec._DataProcessQuery_allDataProcessListByCount(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) } - it.Path = data + case "detailInfoByDataProcessTask": + out.Values[i] = ec._DataProcessQuery_detailInfoByDataProcessTask(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) } } - - return it, nil -} - -// endregion **************************** input.gotpl ***************************** - -// region ************************** interface.gotpl *************************** - -func (ec *executionContext) _PageNode(ctx context.Context, sel ast.SelectionSet, obj PageNode) graphql.Marshaler { - switch obj := (obj).(type) { - case nil: + out.Dispatch(ctx) + if out.Invalids > 0 { return graphql.Null - case Datasource: - return ec._Datasource(ctx, sel, &obj) - case *Datasource: - if obj == nil { - return graphql.Null - } - return ec._Datasource(ctx, sel, obj) - case Model: - return ec._Model(ctx, sel, &obj) - case *Model: - if obj == nil { - return graphql.Null - } - return ec._Model(ctx, sel, obj) - case Embedder: - return ec._Embedder(ctx, sel, &obj) - case *Embedder: - if obj == nil { - return graphql.Null - } - return ec._Embedder(ctx, sel, obj) - case KnowledgeBase: - return ec._KnowledgeBase(ctx, sel, &obj) - case *KnowledgeBase: - if obj == nil { - return graphql.Null - } - return ec._KnowledgeBase(ctx, sel, obj) - case Dataset: - return ec._Dataset(ctx, sel, &obj) - case *Dataset: - if obj == nil { - return graphql.Null - } - return ec._Dataset(ctx, sel, obj) - case VersionedDataset: - return ec._VersionedDataset(ctx, sel, &obj) - case *VersionedDataset: - if obj == nil { - return graphql.Null - } - return ec._VersionedDataset(ctx, sel, obj) - case F: - return ec._F(ctx, sel, &obj) - case *F: - if obj == nil { - return graphql.Null - } - return ec._F(ctx, sel, obj) - default: - panic(fmt.Errorf("unexpected type %T", obj)) } -} -// endregion ************************** interface.gotpl *************************** + atomic.AddInt32(&ec.deferred, int32(len(deferred))) -// region **************************** object.gotpl **************************** + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} var datasetImplementors = []string{"Dataset", "PageNode"} @@ -15662,6 +17045,10 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) if out.Values[i] == graphql.Null { out.Invalids++ } + case "dataProcess": + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_dataProcess(ctx, field) + }) case "Dataset": out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Mutation_Dataset(ctx, field) @@ -15747,6 +17134,52 @@ func (ec *executionContext) _Oss(ctx context.Context, sel ast.SelectionSet, obj return out } +var paginatedDataProcessItemImplementors = []string{"PaginatedDataProcessItem"} + +func (ec *executionContext) _PaginatedDataProcessItem(ctx context.Context, sel ast.SelectionSet, obj *PaginatedDataProcessItem) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, paginatedDataProcessItemImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("PaginatedDataProcessItem") + case "status": + out.Values[i] = ec._PaginatedDataProcessItem_status(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "data": + out.Values[i] = ec._PaginatedDataProcessItem_data(ctx, field, obj) + case "message": + out.Values[i] = ec._PaginatedDataProcessItem_message(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + var paginatedResultImplementors = []string{"PaginatedResult"} func (ec *executionContext) _PaginatedResult(ctx context.Context, sel ast.SelectionSet, obj *PaginatedResult) graphql.Marshaler { @@ -15837,6 +17270,25 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) } + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "dataProcess": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_dataProcess(ctx, field) + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) case "Dataset": field := field @@ -16802,6 +18254,16 @@ func (ec *executionContext) unmarshalNCreateVersionedDatasetInput2githubᚗcom return res, graphql.ErrorOnPath(ctx, err) } +func (ec *executionContext) marshalNDataProcessItem2ᚖgithubᚗcomᚋkubeagiᚋarcadiaᚋgraphqlᚑserverᚋgoᚑserverᚋgraphᚋgeneratedᚐDataProcessItem(ctx context.Context, sel ast.SelectionSet, v *DataProcessItem) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "the requested element is null which the schema does not allow") + } + return graphql.Null + } + return ec._DataProcessItem(ctx, sel, v) +} + func (ec *executionContext) marshalNDataset2githubᚗcomᚋkubeagiᚋarcadiaᚋgraphqlᚑserverᚋgoᚑserverᚋgraphᚋgeneratedᚐDataset(ctx context.Context, sel ast.SelectionSet, v Dataset) graphql.Marshaler { return ec._Dataset(ctx, sel, &v) } @@ -17262,6 +18724,14 @@ func (ec *executionContext) unmarshalNfilegroupinput2ᚖgithubᚗcomᚋkubeagi return &res, graphql.ErrorOnPath(ctx, err) } +func (ec *executionContext) unmarshalOAllDataProcessListByPageInput2ᚖgithubᚗcomᚋkubeagiᚋarcadiaᚋgraphqlᚑserverᚋgoᚑserverᚋgraphᚋgeneratedᚐAllDataProcessListByPageInput(ctx context.Context, v interface{}) (*AllDataProcessListByPageInput, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputAllDataProcessListByPageInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + func (ec *executionContext) unmarshalOBoolean2bool(ctx context.Context, v interface{}) (bool, error) { res, err := graphql.UnmarshalBoolean(v) return res, graphql.ErrorOnPath(ctx, err) @@ -17296,6 +18766,67 @@ func (ec *executionContext) unmarshalOCreateDatasetInput2ᚖgithubᚗcomᚋkubea return &res, graphql.ErrorOnPath(ctx, err) } +func (ec *executionContext) marshalODataProcessItem2ᚕᚖgithubᚗcomᚋkubeagiᚋarcadiaᚋgraphqlᚑserverᚋgoᚑserverᚋgraphᚋgeneratedᚐDataProcessItemᚄ(ctx context.Context, sel ast.SelectionSet, v []*DataProcessItem) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNDataProcessItem2ᚖgithubᚗcomᚋkubeagiᚋarcadiaᚋgraphqlᚑserverᚋgoᚑserverᚋgraphᚋgeneratedᚐDataProcessItem(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalODataProcessMutation2ᚖgithubᚗcomᚋkubeagiᚋarcadiaᚋgraphqlᚑserverᚋgoᚑserverᚋgraphᚋgeneratedᚐDataProcessMutation(ctx context.Context, sel ast.SelectionSet, v *DataProcessMutation) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._DataProcessMutation(ctx, sel, v) +} + +func (ec *executionContext) marshalODataProcessQuery2ᚖgithubᚗcomᚋkubeagiᚋarcadiaᚋgraphqlᚑserverᚋgoᚑserverᚋgraphᚋgeneratedᚐDataProcessQuery(ctx context.Context, sel ast.SelectionSet, v *DataProcessQuery) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._DataProcessQuery(ctx, sel, v) +} + func (ec *executionContext) marshalODatasetMutation2ᚖgithubᚗcomᚋkubeagiᚋarcadiaᚋgraphqlᚑserverᚋgoᚑserverᚋgraphᚋgeneratedᚐDatasetMutation(ctx context.Context, sel ast.SelectionSet, v *DatasetMutation) graphql.Marshaler { if v == nil { return graphql.Null @@ -17579,6 +19110,13 @@ func (ec *executionContext) marshalOPageNode2ᚕgithubᚗcomᚋkubeagiᚋarcadia return ret } +func (ec *executionContext) marshalOPaginatedDataProcessItem2ᚖgithubᚗcomᚋkubeagiᚋarcadiaᚋgraphqlᚑserverᚋgoᚑserverᚋgraphᚋgeneratedᚐPaginatedDataProcessItem(ctx context.Context, sel ast.SelectionSet, v *PaginatedDataProcessItem) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._PaginatedDataProcessItem(ctx, sel, v) +} + func (ec *executionContext) unmarshalOString2ᚕstringᚄ(ctx context.Context, v interface{}) ([]string, error) { if v == nil { return nil, nil diff --git a/graphql-server/go-server/graph/generated/models_gen.go b/graphql-server/go-server/graph/generated/models_gen.go index 84033f0ea..4e63f46ee 100644 --- a/graphql-server/go-server/graph/generated/models_gen.go +++ b/graphql-server/go-server/graph/generated/models_gen.go @@ -10,6 +10,12 @@ type PageNode interface { IsPageNode() } +type AllDataProcessListByPageInput struct { + Page int `json:"page"` + PageSize int `json:"pageSize"` + Keyword string `json:"keyword"` +} + type CreateDatasetInput struct { // 数据集的CR名字,要满足k8s的名称规则 Name string `json:"name"` @@ -126,6 +132,29 @@ type CreateVersionedDatasetInput struct { InheritedFrom *string `json:"inheritedFrom,omitempty"` } +type DataProcessItem struct { + ID string `json:"id"` + Name string `json:"name"` + Status string `json:"status"` + Predatasetname string `json:"predatasetname"` + Predatasetversion string `json:"predatasetversion"` + Postdatasetname string `json:"postdatasetname"` + Postdatasetversion *string `json:"postdatasetversion,omitempty"` + StartDatetime string `json:"start_datetime"` +} + +type DataProcessMutation struct { + CreateDataProcessTask *string `json:"createDataProcessTask,omitempty"` + DeleteDataProcessTask *string `json:"deleteDataProcessTask,omitempty"` + ExecuteDataProcessTask *string `json:"executeDataProcessTask,omitempty"` +} + +type DataProcessQuery struct { + AllDataProcessListByPage *PaginatedDataProcessItem `json:"allDataProcessListByPage,omitempty"` + AllDataProcessListByCount int `json:"allDataProcessListByCount"` + DetailInfoByDataProcessTask *string `json:"detailInfoByDataProcessTask,omitempty"` +} + // Dataset // 数据集代表用户纳管的一组相似属性的文件,采用相同的方式进行数据处理并用于后续的 // 1. 模型训练 @@ -485,6 +514,12 @@ type OssInput struct { Object *string `json:"Object,omitempty"` } +type PaginatedDataProcessItem struct { + Status int `json:"status"` + Data []*DataProcessItem `json:"data,omitempty"` + Message string `json:"message"` +} + type PaginatedResult struct { HasNextPage bool `json:"hasNextPage"` Nodes []PageNode `json:"nodes,omitempty"` diff --git a/graphql-server/go-server/graph/impl/dataprocess.resolvers.go b/graphql-server/go-server/graph/impl/dataprocess.resolvers.go new file mode 100644 index 000000000..25070a32c --- /dev/null +++ b/graphql-server/go-server/graph/impl/dataprocess.resolvers.go @@ -0,0 +1,34 @@ +package impl + +// This file will be automatically regenerated based on the schema, any resolver implementations +// will be copied through when generating and any unknown code will be moved to the end. +// Code generated by github.com/99designs/gqlgen version v0.17.40 + +import ( + "context" + "fmt" + + "github.com/kubeagi/arcadia/graphql-server/go-server/graph/generated" +) + +// AllDataProcessListByPage is the resolver for the allDataProcessListByPage field. +func (r *dataProcessQueryResolver) AllDataProcessListByPage(ctx context.Context, obj *generated.DataProcessQuery, input *generated.AllDataProcessListByPageInput) (*generated.PaginatedDataProcessItem, error) { + panic(fmt.Errorf("not implemented: AllDataProcessListByPage - allDataProcessListByPage")) +} + +// DataProcess is the resolver for the dataProcess field. +func (r *mutationResolver) DataProcess(ctx context.Context) (*generated.DataProcessMutation, error) { + panic(fmt.Errorf("not implemented: DataProcess - dataProcess")) +} + +// DataProcess is the resolver for the dataProcess field. +func (r *queryResolver) DataProcess(ctx context.Context) (*generated.DataProcessQuery, error) { + panic(fmt.Errorf("not implemented: DataProcess - dataProcess")) +} + +// DataProcessQuery returns generated.DataProcessQueryResolver implementation. +func (r *Resolver) DataProcessQuery() generated.DataProcessQueryResolver { + return &dataProcessQueryResolver{r} +} + +type dataProcessQueryResolver struct{ *Resolver } diff --git a/graphql-server/go-server/graph/schema/dataprocess.graphqls b/graphql-server/go-server/graph/schema/dataprocess.graphqls new file mode 100644 index 000000000..84d50cfa4 --- /dev/null +++ b/graphql-server/go-server/graph/schema/dataprocess.graphqls @@ -0,0 +1,67 @@ +# 数据处理 Mutation +type DataProcessMutation { + # 创建数据处理任务 + createDataProcessTask: String + # 删除数据处理任务 + deleteDataProcessTask: String + # 实行数据处理任务 + executeDataProcessTask: String +} + + +# 数据处理 Query +type DataProcessQuery { + # 数据处理列表 分页 + allDataProcessListByPage(input: AllDataProcessListByPageInput): PaginatedDataProcessItem + # 数据处理配置列表 + allDataProcessListByCount(input: AllDataProcessListByPageInput): Int! + # 详情信息根据数据处理任务 + detailInfoByDataProcessTask: String +} + + +input AllDataProcessListByPageInput { + page: Int! + pageSize: Int! + keyword: String! +} + + +# 数据处理列表分页 +type PaginatedDataProcessItem { + status: Int! + data: [DataProcessItem!] + message: String! +} + +# 数据处理条目 +type DataProcessItem { + # 主键 + id: String! + # 任务名称 + name: String! + # 状态 + status: String! + # 处理前数据集 + predatasetname: String! + # 处理前数据集版本 + predatasetversion: String! + # 处理后数据集 + postdatasetname:String! + # 处理后数据集版本 + postdatasetversion: String + # 开始时间 + start_datetime: String! +} + + + +# mutation +extend type Mutation { + dataProcess: DataProcessMutation +} + +# query +extend type Query { + dataProcess: DataProcessQuery +} \ No newline at end of file