{ "Name": "同步仓库的所有提交", "Enabled": true, "Triggers": [ { "$type": "Forguncy.SaveLoad.PostRequestTriggerSaveData, ServerDesignerCommon", "Permission": { "PermissionData": { "$type": "Forguncy.RbacPermission.Core.Impl.ServerCommand.ServerCommandPermissionData, Forguncy.RbacPermission.Core", "permissionResource": { "$type": "Forguncy.RbacPermission.Core.Impl.ServerCommand.ServerCommandPermissionResource, Forguncy.RbacPermission.Core" }, "permissionBindings": [ { "$type": "Forguncy.RbacPermission.Core.Impl.ServerCommand.ServerCommandPermissionBinding, Forguncy.RbacPermission.Core", "roleNames": [ "FGC_LoginUser" ] } ] } }, "Parameters": [ { "Name": "仓库ID", "DataValidationInfo": { "IgnoreBlank": false }, "TestData": "33487312" }, { "Name": "分支名", "DataValidationInfo": {} } ], "InvokeTriggerTestData": { "UserName": "Administrator" } } ], "Commands": [ { "$type": "Forguncy.Model.Commands.SetParameterCommand, ServerDesignerCommon", "ParameterName": "仓库", "TableValue": { "TableName": "Git仓库表", "TableValueType": 1, "BindingInfos": [ { "GUID": "d38e2fe4-5a7d-41c3-9538-77e8875b1048", "BindingInfo": { "TableName": "Git仓库表", "ColumnName": "空间路径名", "GUID": "303470ed-af95-4a8a-a4e2-78e6a04e8f4a" }, "ColumnName": "空间路径名" }, { "GUID": "b5136c0c-56f4-4bef-a309-66e88e0d3973", "BindingInfo": { "TableName": "Git仓库表", "ColumnName": "仓库路径名", "GUID": "11780eee-0063-4da7-8149-a3ee91c46750" }, "ColumnName": "仓库路径名" }, { "GUID": "dd7fffc1-a816-40c6-992a-1f9d7405e3dc", "BindingInfo": { "TableName": "Git仓库表", "ColumnName": "仓库名称", "GUID": "1801c9d6-dbe4-4071-8be0-8e647932db97" }, "ColumnName": "仓库名称" }, { "GUID": "cec1fc8d-1f21-4f9e-a3d1-8e01c9686840", "BindingInfo": { "TableName": "Git仓库表", "ColumnName": "拉取人员", "GUID": "1e47126d-9b27-4586-9e85-617839459cf1" }, "ColumnName": "拉取人员" } ], "SqlCondition": { "$type": "ForguncyDataAccess.GeneralCESqlCondition, ForguncyDataAccess", "ColumnBindingInfo": { "TableName": "Git仓库表", "ColumnName": "仓库ID", "GUID": "c667efb2-7b6d-44ae-8928-4519c6ebb1b4" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=仓库ID" } }, "NullFormulaValueQueryPolicy": 0, "TopCount": "1" }, "ID": "575825b5495d488bb5fe2954f610c5f0" }, { "$type": "Forguncy.Model.Commands.SetParameterCommand, ServerDesignerCommon", "ParameterName": "同步数量", "ParameterValue": "0", "ID": "8574363f8b0947b1b03cc76a1b444538" }, { "$type": "Forguncy.Model.ConditionCommand, ServerDesignerCommon", "ConditionAndCommandPairList": [ { "Condition": { "$type": "ForguncyDataAccess.RelationSqlCondition, ForguncyDataAccess", "SubConditions": [ { "$type": "Forguncy.Model.IfCondition, ServerDesignerCommon", "param": { "$type": "Forguncy.Model.IfConditionServerSiteParam, ServerDesignerCommon", "ParamObject": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=仓库" } }, "value": "%Null%", "compareType": 1 }, { "$type": "Forguncy.Model.IfCondition, ServerDesignerCommon", "param": { "$type": "Forguncy.Model.IfConditionServerSiteParam, ServerDesignerCommon", "ParamObject": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=仓库.拉取人员" } }, "value": "%Null%", "compareType": 1 } ] }, "CommandList": [ { "$type": "Forguncy.Model.RequestServerCommand, ServerDesignerCommon", "ServerCommandName": "请求令牌", "Parameters": [ { "$type": "Forguncy.Model.RequestServerCommandObjectParam, ServerDesignerCommon", "ParamName": "用户名", "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=仓库.拉取人员" } }, { "$type": "Forguncy.Model.RequestServerCommandObjectParam, ServerDesignerCommon", "ParamName": "强制刷新", "Value": "0" } ], "ResultErrorCodeTo": { "SerializeProperty": "code" }, "ResultMessageTo": { "SerializeProperty": "msg" }, "ReturnPropertiesTo": [ { "ResultPropertyName": "最新令牌", "ResultTo": { "SerializeProperty": "ACCESS_TOKEN" } } ], "RefreshAfterFinish": true, "CheckDataValidation": true }, { "$type": "Forguncy.Model.ConditionCommand, ServerDesignerCommon", "ConditionAndCommandPairList": [ { "Condition": { "$type": "Forguncy.Model.IfCondition, ServerDesignerCommon", "param": { "$type": "Forguncy.Model.IfConditionServerSiteParam, ServerDesignerCommon", "ParamObject": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=code" } }, "value": "0" }, "CommandList": [ { "$type": "Forguncy.Model.ServerTransactionCommand, ServerDesignerCommon", "CommandList": [ { "$type": "Forguncy.Model.LoopCommand, ServerDesignerCommon", "LoopInfo": { "$type": "Forguncy.Model.CountLoopInfo, ServerDesignerCommon", "LoopCount": "100", "LoopIndexParamName": "循环次数", "LoopItemParamName": "当前循环" }, "CommandList": [ { "$type": "Forguncy.Model.CatchExceptionCommand, ServerDesignerCommon", "TryCommandPart": { "CommandList": [ { "$type": "PostDataToWebApi.PostDataCommand, PostDataToWebApi", "PostData": { "DataItemType": 1, "Data": { "$type": "PostDataToWebApi.ObjectData, PostDataToWebApi", "Data": [ { "Name": "access_token", "DataItemType": 0, "Data": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=ACCESS_TOKEN" } }, { "Name": "author", "DataItemType": 0 }, { "Name": "sha", "DataItemType": 0, "Data": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=分支名" } }, { "Name": "since", "DataItemType": 0 }, { "Name": "until", "DataItemType": 0 }, { "Name": "page", "DataItemType": 0, "Data": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=循环次数" } }, { "Name": "per_page", "DataItemType": 0, "Data": 100 } ] } }, "WebUrl": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=\"https://gitee.com/api/v5/repos/\"&仓库.空间路径名&\"/\"&仓库.仓库路径名&\"/commits\"" }, "Method": "GET", "SuccessCallback": "// 请求成功返回的数据存储在“result”变量中\r\n// 请使用“result”变量来完成请求成功的回调 \r\n//console.log(result);", "ErrorCallback": "// 请求中发生的错误存储在“error”变量中\r\n// 请使用“error”变量来处理异常情况 \r\nconsole.error(error);", "NewParameter": "result", "Header": [], "Timeout": 100.0 }, { "$type": "Forguncy.Model.ConditionCommand, ServerDesignerCommon", "ConditionAndCommandPairList": [ { "Condition": { "$type": "ForguncyDataAccess.RelationSqlCondition, ForguncyDataAccess", "SubConditions": [ { "$type": "Forguncy.Model.IfCondition, ServerDesignerCommon", "param": { "$type": "Forguncy.Model.IfConditionServerSiteParam, ServerDesignerCommon", "ParamObject": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=result" } }, "value": "%Null%" }, { "$type": "Forguncy.Model.IfCondition, ServerDesignerCommon", "param": { "$type": "Forguncy.Model.IfConditionServerSiteParam, ServerDesignerCommon", "ParamObject": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=result.Count" } }, "value": "0" } ], "RelationType": 1 }, "CommandList": [ { "$type": "Forguncy.Model.EndLoopCommand, ServerDesignerCommon", "WithinLoop": true } ], "ID": "5330b11e-70b9-49d4-acf3-fd571818c3a5" }, { "CommandList": [ { "$type": "Forguncy.Model.LoopCommand, ServerDesignerCommon", "LoopInfo": { "$type": "Forguncy.Model.CountLoopInfo, ServerDesignerCommon", "LoopCount": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=result" }, "LoopItemParamName": "Item" }, "CommandList": [ { "$type": "SaveFormData.fillInJSONProperties, SaveFormData", "FullJsonString": "{\r\n \"sha\": \"\",\r\n \"html_url\": \"\",\r\n \"commit\": \"\",\r\n \"committer\": \"\",\r\n \"author\": \"\"\r\n}", "SourceJson": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=Item" }, "ResultTo": "完整ITEM" }, { "$type": "Forguncy.Model.CatchExceptionCommand, ServerDesignerCommon", "TryCommandPart": { "CommandList": [ { "$type": "JsonUtilityCommand.JsonDeserializeCommand, JsonUtilityCommand", "JsonString": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=完整ITEM.commit.message" }, "SampleJson": "{\r\n \"Message\": \"签出模块 : 项目反馈\",\r\n \"MessageType\": 1,\r\n \"Modules\": [],\r\n \"Version\": \"v1\"\r\n}", "ToParameter": "message" }, { "$type": "Forguncy.Model.ConditionCommand, ServerDesignerCommon", "ConditionAndCommandPairList": [ { "Condition": { "$type": "Forguncy.Model.IfCondition, ServerDesignerCommon", "param": { "$type": "Forguncy.Model.IfConditionServerSiteParam, ServerDesignerCommon", "ParamObject": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=message.MessageType" } }, "value": "2" }, "CommandList": [ { "$type": "Forguncy.Model.Commands.SetParameterCommand, ServerDesignerCommon", "ParameterName": "是否存在", "TableValue": { "TableName": "Git_事件记录", "TableValueType": 3, "SqlCondition": { "$type": "ForguncyDataAccess.GeneralCESqlCondition, ForguncyDataAccess", "ColumnBindingInfo": { "TableName": "Git_事件记录", "ColumnName": "sha", "GUID": "498d425b-39c3-4495-bd17-9282b73c4cb9" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=完整ITEM.sha" } }, "NullFormulaValueQueryPolicy": 0 }, "ID": "45e81d40576547d38f566575cc1945dd" }, { "$type": "Forguncy.Model.ConditionCommand, ServerDesignerCommon", "ConditionAndCommandPairList": [ { "Condition": { "$type": "Forguncy.Model.IfCondition, ServerDesignerCommon", "param": { "$type": "Forguncy.Model.IfConditionServerSiteParam, ServerDesignerCommon", "ParamObject": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=是否存在" } }, "value": "0" }, "CommandList": [ { "$type": "Forguncy.Model.ConditionCommand, ServerDesignerCommon", "ConditionAndCommandPairList": [ { "Condition": { "$type": "Forguncy.Model.IfCondition, ServerDesignerCommon", "param": { "$type": "Forguncy.Model.IfConditionServerSiteParam, ServerDesignerCommon", "ParamObject": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=完整ITEM.committer" } }, "value": "%Null%", "compareType": 1 }, "CommandList": [ { "$type": "Forguncy.Model.Commands.SetParameterCommand, ServerDesignerCommon", "ParameterName": "同步数量", "ParameterValue": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=同步数量+result.Count" }, "ID": "0bfba15e31c94c6da7557d24eb34bc5c" }, { "$type": "GETPOST.正则类.正则_校验, GETPOST", "JieShouMsg": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=message.Message" }, "JieShouMsg2": "^(.{0,3}|[^\\u4e00-\\u9fa5]*)$", "FanHuiMsg": "内容有效性" }, { "$type": "Forguncy.Model.Commands.SetParameterCommand, ServerDesignerCommon", "ParameterName": "内容得分", "ParameterValue": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=IF(内容有效性,0,LEN(message.Message))" }, "ID": "fa3c335eefc041dea44953f44a0cc564" }, { "$type": "Forguncy.Model.UpdateDataTableCommand, ServerDesignerCommon", "TableName": "Git_事件记录", "UpdateType": "add", "ShowConfirm": false, "UpdateBindingValues": [ { "BindingInfo": { "TableName": "Git_事件记录", "ColumnName": "仓库ID", "GUID": "5e824315-5955-41da-be3f-f628d307c9b6" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=仓库ID" } }, { "BindingInfo": { "TableName": "Git_事件记录", "ColumnName": "事件名称", "GUID": "a44e3498-b444-4eeb-94b2-cadffa7aaf2d" }, "Value": "签入工程" }, { "BindingInfo": { "TableName": "Git_事件记录", "ColumnName": "空间路径", "GUID": "cc8f4f3c-1af8-4b9f-9432-c68f972c8827" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=仓库.空间路径名" } }, { "BindingInfo": { "TableName": "Git_事件记录", "ColumnName": "仓库名称", "GUID": "8f1e71da-f543-4758-95b9-888654ed6648" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=仓库.仓库名称" } }, { "BindingInfo": { "TableName": "Git_事件记录", "ColumnName": "仓库路径", "GUID": "f0a7745a-11b9-415d-810e-42311b11478a" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=仓库.仓库路径名" } }, { "BindingInfo": { "TableName": "Git_事件记录", "ColumnName": "提交人", "GUID": "f9e7c496-0cff-4ecb-891c-588e037987a5" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=完整ITEM.committer.name" } }, { "BindingInfo": { "TableName": "Git_事件记录", "ColumnName": "事件内容", "GUID": "a5f07281-31a5-4bea-91cd-147e5f2ab6d9" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=message.Message" } }, { "BindingInfo": { "TableName": "Git_事件记录", "ColumnName": "url", "GUID": "f11fd976-3bea-4288-bba6-6297a57c0598" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=完整ITEM.html_url" } }, { "BindingInfo": { "TableName": "Git_事件记录", "ColumnName": "git用户名", "GUID": "bffbc696-0387-425e-86bd-4ebac35e400f" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=完整ITEM.committer.login" } }, { "BindingInfo": { "TableName": "Git_事件记录", "ColumnName": "日期", "GUID": "bbabf6d6-15de-4746-bfbf-82aba78ee815" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=完整ITEM.commit.committer.date" } }, { "BindingInfo": { "TableName": "Git_事件记录", "ColumnName": "内容得分", "GUID": "abf39d1a-c07f-497a-94bf-b8290b5242e6" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=IF(内容得分>100,100,内容得分)" } }, { "BindingInfo": { "TableName": "Git_事件记录", "ColumnName": "sha", "GUID": "5b7e01a6-ab9b-45ac-91cf-67b7d2598d71" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=完整ITEM.sha" } } ] } ], "ID": "caa36840-678a-44ca-b4ae-aefab93d8a65" } ] } ], "ID": "97673824-c1d9-4d12-8214-072c500d6377" } ] } ], "ID": "3897beac-9b94-4122-9c8c-eb8fa2230708" } ] } ] } } ] } ], "ID": "0489304b-393a-4de6-86e0-5aa25b1997dc" } ] } ] }, "CatchCommandPart": { "CommandList": [ { "$type": "Forguncy.Model.ReturnCommand, ServerDesignerCommon", "ErrorCode": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=ExceptionCode" }, "Message": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=ExceptionMessage" } } ] } } ] } ] }, { "$type": "Forguncy.Model.ReturnCommand, ServerDesignerCommon", "ErrorCode": "0", "Message": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=\"已为您成功同步\"&同步数量&\"条记录\"" } } ], "ID": "efa475d6-8b00-4c11-8931-c9c13b83a6dd" }, { "CommandList": [ { "$type": "Forguncy.Model.ReturnCommand, ServerDesignerCommon", "ErrorCode": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=code" }, "Message": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=msg" } } ], "ID": "26befa33-2aff-46d8-8457-796f788d0c15" } ] } ], "ID": "4b49cfde-63e1-487e-aac9-b5d716fb47c7" }, { "CommandList": [ { "$type": "Forguncy.Model.ReturnCommand, ServerDesignerCommon", "ErrorCode": "400", "Message": "仓库不存在或尚未设置拉取人员" } ], "ID": "7e112ca2-8e15-48b9-8f5b-10052ac14df8" } ] } ] }