Files
clue/ServerCommands/Gitee/创建一个仓库WebHook.json
超哥 658b5c7f8f {"Message":"新增WebHook的订阅","MessageType":2,"Modules":[{"State":1,"Type":7,"Name":"Table/FGC_订单记录","ExclusiveType":0},{"State":1,"Type":7,"Name":"Table/FGC_订单明细表","ExclusiveType":0},{"State":1,"Type":7,"Name":"Table/FGC_商品表","ExclusiveType":0},{"State":1,"Type":7,"Name":"Table/项目动态"},{"State":1,"Type":7,"Name":"Table/项目版本"},{"State":1,"Type":23,"Name":"TableView/用户信息视图","ExclusiveType":0},{"State":1,"Type":23,"Name":"TableView/用户组织关系视图","ExclusiveType":0},{"State":1,"Type":23,"Name":"TableView/用户角色关系视图","ExclusiveType":0},{"State":1,"Type":23,"Name":"TableView/组织信息视图","ExclusiveType":0},{"State":1,"Type":23,"Name":"TableView/组织级别视图","ExclusiveType":0},{"State":1,"Type":23,"Name":"TableView/角色信息视图","ExclusiveType":0},{"State":1,"Type":23,"Name":"TableView/角色分类关系视图","ExclusiveType":0},{"State":1,"Type":23,"Name":"TableView/角色拥有权限视图","ExclusiveType":0},{"State":1,"Type":23,"Name":"TableView/角色组织关系视图","ExclusiveType":0},{"State":1,"Type":7,"Name":"Table/message_test","ExclusiveType":0},{"State":1,"Type":1,"Name":"PCPage/项目版本管理"},{"State":1,"Type":1,"Name":"PCPage/任务版本详情"},{"State":1,"Type":1,"Name":"PCPage/任务-任务信息"},{"State":1,"Type":1,"Name":"PCPage/新增任务"},{"State":1,"Type":1,"Name":"PCPage/工时总览"},{"State":1,"Type":1,"Name":"PCPage/个人工时首页"},{"State":1,"Type":1,"Name":"PCPage/首页"},{"State":1,"Type":3,"Name":"MasterPCPage/FGC_母版页"},{"State":1,"Type":15,"Name":"ServerCommand/AI报工数据转日报"},{"State":1,"Type":8,"Name":"ApplicationSetting"},{"State":1,"Type":12,"Name":"CustomLibrary"},{"State":1,"Type":26,"Name":"Upload"},{"State":1,"Type":39,"Name":"PublishConfiguration"},{"State":1,"Type":40,"Name":"Plugin"},{"State":1,"Type":27,"Name":"ServerCommandPrivate/请求令牌"},{"State":2,"Type":27,"Name":"ServerCommandPrivate/创建一个仓库WebHook"},{"State":1,"Type":27,"Name":"ServerCommandPrivate/删除一个仓库WebHook"},{"State":1,"Type":7,"Name":"Table/Git仓库表"},{"State":1,"Type":15,"Name":"ServerCommand/GitCallback"},{"State":1,"Type":7,"Name":"Table/Git_事件记录"},{"State":1,"Type":1,"Name":"PCPage/选择Git仓库"},{"State":1,"Type":15,"Name":"ServerCommand/同步一个仓库到表"},{"State":1,"Type":15,"Name":"ServerCommand/搜索仓库"},{"State":3,"Type":27,"Name":"ServerCommandPrivate/列出仓库的WebHooks"},{"State":3,"Type":16,"Name":"TaskScheduler/应用部署时"},{"State":3,"Type":20,"Name":"ServerCommands/系统"},{"State":3,"Type":15,"Name":"ServerCommand/获取版本号"},{"State":3,"Type":15,"Name":"ServerCommand/列出授权用户所有的Namespace"},{"State":3,"Type":15,"Name":"ServerCommand/创建一个仓库WebHook"}],"Version":"v1"}
2024-06-13 19:51:48 +08:00

594 lines
30 KiB
JSON

