implement admin syste,

This commit is contained in:
2025-04-07 21:54:19 +02:00
parent 600f51ed1f
commit be05f2d895
16 changed files with 1701 additions and 99 deletions

View File

@@ -1014,6 +1014,537 @@
}
}
}
},
"delete": {
"summary": "Delete relationship between two persons",
"operationId": "deleteRelationship",
"parameters": [
{
"name": "id1",
"in": "path",
"required": true,
"schema": {
"type": "integer"
}
},
{
"name": "id2",
"in": "path",
"required": true,
"schema": {
"type": "integer"
}
},
{
"name": "X-User-ID",
"in": "header",
"required": true,
"schema": {
"type": "integer"
}
}
],
"responses": {
"200": {
"description": "Relationship deleted",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
},
"400": {
"description": "Bad request",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
},
"401": {
"description": "Unauthorized",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
},
"500": {
"description": "Internal server error",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
}
}
}
},
"/admin/{id1}": {
"get": {
"summary": "Get profile Admins",
"operationId": "getProfileAdmins",
"parameters": [
{
"name": "id1",
"in": "path",
"required": true,
"schema": {
"type": "integer"
}
},
{
"name": "X-User-ID",
"in": "header",
"required": true,
"schema": {
"type": "integer"
}
}
],
"responses": {
"200": {
"description": "Admins retrieved",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"admins": {
"type": "array",
"items": {
"$ref": "#/components/schemas/OptimizedPersonNode"
}
}
}
}
}
}
},
"400": {
"description": "Bad request",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
},
"401": {
"description": "Unauthorized",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
},
"500": {
"description": "Internal server error",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
}
}
}
},
"/admin/{id1}/{id2}": {
"get": {
"summary": "Get admin relationship between two persons",
"operationId": "getAdminRelationship",
"parameters": [
{
"name": "id1",
"in": "path",
"required": true,
"schema": {
"type": "integer"
}
},
{
"name": "id2",
"in": "path",
"required": true,
"schema": {
"type": "integer"
}
},
{
"name": "X-User-ID",
"in": "header",
"required": true,
"schema": {
"type": "integer"
}
}
],
"responses": {
"200": {
"description": "Admin retrieved",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Admin"
}
}
}
},
"400": {
"description": "Bad request",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
},
"401": {
"description": "Unauthorized",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
},
"500": {
"description": "Internal server error",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
}
}
},
"post": {
"summary": "Create admin relationship between two persons",
"operationId": "createAdminRelationship",
"parameters": [
{
"name": "id1",
"in": "path",
"required": true,
"schema": {
"type": "integer"
}
},
{
"name": "id2",
"in": "path",
"required": true,
"schema": {
"type": "integer"
}
},
{
"name": "X-User-ID",
"in": "header",
"required": true,
"schema": {
"type": "integer"
}
}
],
"responses": {
"200": {
"description": "Admin created",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Admin"
}
}
}
},
"400": {
"description": "Bad request",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
},
"401": {
"description": "Unauthorized",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
},
"500": {
"description": "Internal server error",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
}
}
},
"delete":{
"summary": "Delete admin relationship between two persons",
"operationId": "deleteAdminRelationship",
"parameters": [
{
"name": "id1",
"in": "path",
"required": true,
"schema": {
"type": "integer"
}
},
{
"name": "id2",
"in": "path",
"required": true,
"schema": {
"type": "integer"
}
},
{
"name": "X-User-ID",
"in": "header",
"required": true,
"schema": {
"type": "integer"
}
}
],
"responses": {
"200": {
"description": "Admin deleted",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
},
"400": {
"description": "Bad request",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
},
"401": {
"description": "Unauthorized",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
},
"500": {
"description": "Internal server error",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
}
}
}
},
"/managed_profiles": {
"get": {
"summary": "Get managed profiles",
"operationId": "getManagedProfiles",
"parameters": [
{
"name": "X-User-ID",
"in": "header",
"required": true,
"schema": {
"type": "integer"
}
}
],
"responses": {
"200": {
"description": "Managed Profiles retrieved",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"admins": {
"type": "array",
"items": {
"$ref": "#/components/schemas/OptimizedPersonNode"
}
}
}
}
}
}
},
"400": {
"description": "Bad request",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
},
"401": {
"description": "Unauthorized",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
},
"500": {
"description": "Internal server error",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"msg": {
"type": "string"
}
}
}
}
}
}
}
}
},
"/recipe/{id}": {
@@ -1977,7 +2508,12 @@
"type": "string",
"format": "date",
"nullable": true
},
"profile_picture":{
"type": "string",
"nullable": true
}
}
},
"FamilyTree": {
@@ -2162,7 +2698,12 @@
"type": "string"
},
"properties": {
"type": "object"
"type": "object",
"properties": {
"added": {
"type": "integer"
}
}
}
}
}