{ "Name": "创建一个仓库WebHook", "Enabled": true, "Triggers": [ { "$type": "Forguncy.SaveLoad.InvokeTriggerSaveData, ServerDesignerCommon", "Parameters": [ { "Name": "仓库ID", "DataValidationInfo": { "IgnoreBlank": false }, "TestData": "gyrnccc" }, { "Name": "用户名", "DataValidationInfo": { "IgnoreBlank": false }, "TestData": "Administrator" } ], "InvokeTriggerTestData": { "UserName": "Administrator" } } ], "Commands": [ { "$type": "Forguncy.Model.Commands.SetParameterCommand, ServerDesignerCommon", "ParameterName": "当前用户", "TableValue": { "TableName": "用户信息视图", "TableValueType": 1, "BindingInfos": [ { "GUID": "79da2071-159c-4a8d-8796-be57ae391a1f", "BindingInfo": { "TableName": "用户信息视图", "ColumnName": "GIT用户名", "GUID": "a7631324-378f-4577-a8af-d976f21cda27" }, "ColumnName": "GIT用户名" }, { "GUID": "68731a57-db25-4f90-bd1f-35011ff221a7", "BindingInfo": { "TableName": "用户信息视图", "ColumnName": "GIT密码", "GUID": "523d4df5-59b6-4437-b68b-661078b7bab5" }, "ColumnName": "GIT密码" } ], "SqlCondition": { "$type": "ForguncyDataAccess.GeneralCESqlCondition, ForguncyDataAccess", "ColumnBindingInfo": { "TableName": "用户信息视图", "ColumnName": "用户名", "GUID": "86de2db8-485a-4991-bb27-80ceb2d895c8" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=用户名" } }, "NullFormulaValueQueryPolicy": 0, "TopCount": "1" }, "ID": "4d5b1b1010f84c79946ac09278aa8d66" }, { "$type": "JsonUtilityCommand.JsonDeserializeCommand, JsonUtilityCommand", "JsonString": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=全局_Gitee" }, "SampleJson": "{\r\n \"enterprise\": \"GridStudio\",\r\n \"client_id\": \"c7d05fcbaf78ad728fcc0267d081ae6c50dc667667758a0933525d4cbe09ed90\",\r\n \"client_secret\": \"b4d40db2155ca530e5771b37a2fb67161d4106c64df28f32504b4e3bcfb81313\"\r\n}", "ToParameter": "Gitee" }, { "$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": "=Gitee.enterprise" } }, "value": "%Null%", "compareType": 1 }, "CommandList": [ { "$type": "Forguncy.Model.Commands.SetParameterCommand, ServerDesignerCommon", "ParameterName": "仓库", "TableValue": { "TableName": "Git仓库表", "TableValueType": 1, "BindingInfos": [ { "GUID": "f86fee2d-71be-4386-986f-58efe124ddbd", "BindingInfo": { "TableName": "Git仓库表", "ColumnName": "仓库路径名", "GUID": "2c41e2fb-0784-4414-a2f6-e7bf48e1a825" }, "ColumnName": "仓库路径名" } ], "SqlCondition": { "$type": "ForguncyDataAccess.GeneralCESqlCondition, ForguncyDataAccess", "ColumnBindingInfo": { "TableName": "Git仓库表", "ColumnName": "仓库ID", "GUID": "7aa0116e-f6a8-4a54-9dc1-10755107fdf9" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=仓库ID" } }, "NullFormulaValueQueryPolicy": 0, "TopCount": "1" }, "ID": "18b47cd732ea4f5ca35425f3f67f2068" }, { "$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": "%Null%", "compareType": 1 }, "CommandList": [ { "$type": "Forguncy.Model.Commands.SetParameterCommand, ServerDesignerCommon", "ParameterName": "是否存在hook", "TableValue": { "TableName": "Git_WebHook", "TableValueType": 1, "BindingInfos": [ { "GUID": "a39b5b84-ec17-4474-a3f1-024ba1e931a3", "BindingInfo": { "TableName": "Git_WebHook", "ColumnName": "hook_id", "GUID": "a9ffabfc-9ef2-4051-bf27-4ac4bb9612a3" }, "ColumnName": "hook_id" }, { "GUID": "07448f15-a30a-46e3-98f5-454569fd9b9f", "BindingInfo": { "TableName": "Git_WebHook", "ColumnName": "url", "GUID": "4ef09151-35ae-4d70-afa6-b779ea5dd6c9" }, "ColumnName": "url" }, { "GUID": "56c3cff0-bec6-4060-8500-5184a071b6df", "BindingInfo": { "TableName": "Git_WebHook", "ColumnName": "password", "GUID": "5d84189e-bd75-4b4f-800d-a273ba9b1ef8" }, "ColumnName": "password" } ], "SqlCondition": { "$type": "ForguncyDataAccess.GeneralCESqlCondition, ForguncyDataAccess", "ColumnBindingInfo": { "TableName": "Git_WebHook", "ColumnName": "仓库ID", "GUID": "62db27c9-59da-493e-a58b-8fd48148a5ca" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=仓库ID" } }, "NullFormulaValueQueryPolicy": 0 }, "ID": "4d967288116a47b58360492b81f91672" }, { "$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": "=是否存在hook" } }, "value": "%Null%" }, "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": "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.Commands.SetParameterCommand, ServerDesignerCommon", "ParameterName": "url", "ParameterValue": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=\"https://gitee.com/api/v5/repos/\"&Gitee.enterprise&\"/\"&仓库.仓库路径名&\"/hooks\"" }, "ID": "67f11c1341634f158b457443feca21de" }, { "$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": "=TOKEN" } }, { "Name": "url", "DataItemType": 0, "Data": "http://www.baidu.com" }, { "Name": "encryption_type", "DataItemType": 0, "Data": 0 }, { "Name": "password", "DataItemType": 0, "Data": 6158891 }, { "Name": "push_events", "DataItemType": 0, "Data": true } ] } }, "JsonString": "", "WebUrl": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=url" }, "Method": "POST", "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.UpdateDataTableCommand, ServerDesignerCommon", "TableName": "Git_WebHook", "UpdateType": "add", "ShowConfirm": false, "UpdateBindingValues": [ { "BindingInfo": { "TableName": "Git_WebHook", "ColumnName": "仓库ID", "GUID": "73a25ccf-ba9a-4c0b-a999-5598caeab5dc" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=仓库ID" } }, { "BindingInfo": { "TableName": "Git_WebHook", "ColumnName": "hook_id", "GUID": "8b359d8c-e7f0-45bc-8336-270f0e318259" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=result.id" } }, { "BindingInfo": { "TableName": "Git_WebHook", "ColumnName": "url", "GUID": "e835645b-cdc8-4f0c-904c-8d126c038e01" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=result.url" } }, { "BindingInfo": { "TableName": "Git_WebHook", "ColumnName": "password", "GUID": "d13c52b9-870b-43bd-b96f-6dd187ee44b1" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=result.password" } } ] }, { "$type": "Forguncy.Model.ReturnCommand, ServerDesignerCommon", "ErrorCode": "0", "Message": "获取成功", "CustomReturns": [ { "ReturnPropertyName": "id", "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=result.id" } }, { "ReturnPropertyName": "url", "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=result.url" } }, { "ReturnPropertyName": "password", "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=result.password" } } ] } ] }, "CatchCommandPart": { "CommandList": [ { "$type": "Forguncy.Model.ReturnCommand, ServerDesignerCommon", "ErrorCode": "400", "Message": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=result.message" }, "CustomReturns": [ { "ReturnPropertyName": "id" }, { "ReturnPropertyName": "url" }, { "ReturnPropertyName": "password" } ] } ] } } ], "ID": "031b5ddf-ab69-4f5c-b019-04dffd44a385" }, { "CommandList": [ { "$type": "Forguncy.Model.ReturnCommand, ServerDesignerCommon", "ErrorCode": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=code" }, "Message": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=msg" }, "CustomReturns": [ { "ReturnPropertyName": "id" }, { "ReturnPropertyName": "url" }, { "ReturnPropertyName": "password" } ] } ], "ID": "77757baf-64c1-43e5-b44c-acabb396fb97" } ] } ], "ID": "5a9df93d-443d-4f18-95e4-beb69f5af6fb" }, { "CommandList": [ { "$type": "Forguncy.Model.ReturnCommand, ServerDesignerCommon", "ErrorCode": "400", "Message": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=result.message" }, "CustomReturns": [ { "ReturnPropertyName": "id", "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=是否存在hook.hook_id" } }, { "ReturnPropertyName": "url", "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=是否存在hook.url" } }, { "ReturnPropertyName": "password", "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=是否存在hook.password" } } ] } ], "ID": "d571148c-ddcf-45ee-a42e-3becef8b19de" } ] } ], "ID": "6f4b26b3-63d6-48cf-b7a7-5cc107627190" }, { "CommandList": [ { "$type": "Forguncy.Model.ReturnCommand, ServerDesignerCommon", "ErrorCode": "0", "Message": "仓库不存在,请先同步仓库到系统中", "CustomReturns": [ { "ReturnPropertyName": "id" }, { "ReturnPropertyName": "url" }, { "ReturnPropertyName": "password" } ] } ], "ID": "02c8bfbc-5390-4d4a-a763-978ff5dee27a" } ] } ], "ID": "d190a6f3-a4b0-44e7-a1e5-977c67381fd8" }, { "CommandList": [ { "$type": "Forguncy.Model.ReturnCommand, ServerDesignerCommon", "ErrorCode": "400", "Message": "请先配置全局Gitee企业路径名", "CustomReturns": [ { "ReturnPropertyName": "id" }, { "ReturnPropertyName": "url" }, { "ReturnPropertyName": "password" } ] } ], "ID": "dd54f4bf-7b36-4757-85e8-6260abdef1f8" } ] } ], "ReturnProperties": [ { "Name": "id" }, { "Name": "url" }, { "Name": "password" } ] }