{
"Name": "创建一个仓库WebHook",
"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": "gyrnccc"
},
{
"Name": "用户名",
"DataValidationInfo": {
"IgnoreBlank": false
},
"TestData": "Administrator"
},
{
"Name": "回调地址",
"DataValidationInfo": {}
}
],
"InvokeTriggerTestData": {
"UserName": "Administrator"
}
}
],
"Commands": [
{
"$type": "JsonUtilityCommand.JsonDeserializeCommand, JsonUtilityCommand",
"JsonString": {
"$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon",
"SerializeProperty": "=全局_Gitee"
},
"SampleJson": "{\"client_id\":\"c7d05fcbaf78ad728fcc0267d081ae6c50dc667667758a0933525d4cbe09ed90\",\"client_secret\":\"b4d40db2155ca530e5771b37a2fb67161d4106c64df28f32504b4e3bcfb81313\",\"回调地址\":\"https://develop.gridfriend.cn/sims/ServerCommand/GitCallback\"}",
"ToParameter": "Gitee配置"
},
{
"$type": "Forguncy.Model.Commands.SetParameterCommand, ServerDesignerCommon",
"ParameterName": "当前用户",
"TableValue": {
"TableName": "用户信息视图",
"TableValueType": 1,
"BindingInfos": [
{
"GUID": "c26e601c-dffb-46f1-be97-ce46d5deadcc",
"BindingInfo": {
"TableName": "用户信息视图",
"ColumnName": "GIT用户名",
"GUID": "a7631324-378f-4577-a8af-d976f21cda27"
},
"ColumnName": "GIT用户名"
},
{
"GUID": "b594d85c-3422-4cb3-a063-69e472c32537",
"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": "ea6babeddf554a1eb8f46e195877e952"
},
{
"$type": "Forguncy.Model.Commands.SetParameterCommand, ServerDesignerCommon",
"ParameterName": "仓库",
"TableValue": {
"TableName": "Git仓库表",
"TableValueType": 1,
"BindingInfos": [
{
"GUID": "375548fd-8c18-4c87-9511-bdb646a7a88a",
"BindingInfo": {
"TableName": "Git仓库表",
"ColumnName": "仓库路径名",
"GUID": "2c41e2fb-0784-4414-a2f6-e7bf48e1a825"
},
"ColumnName": "仓库路径名"
},
{
"GUID": "4a543850-eab6-45df-9a9e-40fdac47d12c",
"BindingInfo": {
"TableName": "Git仓库表",
"ColumnName": "空间路径名",
"GUID": "a4dc7e40-113c-4634-a254-bd3d364169e2"
},
"ColumnName": "空间路径名"
},
{
"GUID": "cd748bcf-8be5-49ee-9828-0d140beb2581",
"BindingInfo": {
"TableName": "Git仓库表",
"ColumnName": "hook_url",
"GUID": "b34b70ae-08b3-4667-be01-afce405fb9bc"
},
"ColumnName": "hook_url"
},
{
"GUID": "3175ee74-7815-4217-b3b8-257b3cfbce93",
"BindingInfo": {
"TableName": "Git仓库表",
"ColumnName": "订阅成功",
"GUID": "01bbed57-b961-4d6b-b4ee-dba6636960af"
},
"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": "c7607e00ea68441eb59a50ac39babf53"
},
{
"$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.ConditionCommand, ServerDesignerCommon",
"ConditionAndCommandPairList": [
{
"Condition": {
"$type": "Forguncy.Model.IfCondition, ServerDesignerCommon",
"param": {
"$type": "Forguncy.Model.IfConditionServerSiteParam, ServerDesignerCommon",
"ParamObject": {
"$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon",
"SerializeProperty": "=仓库.绑定成功"
}
},
"value": "1",
"compareType": 1
},
"CommandList": [
{
"$type": "Forguncy.Model.RequestServerCommand, ServerDesignerCommon",
"ServerCommandName": "列出仓库的WebHooks",
"Parameters": [
{
"$type": "Forguncy.Model.RequestServerCommandObjectParam, ServerDesignerCommon",
"ParamName": "仓库ID",
"Value": {
"$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon",
"SerializeProperty": "=仓库ID"
}
},
{
"$type": "Forguncy.Model.RequestServerCommandObjectParam, ServerDesignerCommon",
"ParamName": "用户名",
"Value": {
"$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon",
"SerializeProperty": "=用户名"
}
}
],
"ResultErrorCodeTo": {
"SerializeProperty": "code"
},
"ResultMessageTo": {
"SerializeProperty": "msg"
},
"ReturnPropertiesTo": [
{
"ResultPropertyName": "钩子列表",
"ResultTo": {
"SerializeProperty": "钩子列表"
}
},
{
"ResultPropertyName": "ACCESS_TOKEN",
"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.Commands.SetParameterCommand, ServerDesignerCommon",
"ParameterName": "查找钩子",
"ID": "6eff079d11144740b4fd5e2b0587ba6a"
},
{
"$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": "=钩子列表.Count"
}
},
"value": "0",
"compareType": 2
},
"CommandList": [
{
"$type": "CollectionOperationKit.ServerSideArrayQuery, CollectionOperationKit",
"InParamater": {
"$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon",
"SerializeProperty": "=钩子列表"
},
"Operation": 1,
"OperationParamaterPairs": [
{
"Name": "url",
"Value": {
"$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon",
"SerializeProperty": "=仓库.hook_url"
}
}
],
"OutParamaterName": "查找钩子"
}
],
"ID": "46121cc4-33f5-4116-bde3-b6b15878703a"
}
]
},
{
"$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%"
},
"CommandList": [
{
"$type": "Forguncy.Model.Commands.SetParameterCommand, ServerDesignerCommon",
"ParameterName": "url",
"ParameterValue": {
"$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon",
"SerializeProperty": "=\"https://gitee.com/api/v5/repos/\"&仓库.空间路径名&\"/\"&仓库.仓库路径名&\"/hooks\""
},
"ID": "631a9d7da45544d598696dbdbc7e16e7"
},
{
"$type": "Forguncy.Model.CatchExceptionCommand, ServerDesignerCommon",
"TryCommandPart": {
"CommandList": [
{
"$type": "Forguncy.Model.ServerTransactionCommand, ServerDesignerCommon",
"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": "url",
"DataItemType": 0,
"Data": {
"$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon",
"SerializeProperty": "=IF(回调地址=\"\",Gitee配置.回调地址,回调地址)"
}
},
{
"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仓库表",
"ShowConfirm": false,
"RowsToUpdate": 1,
"RowsToUpdateCondition": {
"$type": "ForguncyDataAccess.GeneralCESqlCondition, ForguncyDataAccess",
"ColumnBindingInfo": {
"TableName": "Git仓库表",
"ColumnName": "仓库ID",
"GUID": "421e0ce9-cf66-4deb-8fe6-f586f95a2d78"
},
"Value": {
"$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon",
"SerializeProperty": "=仓库ID"
}
},
"UpdateBindingValues": [
{
"BindingInfo": {
"TableName": "Git仓库表",
"ColumnName": "钩子ID",
"GUID": "7474b27e-471f-45d3-9169-70ee07eb90fa"
},
"Value": {
"$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon",
"SerializeProperty": "=result.id"
}
},
{
"BindingInfo": {
"TableName": "Git仓库表",
"ColumnName": "订阅成功",
"GUID": "c25cba9f-2eae-4238-8259-a6e2015e3900"
},
"Value": "1"
}
]
}
]
},
{
"$type": "Forguncy.Model.ReturnCommand, ServerDesignerCommon",
"ErrorCode": "0",
"Message": "获取成功"
}
]
},
"CatchCommandPart": {
"CommandList": [
{
"$type": "Forguncy.Model.UpdateDataTableCommand, ServerDesignerCommon",
"TableName": "Git仓库表",
"ShowConfirm": false,
"RowsToUpdate": 1,
"RowsToUpdateCondition": {
"$type": "ForguncyDataAccess.GeneralCESqlCondition, ForguncyDataAccess",
"ColumnBindingInfo": {
"TableName": "Git仓库表",
"ColumnName": "仓库ID",
"GUID": "421e0ce9-cf66-4deb-8fe6-f586f95a2d78"
},
"Value": {
"$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon",
"SerializeProperty": "=仓库ID"
}
},
"UpdateBindingValues": [
{
"BindingInfo": {
"TableName": "Git仓库表",
"ColumnName": "钩子ID",
"GUID": "acc607e0-06da-4c13-8831-596f16899736"
}
},
{
"BindingInfo": {
"TableName": "Git仓库表",
"ColumnName": "订阅成功",
"GUID": "c9954ca5-54b8-42c3-ba77-0a135764ea4b"
},
"Value": "0"
}
]
},
{
"$type": "JsonUtilityCommand.JsonDeserializeCommand, JsonUtilityCommand",
"JsonString": {
"$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon",
"SerializeProperty": "=ExceptionMessage"
},
"SampleJson": "{\"message\":\"\"}",
"ToParameter": "错误信息"
},
{
"$type": "Forguncy.Model.ReturnCommand, ServerDesignerCommon",
"ErrorCode": "400",
"Message": {
"$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon",
"SerializeProperty": "=错误信息.message"
}
}
]
}
}
],
"ID": "63717820-b794-4564-b115-c085dbf33b17"
},
{
"CommandList": [
{
"$type": "Forguncy.Model.UpdateDataTableCommand, ServerDesignerCommon",
"TableName": "Git仓库表",
"ShowConfirm": false,
"RowsToUpdate": 1,
"RowsToUpdateCondition": {
"$type": "ForguncyDataAccess.GeneralCESqlCondition, ForguncyDataAccess",
"ColumnBindingInfo": {
"TableName": "Git仓库表",
"ColumnName": "仓库ID",
"GUID": "421e0ce9-cf66-4deb-8fe6-f586f95a2d78"
},
"Value": {
"$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon",
"SerializeProperty": "=仓库ID"
}
},
"UpdateBindingValues": [
{
"BindingInfo": {
"TableName": "Git仓库表",
"ColumnName": "钩子ID",
"GUID": "71681bd0-e7cb-4ba2-be9d-d8c902f124ae"
},
"Value": {
"$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon",
"SerializeProperty": "=result.id"
}
},
{
"BindingInfo": {
"TableName": "Git仓库表",
"ColumnName": "订阅成功",
"GUID": "ec4e7230-0fb9-4452-bc19-f6ef21642efb"
},
"Value": "1"
}
]
},
{
"$type": "Forguncy.Model.ReturnCommand, ServerDesignerCommon",
"ErrorCode": "0",
"Message": "钩子已存在"
}
],
"ID": "94b197b1-f2ea-400f-8cb3-b07705f1a8f9"
}
]
}
],
"ID": "7f5dbfdf-16c7-4407-aa60-e35ffec13ded"
},
{
"CommandList": [
{
"$type": "Forguncy.Model.ReturnCommand, ServerDesignerCommon",
"ErrorCode": "400",
"Message": {
"$type": "Forguncy.Model.FormulaReferObject, ServerDesignerCommon",
"SerializeProperty": "=msg"
}
}
],
"ID": "fe312141-6c75-4967-aaa6-83e5804aae3a"
}
]
}
],
"ID": "2ed5a7ee-177e-4784-9f96-36bbce804e9c"
},
{
"CommandList": [
{
"$type": "Forguncy.Model.ReturnCommand, ServerDesignerCommon",
"ErrorCode": "0",
"Message": "该仓库已绑定"
}
],
"ID": "4ee789dc-4642-4d34-9a2e-bfcb3b6397b8"
}
]
}
],
"ID": "35977f7a-cd68-4e5e-b448-a7faff3ce155"
},
{
"CommandList": [
{
"$type": "Forguncy.Model.ReturnCommand, ServerDesignerCommon",
"ErrorCode": "400",
"Message": "仓库不存在,请先同步仓库到系统中"
}
],
"ID": "43bcf490-993d-41b1-a794-513a3b128633"
}
]
}
]
}