Skip to content
This repository was archived by the owner on Feb 4, 2021. It is now read-only.

Commit e9b09c2

Browse files
committed
Fix proto
1 parent 401f426 commit e9b09c2

9 files changed

+95
-497
lines changed

api/contribution_conllections.validator.pb.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/password_resets.validator.pb.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/protos/users.proto

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,6 @@ service UserService {
5757
body: "*"
5858
};
5959
}
60-
rpc UpdatePassword (UpdatePasswordRequest) returns (google.protobuf.Empty) {
61-
option (google.api.http) = {
62-
put: "/user/password"
63-
};
64-
}
6560
}
6661

6762
message User {
@@ -133,9 +128,3 @@ message UpdateUserProfileRequest {
133128
message UpdateUserIconRequest {
134129
bytes image = 1;
135130
}
136-
137-
message UpdatePasswordRequest {
138-
string password = 1;
139-
string new_password = 2;
140-
string new_password_repeat = 3;
141-
}

api/users.pb.go

Lines changed: 82 additions & 397 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/users.pb.gw.go

Lines changed: 0 additions & 50 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/users.swagger.json

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -128,22 +128,6 @@
128128
]
129129
}
130130
},
131-
"/user/password": {
132-
"put": {
133-
"operationId": "UpdatePassword",
134-
"responses": {
135-
"200": {
136-
"description": "",
137-
"schema": {
138-
"$ref": "#/definitions/protobufEmpty"
139-
}
140-
}
141-
},
142-
"tags": [
143-
"UserService"
144-
]
145-
}
146-
},
147131
"/user/profile": {
148132
"patch": {
149133
"operationId": "UpdateUserProfile",
@@ -441,11 +425,6 @@
441425
"type": "string"
442426
}
443427
}
444-
},
445-
"protobufEmpty": {
446-
"type": "object",
447-
"description": "service Foo {\n rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n }\n\nThe JSON representation for `Empty` is empty JSON object `{}`.",
448-
"title": "A generic empty message that you can re-use to avoid defining duplicated\nempty messages in your APIs. A typical example is to use it as the request\nor the response type of an API method. For instance:"
449428
}
450429
}
451430
}

api/users.validator.pb.go

Lines changed: 0 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/run.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ func Run() error {
6363
server.NewInvitationServiceServer(store, cli),
6464
server.NewContributionConllectionServiceServer(store, cfg),
6565
server.NewEmailConfirmationServiceServer(store, cli, cfg),
66+
server.NewPasswordResetServiceServer(store, cfg),
6667
),
6768
)
6869

app/server/password_resets_server.go

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import (
99
"google.golang.org/grpc/status"
1010

1111
api_pb "github.com/ProgrammingLab/prolab-accounts/api"
12+
"github.com/ProgrammingLab/prolab-accounts/app/config"
13+
"github.com/ProgrammingLab/prolab-accounts/app/di"
1214
)
1315

1416
// PasswordResetServiceServer is a composite interface of api_pb.PasswordResetServiceServer and grapiserver.Server.
@@ -18,16 +20,16 @@ type PasswordResetServiceServer interface {
1820
}
1921

2022
// NewPasswordResetServiceServer creates a new PasswordResetServiceServer instance.
21-
func NewPasswordResetServiceServer() PasswordResetServiceServer {
22-
return &passwordResetServiceServerImpl{}
23+
func NewPasswordResetServiceServer(store di.StoreComponent, cfg *config.Config) PasswordResetServiceServer {
24+
return &passwordResetServiceServerImpl{
25+
StoreComponent: store,
26+
cfg: cfg,
27+
}
2328
}
2429

2530
type passwordResetServiceServerImpl struct {
26-
}
27-
28-
func (s *passwordResetServiceServerImpl) ListPasswordResets(ctx context.Context, req *api_pb.ListPasswordResetsRequest) (*api_pb.ListPasswordResetsResponse, error) {
29-
// TODO: Not yet implemented.
30-
return nil, status.Error(codes.Unimplemented, "TODO: You should implement it!")
31+
di.StoreComponent
32+
cfg *config.Config
3133
}
3234

3335
func (s *passwordResetServiceServerImpl) GetPasswordReset(ctx context.Context, req *api_pb.GetPasswordResetRequest) (*api_pb.PasswordReset, error) {
@@ -40,12 +42,7 @@ func (s *passwordResetServiceServerImpl) CreatePasswordReset(ctx context.Context
4042
return nil, status.Error(codes.Unimplemented, "TODO: You should implement it!")
4143
}
4244

43-
func (s *passwordResetServiceServerImpl) UpdatePasswordReset(ctx context.Context, req *api_pb.UpdatePasswordResetRequest) (*api_pb.PasswordReset, error) {
44-
// TODO: Not yet implemented.
45-
return nil, status.Error(codes.Unimplemented, "TODO: You should implement it!")
46-
}
47-
48-
func (s *passwordResetServiceServerImpl) DeletePasswordReset(ctx context.Context, req *api_pb.DeletePasswordResetRequest) (*empty.Empty, error) {
45+
func (s *passwordResetServiceServerImpl) UpdatePassword(ctx context.Context, req *api_pb.UpdatePasswordRequest) (*empty.Empty, error) {
4946
// TODO: Not yet implemented.
5047
return nil, status.Error(codes.Unimplemented, "TODO: You should implement it!")
5148
}

0 commit comments

Comments
 (0)