mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-06 03:20:13 +08:00
refactor: add getOrCreateSession to simplify process
This commit is contained in:
1 parent
11bc793b12
commit
5a7c4da628
6 files changed
+72
-32
No files matched your search
@@ -80,6 +80,37 @@ paths:
|
||||
message:
|
||||
type: string
|
||||
|
||||
/sessions/active:
|
||||
post:
|
||||
summary: 'Get or create an active session.'
|
||||
tags:
|
||||
- signed-in
|
||||
description: 'This endpoint returns the latest active session for the user, or creates a new one if no active session exists.'
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: 'object'
|
||||
required:
|
||||
- quest_id
|
||||
properties:
|
||||
quest_id:
|
||||
type: 'string'
|
||||
description: 'The ID of the quest.'
|
||||
example: 'helloworld'
|
||||
responses:
|
||||
200:
|
||||
description: 'Return a active session.'
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Session'
|
||||
400:
|
||||
description: 'Bad Request. The request is invalid or malformed.'
|
||||
500:
|
||||
description: 'Internal Server Error.'
|
||||
|
||||
/sessions/{session_id}:
|
||||
get:
|
||||
tags:
|
||||
|
||||
Reference in new issue
Block a user