@@ -170,14 +170,7 @@ func (client *ImageClient) GetByUserId(ctx context.Context, userId string) ([]*e
170
170
return nil , err
171
171
}
172
172
173
- var data []byte
174
- data , err = jsoniter .Marshal (ctx )
175
- if err != nil {
176
- reqSpan .LogFields (log .Error (err ))
177
- return nil , err
178
- }
179
-
180
- if _ , err = t .Write (data ); err != nil {
173
+ if _ , err = t .Write ([]byte (userId )); err != nil {
181
174
reqSpan .LogFields (log .Error (err ))
182
175
return nil , err
183
176
}
@@ -228,14 +221,7 @@ func (client *ImageClient) GetCountByUserId(ctx context.Context, userId string)
228
221
return 0 , err
229
222
}
230
223
231
- var data []byte
232
- data , err = jsoniter .Marshal (ctx )
233
- if err != nil {
234
- reqSpan .LogFields (log .Error (err ))
235
- return 0 , err
236
- }
237
-
238
- if _ , err = t .Write (data ); err != nil {
224
+ if _ , err = t .Write ([]byte (userId )); err != nil {
239
225
reqSpan .LogFields (log .Error (err ))
240
226
return 0 , err
241
227
}
@@ -428,7 +414,7 @@ func (client *UserClient) GetById(ctx context.Context, id []byte) (*example.User
428
414
}
429
415
430
416
var data []byte
431
- data , err = jsoniter .Marshal (ctx )
417
+ data , err = jsoniter .Marshal (id )
432
418
if err != nil {
433
419
reqSpan .LogFields (log .Error (err ))
434
420
return nil , err
@@ -486,7 +472,7 @@ func (client *UserClient) Create(ctx context.Context, user *example.User) error
486
472
}
487
473
488
474
var data []byte
489
- data , err = jsoniter .Marshal (ctx )
475
+ data , err = jsoniter .Marshal (user )
490
476
if err != nil {
491
477
reqSpan .LogFields (log .Error (err ))
492
478
return err
0 commit comments