Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

バックエンドのAPIと連携させる #61

Merged
merged 3 commits into from
Aug 31, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
[feat] create api schema
  • Loading branch information
averak committed Aug 31, 2021
commit bd44bd5fa8cead5e2f7214d17430fef7a85379b2
13 changes: 0 additions & 13 deletions client/src/lib/api/hello.ts

This file was deleted.

4 changes: 4 additions & 0 deletions client/src/lib/enums/user-role-enum.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export enum UserRoleEnum {
ADMIN = 1,
MEMBER = 2,
}
4 changes: 4 additions & 0 deletions client/src/lib/environments/environment.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export const environment = {
API_BASE_URI: "https://api.abelab.dev/timestamp",
CREDENTIALS_KEY: "Authorization",
};
15 changes: 15 additions & 0 deletions client/src/lib/model/stamp-model.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// スタンプモデル
export interface StampModel {
id: number;
title: string;
description: string;
userId: number;
attachments: StampAttachmentModel[];
}

// 添付ファイルモデル
export interface StampAttachmentModel {
id: number;
name: string;
uuid: string;
}
11 changes: 11 additions & 0 deletions client/src/lib/model/user-model.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { UserRoleEnum } from "../enums/user-role-enum";

// ユーザモデル
export interface UserModel {
id: number;
email: string;
password: string;
firstName: string;
lastName: string;
roleId: UserRoleEnum;
}
5 changes: 5 additions & 0 deletions client/src/lib/request/login-request.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// ログインAPIのリクエストボディ
export interface LoginRequest {
email: string;
password: string;
}
9 changes: 9 additions & 0 deletions client/src/lib/request/stamp-request.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// スタンプ作成APIのリクエストボディ
export interface StampCreateRequest {
title: string;
description: string;
attachments: {
name: string;
content: string;
};
}
31 changes: 31 additions & 0 deletions client/src/lib/request/user-request.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { UserRoleEnum } from "../enums/user-role-enum";

// ユーザ作成APIのリクエストボディ
export interface UserCreateRequest {
email: string;
password: string;
firstName: string;
lastName: string;
roleId: UserRoleEnum;
}

// ユーザ更新APIのリクエストボディ
export interface UserUpdateRequest {
email: string;
firstName: string;
lastName: string;
roleId: UserRoleEnum;
}

// ログインユーザ更新APIのリクエストボディ
export interface LoginUserUpdateRequest {
email: string;
firstName: string;
lastName: string;
}

// ログインユーザパスワード更新APIのリクエストボディ
export interface LoginUserPasswordRequest {
currentPassword: string;
newPassword: string;
}