Skip to content

Commit

Permalink
Merge pull request #155 from GiganticMinecraft/addSessionEndpoints
Browse files Browse the repository at this point in the history
docs: session に関するエンドポイントを定義
  • Loading branch information
rito528 authored Aug 20, 2024
2 parents 69c6b46 + 03676b1 commit 7302b22
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
41 changes: 41 additions & 0 deletions src/endpoints/session.tsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import "@typespec/http";
import "@typespec/rest";
import "../models/errors.tsp";
import "../models/user.tsp";

using TypeSpec.Http;
using TypeSpec.Rest;

namespace SeichiPortalApiSchema;

@tag("Sessions")
@route("/session")
namespace Session {
@post
@summary("セッションを開始する")
op create(): {
@statusCode statusCode: 200;

/**
* `SEICHI_PORTAL__SESSION_ID` という名前の Cookie に30分間有効なセッション ID を設定します。
*/
@header SetCookie: string;
} | {
@statusCode statusCode: 401 | 500;
@body body: Error;
};

@delete
@summary("セッションを終了する")
op delete(): {
@statusCode statusCode: 200;

/**
* `SEICHI_PORTAL__SESSION_ID` という名前の Cookie に30分間有効なセッション ID を削除します。
*/
@header SetCookie: string;
} | {
@statusCode statusCode: 401 | 500;
@body body: Error;
};
}
1 change: 1 addition & 0 deletions src/main.tsp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import "./endpoints/forms.tsp";
import "./endpoints/users.tsp";
import "./endpoints/session.tsp";
import "@typespec/openapi";

using TypeSpec.Http;
Expand Down

0 comments on commit 7302b22

Please sign in to comment.