chore: refactor enforce() handler and update Swagger docs (#1931)

* chore: add swaggerof enforce api

* Update enforcer.go

* Update string.go

---------

Co-authored-by: hsluoyz <hsluoyz@qq.com>
This commit is contained in:
Yaodong Yu
2023-06-04 17:19:58 +08:00
committed by GitHub
parent 2d43fe0b39
commit fdaad2b608
3 changed files with 369 additions and 40 deletions

View File

@ -777,6 +777,46 @@
"operationId": "ApiController.HandleOfficialAccountEvent"
}
},
"/api/batch-enforce": {
"post": {
"tags": [
"Enforce API"
],
"description": "perform enforce",
"operationId": "ApiController.BatchEnforce",
"parameters": [
{
"in": "body",
"name": "body",
"description": "casbin request array",
"required": true,
"schema": {
"$ref": "#/definitions/object.CasbinRequest"
}
},
{
"in": "query",
"name": "permissionId",
"description": "permission id",
"type": "string"
},
{
"in": "query",
"name": "modelId",
"description": "model id",
"type": "string"
}
],
"responses": {
"200": {
"description": "The Response object",
"schema": {
"$ref": "#/definitions/controllers.Response"
}
}
}
}
},
"/api/buy-product": {
"post": {
"tags": [
@ -1384,6 +1424,52 @@
}
}
},
"/api/enforce": {
"post": {
"tags": [
"Enforce API"
],
"description": "perform enforce",
"operationId": "ApiController.Enforce",
"parameters": [
{
"in": "body",
"name": "body",
"description": "casbin request",
"required": true,
"schema": {
"$ref": "#/definitions/object.CasbinRequest"
}
},
{
"in": "query",
"name": "permissionId",
"description": "permission id",
"type": "string"
},
{
"in": "query",
"name": "modelId",
"description": "model id",
"type": "string"
},
{
"in": "query",
"name": "resourceId",
"description": "resource id",
"type": "string"
}
],
"responses": {
"200": {
"description": "The Response object",
"schema": {
"$ref": "#/definitions/controllers.Response"
}
}
}
}
},
"/api/get-account": {
"get": {
"tags": [
@ -1954,6 +2040,35 @@
}
}
},
"/api/get-organization-names": {
"get": {
"tags": [
"Organization API"
],
"description": "get all organization names",
"operationId": "ApiController.GetOrganizationNames",
"parameters": [
{
"in": "query",
"name": "owner",
"description": "owner",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "The Response object",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/object.Organization"
}
}
}
}
}
},
"/api/get-organizations": {
"get": {
"tags": [
@ -2826,7 +2941,6 @@
"in": "query",
"name": "id",
"description": "The id ( owner/name ) of the user",
"required": true,
"type": "string"
},
{
@ -3062,6 +3176,23 @@
}
}
},
"/api/health": {
"get": {
"tags": [
"System API"
],
"description": "check if the system is live",
"operationId": "ApiController.Health",
"responses": {
"200": {
"description": "The Response object",
"schema": {
"$ref": "#/definitions/controllers.Response"
}
}
}
}
},
"/api/invoice-payment": {
"post": {
"tags": [
@ -4501,11 +4632,11 @@
}
},
"definitions": {
"1183.0x1400042eb70.false": {
"1225.0xc0002e2ae0.false": {
"title": "false",
"type": "object"
},
"1217.0x1400042eba0.false": {
"1260.0xc0002e2b10.false": {
"title": "false",
"type": "object"
},
@ -4554,10 +4685,10 @@
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/1183.0x1400042eb70.false"
"$ref": "#/definitions/1225.0xc0002e2ae0.false"
},
"data2": {
"$ref": "#/definitions/1217.0x1400042eba0.false"
"$ref": "#/definitions/1260.0xc0002e2b10.false"
},
"msg": {
"type": "string"
@ -4595,6 +4726,10 @@
"title": "JSONWebKey",
"type": "object"
},
"object.\u0026{179844 0xc000a02f90 false}": {
"title": "\u0026{179844 0xc000a02f90 false}",
"type": "object"
},
"object.AccountItem": {
"title": "AccountItem",
"type": "object",
@ -4693,6 +4828,9 @@
"formCss": {
"type": "string"
},
"formCssMobile": {
"type": "string"
},
"formOffset": {
"type": "integer",
"format": "int64"
@ -4715,6 +4853,9 @@
"name": {
"type": "string"
},
"orgChoiceMode": {
"type": "string"
},
"organization": {
"type": "string"
},
@ -4772,6 +4913,13 @@
}
}
},
"object.CasbinRequest": {
"title": "CasbinRequest",
"type": "array",
"items": {
"$ref": "#/definitions/object.\u0026{179844 0xc000a02f90 false}"
}
},
"object.Cert": {
"title": "Cert",
"type": "object",
@ -5008,6 +5156,18 @@
}
}
},
"object.MfaItem": {
"title": "MfaItem",
"type": "object",
"properties": {
"name": {
"type": "string"
},
"rule": {
"type": "string"
}
}
},
"object.MfaProps": {
"title": "MfaProps",
"type": "object",
@ -5190,6 +5350,12 @@
"masterPassword": {
"type": "string"
},
"mfaItems": {
"type": "array",
"items": {
"$ref": "#/definitions/object.MfaItem"
}
},
"name": {
"type": "string"
},
@ -5395,9 +5561,18 @@
"displayName": {
"type": "string"
},
"isEnabled": {
"type": "boolean"
},
"name": {
"type": "string"
},
"options": {
"type": "array",
"items": {
"type": "string"
}
},
"owner": {
"type": "string"
},
@ -5411,9 +5586,6 @@
},
"role": {
"type": "string"
},
"options": {
"type": "array"
}
}
},
@ -5737,6 +5909,9 @@
"name": {
"type": "string"
},
"object": {
"type": "string"
},
"organization": {
"type": "string"
},
@ -6341,6 +6516,9 @@
"passwordSalt": {
"type": "string"
},
"passwordType": {
"type": "string"
},
"patreon": {
"type": "string"
},
@ -6505,6 +6683,9 @@
"name": {
"type": "string"
},
"organization": {
"type": "string"
},
"phone": {
"type": "string"
},
@ -6634,4 +6815,4 @@
"type": "object"
}
}
}
}