Skip to content

Commit

Permalink
Spec: ページネーションの変更 (#137)
Browse files Browse the repository at this point in the history
  • Loading branch information
marihachi authored Sep 15, 2024
1 parent 7f91fd9 commit 25f818a
Show file tree
Hide file tree
Showing 4 changed files with 141 additions and 123 deletions.
31 changes: 16 additions & 15 deletions spec/docs/api-reference-v1.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ GET /api/v1/user/getUser
GET /api/v1/user/searchUsers
```
ユーザー情報を検索する。\
レスポンスヘッダーから結果の続きを取得するためのX-Next-CursorとX-Prev-Cursorが返される
レスポンスヘッダーに結果の続きを取得するための`X-Offset`が付加される

### query string
- nextCursor (optional)
- prevCursor (optional)
- offset (optional)
- limit (optional)



Expand All @@ -72,12 +72,12 @@ POST /api/v1/user/deleteUser
GET /api/v1/user/getFollowings
```
指定したユーザーのフォロー一覧を取得する。\
レスポンスヘッダーから結果の続きを取得するためのX-Next-CursorとX-Prev-Cursorが返される
レスポンスヘッダーに結果の続きを取得するための`X-Offset`が付加される

### query string
- userId
- nextCursor (optional)
- prevCursor (optional)
- offset (optional)
- limit (optional)



Expand Down Expand Up @@ -108,12 +108,12 @@ POST /api/v1/user/unfollowUser
GET /api/v1/user/getHomeTimeline
```
ホームタイムラインを取得する。\
レスポンスヘッダーから結果の続きを取得するためのX-Next-CursorとX-Prev-Cursorが返される
レスポンスヘッダーに結果の続きを取得するための`X-Next-Cursor``X-Prev-Cursor`が付加される

### query string
- nextCursor (optional)
- prevCursor (optional)

- limit (optional)


# leaf ネームスペース
Expand Down Expand Up @@ -145,11 +145,11 @@ GET /api/v1/leaf/getLeaf
GET /api/v1/leaf/searchLeafs
```
リーフを検索する。\
レスポンスヘッダーから結果の続きを取得するためのX-Next-CursorとX-Prev-Cursorが返される
レスポンスヘッダーに結果の続きを取得するための`X-Offset`が付加される

### query string
- nextCursor (optional)
- prevCursor (optional)
- offset (optional)
- limit (optional)



Expand Down Expand Up @@ -194,11 +194,11 @@ GET /api/v1/chatroom/getChatroom
GET /api/v1/chatroom/searchChatrooms
```
チャットルームを検索する。\
レスポンスヘッダーから結果の続きを取得するためのX-Next-CursorとX-Prev-Cursorが返される
レスポンスヘッダーに結果の続きを取得するための`X-Offset`が付加される

### query string
- nextCursor (optional)
- prevCursor (optional)
- offset (optional)
- limit (optional)



Expand Down Expand Up @@ -231,9 +231,10 @@ GET /api/v1/chatroom/getTimeline
```
チャットルームのタイムラインを取得する。\
リーフの取得や削除、検索に関してはleafネームスペースのAPIを利用する。\
レスポンスヘッダーでnextCursorとprevCursorが返される
レスポンスヘッダーに結果の続きを取得するための`X-Next-Cursor``X-Prev-Cursor`が付加される

### query string
- chatroomId
- nextCursor (optional)
- prevCursor (optional)
- limit (optional)
131 changes: 65 additions & 66 deletions spec/generated/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,9 @@ paths:
- Leaf
operationId: ChatRoomApi_GetTimeline
parameters:
- $ref: '#/components/parameters/Api.v1.GetChatRoomTimelineQueryString.nextCursor'
- $ref: '#/components/parameters/Api.v1.GetChatRoomTimelineQueryString.prevCursor'
- $ref: '#/components/parameters/Api.v1.CursorControl.nextCursor'
- $ref: '#/components/parameters/Api.v1.CursorControl.prevCursor'
- $ref: '#/components/parameters/Api.v1.CursorControl.limit'
responses:
'200':
description: The request has succeeded.
Expand All @@ -140,8 +141,8 @@ paths:
- ChatRoom
operationId: ChatRoomApi_SearchChatRooms
parameters:
- $ref: '#/components/parameters/Api.v1.SearchChatRoomsQueryString.nextCursor'
- $ref: '#/components/parameters/Api.v1.SearchChatRoomsQueryString.prevCursor'
- $ref: '#/components/parameters/Api.v1.OffsetControl.offset'
- $ref: '#/components/parameters/Api.v1.OffsetControl.limit'
responses:
'200':
description: The request has succeeded.
Expand Down Expand Up @@ -252,8 +253,8 @@ paths:
- Leaf
operationId: LeafApi_SearchLeafs
parameters:
- $ref: '#/components/parameters/Api.v1.SearchLeafsQueryString.nextCursor'
- $ref: '#/components/parameters/Api.v1.SearchLeafsQueryString.prevCursor'
- $ref: '#/components/parameters/Api.v1.OffsetControl.offset'
- $ref: '#/components/parameters/Api.v1.OffsetControl.limit'
responses:
'200':
description: The request has succeeded.
Expand Down Expand Up @@ -299,9 +300,9 @@ paths:
- User
operationId: UserApi_GetFollowings
parameters:
- $ref: '#/components/parameters/Api.v1.OffsetControl.offset'
- $ref: '#/components/parameters/Api.v1.OffsetControl.limit'
- $ref: '#/components/parameters/Api.v1.GetFollowingsQueryString.userId'
- $ref: '#/components/parameters/Api.v1.GetFollowingsQueryString.nextCursor'
- $ref: '#/components/parameters/Api.v1.GetFollowingsQueryString.prevCursor'
responses:
'200':
description: The request has succeeded.
Expand All @@ -318,8 +319,9 @@ paths:
- Leaf
operationId: UserApi_GetHomeTimeline
parameters:
- $ref: '#/components/parameters/Api.v1.GetHomeTimelineQueryString.nextCursor'
- $ref: '#/components/parameters/Api.v1.GetHomeTimelineQueryString.prevCursor'
- $ref: '#/components/parameters/Api.v1.CursorControl.nextCursor'
- $ref: '#/components/parameters/Api.v1.CursorControl.prevCursor'
- $ref: '#/components/parameters/Api.v1.CursorControl.limit'
responses:
'200':
description: The request has succeeded.
Expand Down Expand Up @@ -350,8 +352,8 @@ paths:
- User
operationId: UserApi_SearchUsers
parameters:
- $ref: '#/components/parameters/Api.v1.SearchUsersQueryString.nextCursor'
- $ref: '#/components/parameters/Api.v1.SearchUsersQueryString.prevCursor'
- $ref: '#/components/parameters/Api.v1.OffsetControl.offset'
- $ref: '#/components/parameters/Api.v1.OffsetControl.limit'
responses:
'200':
description: The request has succeeded.
Expand All @@ -378,34 +380,28 @@ paths:
$ref: '#/components/schemas/Api.v1.UnfollowUserBody'
components:
parameters:
Api.v1.GetChatRoomQueryString:
name: chatRoomId
Api.v1.CursorControl.limit:
name: limit
in: query
required: true
required: false
schema:
type: string
Api.v1.GetChatRoomTimelineQueryString.nextCursor:
Api.v1.CursorControl.nextCursor:
name: nextCursor
in: query
required: false
schema:
type: string
Api.v1.GetChatRoomTimelineQueryString.prevCursor:
Api.v1.CursorControl.prevCursor:
name: prevCursor
in: query
required: false
schema:
type: string
Api.v1.GetFollowingsQueryString.nextCursor:
name: nextCursor
in: query
required: false
schema:
type: string
Api.v1.GetFollowingsQueryString.prevCursor:
name: prevCursor
Api.v1.GetChatRoomQueryString:
name: chatRoomId
in: query
required: false
required: true
schema:
type: string
Api.v1.GetFollowingsQueryString.userId:
Expand All @@ -414,18 +410,6 @@ components:
required: true
schema:
type: string
Api.v1.GetHomeTimelineQueryString.nextCursor:
name: nextCursor
in: query
required: false
schema:
type: string
Api.v1.GetHomeTimelineQueryString.prevCursor:
name: prevCursor
in: query
required: false
schema:
type: string
Api.v1.GetLeafQueryString:
name: leafId
in: query
Expand All @@ -444,38 +428,14 @@ components:
required: false
schema:
type: string
Api.v1.SearchChatRoomsQueryString.nextCursor:
name: nextCursor
in: query
required: false
schema:
type: string
Api.v1.SearchChatRoomsQueryString.prevCursor:
name: prevCursor
in: query
required: false
schema:
type: string
Api.v1.SearchLeafsQueryString.nextCursor:
name: nextCursor
Api.v1.OffsetControl.limit:
name: limit
in: query
required: false
schema:
type: string
Api.v1.SearchLeafsQueryString.prevCursor:
name: prevCursor
in: query
required: false
schema:
type: string
Api.v1.SearchUsersQueryString.nextCursor:
name: nextCursor
in: query
required: false
schema:
type: string
Api.v1.SearchUsersQueryString.prevCursor:
name: prevCursor
Api.v1.OffsetControl.offset:
name: offset
in: query
required: false
schema:
Expand Down Expand Up @@ -562,6 +522,24 @@ components:
properties:
userId:
type: string
Api.v1.GetChatRoomTimelineQueryString:
type: object
properties:
nextCursor:
type: string
prevCursor:
type: string
limit:
type: string
Api.v1.GetHomeTimelineQueryString:
type: object
properties:
nextCursor:
type: string
prevCursor:
type: string
limit:
type: string
Api.v1.Leaf:
type: object
required:
Expand All @@ -577,6 +555,27 @@ components:
type: string
content:
type: string
Api.v1.SearchChatRoomsQueryString:
type: object
properties:
offset:
type: string
limit:
type: string
Api.v1.SearchLeafsQueryString:
type: object
properties:
offset:
type: string
limit:
type: string
Api.v1.SearchUsersQueryString:
type: object
properties:
offset:
type: string
limit:
type: string
Api.v1.SigninBody:
type: object
required:
Expand Down
Loading

0 comments on commit 25f818a

Please sign in to comment.