Skip to content

Commit

Permalink
🐛 fix id bug
Browse files Browse the repository at this point in the history
  • Loading branch information
李博修 committed Mar 20, 2021
1 parent c7b8043 commit fc104d6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion log.proto
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ message Num {
int64 num = 1;
}
message UserID {
int32 user_id = 1;
bytes user_id = 1;
}
message ListRequest {
bytes user_id = 1;
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func (*server) GetUserMsgs(ctx context.Context, req *logservice.ListRequest) (ar
}
func (*server) GetUserNewMsgNum(ctx context.Context, uid *logservice.UserID) (num *logservice.Num, err error) {
num = &logservice.Num{}
num.Num, err = col.CountDocuments(ctx, bson.M{"operation_target_owner_id": uid.UserId})
num.Num, err = col.CountDocuments(ctx, bson.M{"operation_target_owner_id": helpers.BytesToMongoID(uid.UserId)})
return
}
func main() {
Expand Down
8 changes: 4 additions & 4 deletions service/logservice/log.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit fc104d6

Please sign in to comment.