refactor: add getOrCreateSession to simplify process

This commit is contained in:
wancat committed 2023-10-30 22:43:27 +08:00
1 parent 11bc793b12
commit 5a7c4da628
6 files changed
+72 -32

No files matched your search

+31
View File
@@ -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: