{ "Name": "GitCallback", "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_Anonymous" ] } ] } } } ], "Commands": [ { "$type": "SaveFormData.GetFormDataFiles, SaveFormData", "ResultToReq": "请求信息" }, { "$type": "SaveFormData.fillInJSONProperties, SaveFormData", "FullJsonString": "{\r\n \"hook_name\": \"push_hooks\", \r\n \"password\": \"pwd\",\r\n \"hook_id\": 1,\r\n \"hook_url\": \"http://gitee.com/liwen/gitos/hooks/1/edit\",\r\n \"timestamp\": \"1576754827988\",\r\n \"sign\": \"rLEHLuZRIQHuTPeXMib9Czoq9dVXO4TsQcmQQHtjXHA=\",\r\n \"ref\": \"refs/heads/change_commitlint_config\",\r\n \"before\": \"0000000000000000000000000000000000000000\",\r\n \"after\": \"1cdcd819599cbb4099289dbbec762452f006cb40\",\r\n \"created\": true,\r\n \"deleted\": false,\r\n \"compare\": \"https://gitee.com/oschina/gitee/compare/0000000000000000000000000000000000000000...1cdcd819599cbb4099289dbbec762452f006cb40\",\r\n \"commits\": [\r\n {\r\n \"id\": \"1cdcd819599cbb4099289dbbec762452f006cb40\",\r\n \"tree_id\": \"db78f3594ec0683f5d857ef731df0d860f14f2b2\",\r\n \"distinct\": true,\r\n \"message\": \"Update README.md\",\r\n \"timestamp\": \"2018-02-05T23:46:46+08:00\",\r\n \"url\": \"https://gitee.com/oschina/gitee/commit/1cdcd819599cbb4099289dbbec762452f006cb40\",\r\n \"author\": {\r\n \"time\": \"2018-02-05T23:46:46+08:00\",\r\n \"name\": \"robot\",\r\n \"email\": \"robot@gitee.com\",\r\n \"username\": \"robot\",\r\n \"user_name\": \"robot\",\r\n \"url\": \"https://gitee.com/robot\"\r\n },\r\n \"committer\": {\r\n \"name\": \"robot\",\r\n \"email\": \"robot@gitee.com\",\r\n \"username\": \"robot\",\r\n \"user_name\": \"robot\",\r\n \"url\": \"https://gitee.com/robot\"\r\n },\r\n \"added\": null,\r\n \"removed\": null,\r\n \"modified\": [\r\n \"README.md\"\r\n ]\r\n }\r\n ],\r\n \"head_commit\": {\r\n \"id\": \"1cdcd819599cbb4099289dbbec762452f006cb40\",\r\n \"tree_id\": \"db78f3594ec0683f5d857ef731df0d860f14f2b2\",\r\n \"distinct\": true,\r\n \"message\": \"Update README.md\",\r\n \"timestamp\": \"2018-02-05T23:46:46+08:00\",\r\n \"url\": \"https://gitee.com/oschina/gitee/commit/1cdcd819599cbb4099289dbbec762452f006cb40\",\r\n \"author\": {\r\n \"time\": \"2018-02-05T23:46:46+08:00\",\r\n \"name\": \"robot\",\r\n \"email\": \"robot@gitee.com\",\r\n \"username\": \"robot\",\r\n \"user_name\": \"robot\",\r\n \"url\": \"https://gitee.com/robot\"\r\n },\r\n \"committer\": {\r\n \"name\": \"robot\",\r\n \"email\": \"robot@gitee.com\",\r\n \"username\": \"robot\",\r\n \"user_name\": \"robot\",\r\n \"url\": \"https://gitee.com/robot\"\r\n },\r\n \"added\": null,\r\n \"removed\": null,\r\n \"modified\": [\r\n \"README.md\"\r\n ]\r\n },\r\n \"total_commits_count\": 0,\r\n \"commits_more_than_ten\": false,\r\n \"repository\": {\r\n \"id\": 120249025,\r\n \"name\": \"Gitee\",\r\n \"path\": \"gitee\",\r\n \"full_name\": \"开源中国/Gitee\",\r\n \"owner\": {\r\n \"id\": 1,\r\n \"login\": \"robot\",\r\n \"avatar_url\": \"https://gitee.com/assets/favicon.ico\",\r\n \"html_url\": \"https://gitee.com/robot\",\r\n \"type\": \"User\",\r\n \"site_admin\": false,\r\n \"name\": \"robot\",\r\n \"email\": \"robot@gitee.com\",\r\n \"username\": \"robot\",\r\n \"user_name\": \"robot\",\r\n \"url\": \"https://gitee.com/robot\"\r\n },\r\n \"private\": false,\r\n \"html_url\": \"https://gitee.com/oschina/gitee\",\r\n \"url\": \"https://gitee.com/oschina/gitee\",\r\n \"description\": \"\",\r\n \"fork\": false,\r\n \"created_at\": \"2018-02-05T23:46:46+08:00\",\r\n \"updated_at\": \"2018-02-05T23:46:46+08:00\",\r\n \"pushed_at\": \"2018-02-05T23:46:46+08:00\",\r\n \"git_url\": \"git://gitee.com:oschina/gitee.git\",\r\n \"ssh_url\": \"git@gitee.com:oschina/gitee.git\",\r\n \"clone_url\": \"https://gitee.com/oschina/gitee.git\",\r\n \"svn_url\": \"svn://gitee.com/oschina/gitee\",\r\n \"git_http_url\": \"https://gitee.com/oschina/gitee.git\",\r\n \"git_ssh_url\": \"git@gitee.com:oschina/gitee.git\",\r\n \"git_svn_url\": \"svn://gitee.com/oschina/gitee\",\r\n \"homepage\": null,\r\n \"stargazers_count\": 11,\r\n \"watchers_count\": 12,\r\n \"forks_count\": 0,\r\n \"language\": \"ruby\",\r\n \"has_issues\": true,\r\n \"has_wiki\": true,\r\n \"has_pages\": false,\r\n \"license\": null,\r\n \"open_issues_count\": 0,\r\n \"default_branch\": \"master\",\r\n \"namespace\": \"oschina\",\r\n \"name_with_namespace\": \"开源中国/Gitee\",\r\n \"path_with_namespace\": \"oschina/gitee\"\r\n },\r\n \"sender\": {\r\n \"id\": 1,\r\n \"login\": \"robot\",\r\n \"avatar_url\": \"https://gitee.com/assets/favicon.ico\",\r\n \"html_url\": \"https://gitee.com/robot\",\r\n \"type\": \"User\",\r\n \"site_admin\": false,\r\n \"name\": \"robot\",\r\n \"email\": \"robot@gitee.com\",\r\n \"username\": \"robot\",\r\n \"user_name\": \"robot\",\r\n \"url\": \"https://gitee.com/robot\"\r\n },\r\n \"enterprise\": {\r\n \"name\": \"开源中国\",\r\n \"url\": \"https://gitee.com/oschina\"\r\n }\r\n}", "SourceJson": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=请求信息.Body" }, "ResultTo": "钩子数据" }, { "$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_name" } }, "value": "push_hooks" }, "CommandList": [ { "$type": "Forguncy.Model.CatchExceptionCommand, ServerDesignerCommon", "TryCommandPart": { "CommandList": [ { "$type": "JsonUtilityCommand.JsonDeserializeCommand, JsonUtilityCommand", "JsonString": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=钩子数据.head_commit.message" }, "SampleJson": "{\r\n \"Message\": \"新增WebHook的订阅\",\r\n \"MessageType\": 2,\r\n \"Modules\": [\r\n {\r\n \"State\": 3,\r\n \"Type\": 15,\r\n \"Name\": \"ServerCommand/创建一个仓库WebHook\"\r\n }\r\n ],\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": "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": "7501e93f1fca4186be97273c76c90e00" }, { "$type": "Forguncy.Model.UpdateDataTableCommand, ServerDesignerCommon", "TableName": "Git_事件记录", "UpdateType": "add", "ShowConfirm": false, "UpdateBindingValues": [ { "BindingInfo": { "TableName": "Git_事件记录", "ColumnName": "事件名称", "GUID": "9afba933-59bd-417b-a5e6-d4784e58129b" }, "Value": "签入工程" }, { "BindingInfo": { "TableName": "Git_事件记录", "ColumnName": "hook_id", "GUID": "ee135ea2-1c69-4319-b43e-d73a3030788c" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=钩子数据.hook_id" } }, { "BindingInfo": { "TableName": "Git_事件记录", "ColumnName": "事件内容", "GUID": "8c9d1dd9-5944-4b8a-a4ea-2c6dd0e9b07a" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=message.Message" } }, { "BindingInfo": { "TableName": "Git_事件记录", "ColumnName": "空间路径", "GUID": "4b6980cb-c9cd-47dd-8763-9fd15f428d39" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=钩子数据.repository.namespace" } }, { "BindingInfo": { "TableName": "Git_事件记录", "ColumnName": "仓库名称", "GUID": "28cc2340-020e-48ae-9706-50352688bfe0" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=钩子数据.repository.name" } }, { "BindingInfo": { "TableName": "Git_事件记录", "ColumnName": "仓库路径", "GUID": "ae427cf3-11ab-4792-970c-891778bb9814" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=钩子数据.repository.path" } }, { "BindingInfo": { "TableName": "Git_事件记录", "ColumnName": "url", "GUID": "58dd6560-f46c-45ff-ab83-cade1f943f80" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=钩子数据.head_commit.url" } }, { "BindingInfo": { "TableName": "Git_事件记录", "ColumnName": "提交人", "GUID": "5bc56c0b-134d-4773-97e2-9080b03fefb9" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=钩子数据.head_commit.committer.name" } }, { "BindingInfo": { "TableName": "Git_事件记录", "ColumnName": "git用户名", "GUID": "73c38ad6-6238-44a8-8d27-3e8fe40ac0bd" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=钩子数据.head_commit.committer.username" } }, { "BindingInfo": { "TableName": "Git_事件记录", "ColumnName": "仓库ID", "GUID": "b7da3bc8-c9fe-4c9a-b4aa-27b09b8fa01f" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=钩子数据.repository.id" } }, { "BindingInfo": { "TableName": "Git_事件记录", "ColumnName": "日期", "GUID": "9c5e506f-7326-47e9-bdec-73351267bcec" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=钩子数据.head_commit.committer.timestamp" } }, { "BindingInfo": { "TableName": "Git_事件记录", "ColumnName": "内容得分", "GUID": "11ccd64d-5b65-41c4-8d9e-79ac19c3dce5" }, "Value": { "$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon", "SerializeProperty": "=IF(内容得分>100,100,内容得分)" } } ] }, { "$type": "Forguncy.Model.ReturnCommand, ServerDesignerCommon", "ErrorCode": "0", "Message": "签入已被记录" } ], "ID": "9e5fb441-085e-45ec-855d-67a76a9c166b" } ] } ] } } ], "ID": "da7e3056-66c4-4dbe-a7bb-b022b5338fc5" } ] } ] }