Skip to content

Commit 49dd0a3

Browse files
committed
updated
1 parent 2c0f52d commit 49dd0a3

File tree

6 files changed

+54
-125
lines changed

6 files changed

+54
-125
lines changed

cmd/client/main.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,19 +88,17 @@ func main() {
8888
if false {
8989
updatePostClient := client.NewUpdatePostClient(conn)
9090

91-
title := "My new updated title"
91+
title := "My new updated title for my blog"
9292
args := &pb.UpdatePostRequest{
93-
Id: "629147ff3c92aed11d49394b",
94-
Post: &pb.UpdatePostBody{
95-
Title: &title,
96-
},
93+
Id: "629169e00a6c7cfd24e2129d",
94+
Title: &title,
9795
}
9896

9997
updatePostClient.UpdatePost(args)
10098
}
10199

102100
// Get Post
103-
if true {
101+
if false {
104102
getPostClient := client.NewGetPostClient(conn)
105103

106104
args := &pb.PostRequest{

gapi/rpc_update_post.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ func (postServer *PostServer) UpdatePost(ctx context.Context, req *pb.UpdatePost
1616
postId := req.GetId()
1717

1818
post := &models.UpdatePost{
19-
Title: req.Post.GetTitle(),
20-
Content: req.Post.GetContent(),
21-
Image: req.Post.GetImage(),
22-
User: req.Post.GetUser(),
19+
Title: req.GetTitle(),
20+
Content: req.GetContent(),
21+
Image: req.GetImage(),
22+
User: req.GetUser(),
2323
UpdatedAt: time.Now(),
2424
}
2525

pb/rpc_create_post.pb.go

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

pb/rpc_update_post.pb.go

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

proto/rpc_update_post.proto

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,8 @@ option go_package = "github.com/wpcodevo/golang-mongodb/pb";
66

77
message UpdatePostRequest {
88
string Id = 1;
9-
UpdatePostBody post = 2;
10-
}
11-
12-
message UpdatePostBody {
13-
optional string Title = 1;
14-
optional string Content = 2;
15-
optional string Image = 3;
16-
optional string User = 4;
9+
optional string Title = 2;
10+
optional string Content = 3;
11+
optional string Image = 4;
12+
optional string User = 5;
1713
}

tmp/build-errors.log

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
exit status 1exit status 0xc000013aexit status 1exit status 1exit status 2exit status 2exit status 2exit status 2exit status 2exit status 2exit status 2exit status 2exit status 2exit status 2exit status 2exit status 2exit status 2exit status 2exit status 2exit status 2exit status 2exit status 1exit status 1exit status 2exit status 1exit status 1exit status 2exit status 1exit status 2exit status 1exit status 2exit status 1exit status 1exit status 2exit status 2exit status 0xc000013a
1+
exit status 1exit status 0xc000013aexit status 1exit status 1exit status 2exit status 2exit status 2exit status 2exit status 2exit status 2exit status 2exit status 2exit status 2exit status 2exit status 2exit status 2exit status 2exit status 2exit status 2exit status 2exit status 2exit status 1exit status 1exit status 2exit status 1exit status 1exit status 2exit status 1exit status 2exit status 1exit status 2exit status 1exit status 1exit status 2exit status 2exit status 0xc000013aexit status 2

0 commit comments

Comments
 (0)