Skip to content

Commit 750af7f

Browse files
Funch APIのcreate実装 (#62)
* 作成モデルの定義 * funch-api作成サービス * タイポ修正 * 余計なスペース削除 * format * Adminのcreate実装 --------- Co-authored-by: Hikaru Saito <beretta0602@gmail.com>
1 parent 058bf5f commit 750af7f

3 files changed

Lines changed: 23 additions & 0 deletions

File tree

src/admin-bff-api/service.tsp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -669,6 +669,16 @@ namespace AdminBFFService {
669669
Body<{
670670
menuItems: FunchService.MenuItem[];
671671
}>) | UnauthorizedResponse;
672+
673+
/**
674+
* メニューを作成する
675+
* @param body 作成するメニューの情報
676+
* @returns 作成されたメニュー
677+
*/
678+
@post create(@body body: FunchService.MenuItemRequest): (CreatedResponse &
679+
Body<{
680+
menuItem: FunchService.MenuItem;
681+
}>) | UnauthorizedResponse;
672682
}
673683

674684
@route("/v1/facultyRooms")

src/funch-api/model.tsp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@ namespace FunchService {
88
prices: Price[];
99
}
1010

11+
model MenuItemRequest {
12+
date: plainDate;
13+
name: string;
14+
imageUrl: url;
15+
category: Category;
16+
prices: Price[];
17+
}
18+
1119
model Price {
1220
/**
1321
* サイズ

src/funch-api/service.tsp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,10 @@ namespace FunchService {
3030
Body<{
3131
menuItems: MenuItem[];
3232
}>;
33+
34+
@post create(@body body: MenuItemRequest): CreatedResponse &
35+
Body<{
36+
menuItem: MenuItem;
37+
}>;
3338
}
3439
}

0 commit comments

Comments
 (0)