@@ -35,7 +35,7 @@ func main() {
3535 }
3636
3737 // Sign In
38- if true {
38+ if false {
3939 signInUserClient := client .NewSignInUserClient (conn )
4040
4141 credentials := & pb.SignInUserInput {
@@ -56,4 +56,68 @@ func main() {
5656
5757 }
5858
59+ // List Posts
60+ if false {
61+ listPostsClient := client .NewListPostsClient (conn )
62+
63+ var page int64 = 1
64+ var limit int64 = 10
65+ args := & pb.GetPostsRequest {
66+ Page : & page ,
67+ Limit : & limit ,
68+ }
69+
70+ listPostsClient .ListPosts (args )
71+ }
72+
73+ // Create Post
74+ if false {
75+ createPostClient := client .NewCreatePostClient (conn )
76+
77+ args := & pb.CreatePostRequest {
78+ Title : "My second gRPC post with joy" ,
79+ Content : "It's always good to learn new technologies" ,
80+ User : "62908e0a42a608d5aeae2f64" ,
81+ Image : "default.png" ,
82+ }
83+
84+ createPostClient .CreatePost (args )
85+ }
86+
87+ // Update Post
88+ if false {
89+ updatePostClient := client .NewUpdatePostClient (conn )
90+
91+ title := "My new updated title"
92+ args := & pb.UpdatePostRequest {
93+ Id : "629147ff3c92aed11d49394b" ,
94+ Post : & pb.UpdatePostBody {
95+ Title : & title ,
96+ },
97+ }
98+
99+ updatePostClient .UpdatePost (args )
100+ }
101+
102+ // Get Post
103+ if true {
104+ getPostClient := client .NewGetPostClient (conn )
105+
106+ args := & pb.PostRequest {
107+ Id : "629169e00a6c7cfd24e2129d" ,
108+ }
109+
110+ getPostClient .GetPost (args )
111+ }
112+
113+ // Delete Post
114+ if false {
115+ deletePostClient := client .NewDeletePostClient (conn )
116+
117+ args := & pb.PostRequest {
118+ Id : "629147ff3c92aed11d49394b" ,
119+ }
120+
121+ deletePostClient .DeletePost (args )
122+ }
59123}
0 commit comments