UpdateUser() works

This commit is contained in:
2022-11-18 23:28:37 +01:00
parent 55f53deadf
commit 35ef2175bc
8 changed files with 329 additions and 44 deletions

View File

@@ -45,6 +45,100 @@
}
}
},
"/api-v2/user/{uid}": {
"get": {
"summary": "Get a user (only self is allowed)",
"operationId": "api-user-get",
"parameters": [
{
"type": "integer",
"description": "UserID",
"name": "uid",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/models.UserJSON"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/ginresp.apiError"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/ginresp.apiError"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/ginresp.apiError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/ginresp.apiError"
}
}
}
},
"patch": {
"description": "The body-values are optional, only send the ones you want to update",
"summary": "(Partially) update a user (only self allowed)",
"operationId": "api-user-update",
"parameters": [
{
"description": " ",
"name": "post_body",
"in": "body",
"schema": {
"$ref": "#/definitions/handler.UpdateUser.body"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/models.UserJSON"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/ginresp.apiError"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/ginresp.apiError"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/ginresp.apiError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/ginresp.apiError"
}
}
}
}
},
"/api/ack.php": {
"get": {
"summary": "Acknowledge that a message was received",
@@ -482,19 +576,19 @@
"handler.CreateUser.body": {
"type": "object",
"properties": {
"agentModel": {
"agent_model": {
"type": "string"
},
"agentVersion": {
"agent_version": {
"type": "string"
},
"clientType": {
"client_type": {
"type": "string"
},
"fcmtoken": {
"fcm_token": {
"type": "string"
},
"proToken": {
"pro_token": {
"type": "string"
},
"username": {
@@ -645,6 +739,17 @@
}
}
},
"handler.UpdateUser.body": {
"type": "object",
"properties": {
"pro_token": {
"type": "string"
},
"username": {
"type": "string"
}
}
},
"handler.Upgrade.response": {
"type": "object",
"properties": {