Skip to content

Commit

Permalink
Merge pull request #8 from Kyutech-C3/feat/users
Browse files Browse the repository at this point in the history
feat: implement /users
  • Loading branch information
tosaken1116 authored Apr 6, 2024
2 parents d41ec30 + fa9a3b6 commit 7d65341
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 3 deletions.
49 changes: 47 additions & 2 deletions openapi/api_definition.swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ tags:
- name: DiscordService
- name: SignUpService
- name: DiscordCallbackService
- name: UserIdService
- name: UserService
- name: MeService
consumes:
Expand Down Expand Up @@ -169,6 +170,42 @@ paths:
type: string
tags:
- TagsService
/v1/users:
get:
operationId: UserService_GetUsers
responses:
"200":
description: A successful response.
schema:
$ref: '#/definitions/usersGetUsersResponse'
"422":
description: Validation Error
schema: {}
examples:
application/json:
detail:
- loc:
- string
- 0
msg: string
type: string
parameters:
- name: limit
description: 'Default value: 30'
in: query
required: false
type: integer
format: int32
- name: oldest_user_id
in: query
required: false
type: string
- name: newest_user_id
in: query
required: false
type: string
tags:
- UserService
/v1/users/@me:
get:
operationId: MeService_GetMe
Expand Down Expand Up @@ -218,7 +255,7 @@ paths:
- MeService
/v1/users/{user_id}:
get:
operationId: UserService_GetUser
operationId: UserIdService_GetUser
responses:
"200":
description: A successful response.
Expand All @@ -242,7 +279,7 @@ paths:
required: true
type: string
tags:
- UserService
- UserIdService
definitions:
resourcesAccount:
type: object
Expand Down Expand Up @@ -422,3 +459,11 @@ definitions:
description: |-
Represents a time zone from the
[IANA Time Zone Database](https://www.iana.org/time-zones).
usersGetUsersResponse:
type: object
properties:
users:
type: array
items:
type: object
$ref: '#/definitions/resourcesAccount'
2 changes: 1 addition & 1 deletion proto/schema/users/user_id/user_id.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import "proto/third_party/google/api/annotations.proto";

option go_package = "./";

service UserService {
service UserIdService {
rpc GetUser(GetUserRequest)
returns (proto.schema.users.me.resources.Account) {
option (google.api.http) = {
Expand Down
29 changes: 29 additions & 0 deletions proto/schema/users/users.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// proto/schema/users/users.proto
syntax = "proto3";

package proto.schema.users;

import "proto/schema/users/me/resources/me.proto";
import "proto/third_party/google/api/wrappers.proto";
import "proto/third_party/google/api/annotations.proto";

option go_package = "./";

message GetUsersRequest {
// Default value: 30
google.protobuf.Int32Value limit = 1;
string oldest_user_id = 2;
string newest_user_id = 3;
}

message GetUsersResponse {
repeated proto.schema.users.me.resources.Account users = 1;
}

service UserService {
rpc GetUsers(GetUsersRequest) returns (GetUsersResponse) {
option (google.api.http) = {
get : "/v1/users"
};
};
}

0 comments on commit 7d65341

Please sign in to comment.