diff --git a/exam/api/Users/Users.php b/exam/api/Users/Users.php new file mode 100644 index 0000000..bd2e55d --- /dev/null +++ b/exam/api/Users/Users.php @@ -0,0 +1,15 @@ + + Requires logged in user to have admin permissions. + security: + - BasicAuth: [] + responses: + 200: + description: Success + content: + application/json: + schema: + $ref: "#/components/schemas/UserListResponse" + examples: + Success: + value: + [ + { + "id": 1, + "username": "Admin", + "status": 1, + "email": "marvin@zedat.fu-berlin.de", + "image": "669d41fbdb56b.png", + "isAdmin": true, + "memberSince": + { + "date": "2024-07-22 14:02:49.000000", + "timezone_type": 3, + "timezone": "Europe/Berlin", + }, + "postCount": 3, + }, + { + "id": 2, + "username": "Max", + "status": 1, + "email": "max@moritz.net", + "image": "profilbilder/max.svg", + "isAdmin": false, + "memberSince": + { + "date": "2024-07-22 03:07:41.000000", + "timezone_type": 3, + "timezone": "Europe/Berlin", + }, + "postCount": 2, + }, + ] + tags: + - User /user{id}: get: summary: Get user @@ -187,8 +238,15 @@ paths: "username": "Admin", "status": 1, "email": "marvin@zedat.fu-berlin.de", - "image": "profilbilder\\/admin.svg", + "image": "669d41fbdb56b.png", "isAdmin": true, + "memberSince": + { + "date": "2024-07-22 14:02:49.000000", + "timezone_type": 3, + "timezone": "Europe/Berlin", + }, + "postCount": 3, } 404: description: User not found @@ -328,6 +386,18 @@ components: nullable: true isAdmin: type: boolean + memberSince: + type: object + properties: + date: + type: string + format: date-time + timezone_type: + type: number + timezone: + type: string + postCount: + type: number UserUpdateRequest: type: object properties: @@ -359,12 +429,15 @@ components: code: type: string format: uuid4 + UserListResponse: + type: array + items: + $ref: "#/components/schemas/UserResponse" securitySchemes: BasicAuth: type: apiKey name: token in: header - format: uuid4 tags: - name: Login/Logout - name: Register diff --git a/exam/api/docs/index.html b/exam/api/docs/index.html index f2098b8..fc773ba 100644 --- a/exam/api/docs/index.html +++ b/exam/api/docs/index.html @@ -366,7 +366,7 @@ data-styled.g137[id="sc-kvXgyf"]{content:"fBvPoH,"}/*!sc*/
-{- "code": "string"
}true{- "code": "string"
}trueList all users.
Requires logged in user to have admin permissions.
[- {
- "id": 1,
- "username": "Admin",
- "status": 1,
- "email": "marvin@zedat.fu-berlin.de",
- "image": "669d41fbdb56b.png",
- "isAdmin": true,
- "memberSince": {
- "date": "2024-07-22 14:02:49.000000",
- "timezone_type": 3,
- "timezone": "Europe/Berlin"
}, - "postCount": 3
}, - {
- "id": 2,
- "username": "Max",
- "status": 1,
- "email": "max@moritz.net",
- "image": "profilbilder/max.svg",
- "isAdmin": false,
- "memberSince": {
- "date": "2024-07-22 03:07:41.000000",
- "timezone_type": 3,
- "timezone": "Europe/Berlin"
}, - "postCount": 2
}
]Get user by ID