passport_thrift_client 0.0.9 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/passport_thrift_client.rb +13 -5
- data/lib/remote_passport_types.rb +15 -5
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: de9a26852607376df39ad6148062253bc6a5709d
|
4
|
+
data.tar.gz: f843d6dd60ca52689f7a7ce4c27f36f5c25cf7e7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2e20f5d79b4f6eca0316b0e218076120b3277dc90e24d603fa1432d3ccb6bcf99b6d9d282ae0ca86fda86bd197a98963ae15c4bc4959b7ffffdd62967f976035
|
7
|
+
data.tar.gz: f98430d6509fc67ac06deb40b98604c34cfe1290b30d3083d813f7446dfcdbbdd854d05ee0c29e9b11ed7bed77b7520bc4b8b0d0b99ca1f96459d396498589ed
|
@@ -60,6 +60,14 @@ module Passport
|
|
60
60
|
@@logger.error("thriftUserProfileService destroyed!")
|
61
61
|
end
|
62
62
|
|
63
|
+
def save(profile = {})
|
64
|
+
if (profile['uid'].nil?)
|
65
|
+
return
|
66
|
+
end
|
67
|
+
profile = Passport::Thrift::Profile.new(profile)
|
68
|
+
@thriftClient.save(profile)
|
69
|
+
end
|
70
|
+
|
63
71
|
def getProfileByUid(uid)
|
64
72
|
profile = @thriftClient.getProfileByUid(uid)
|
65
73
|
return convert_profile_to_hash(profile)
|
@@ -144,7 +152,7 @@ module Passport
|
|
144
152
|
end
|
145
153
|
|
146
154
|
def convert_profile_to_hash(profile)
|
147
|
-
unless profile.nil?
|
155
|
+
unless profile.nil? || profile.isNull
|
148
156
|
profile = profile.to_hash
|
149
157
|
if profile['createTime'] > 0
|
150
158
|
profile['createTime'] = Time.at(profile['createTime'] / 1000).to_s
|
@@ -175,7 +183,7 @@ module Passport
|
|
175
183
|
end
|
176
184
|
|
177
185
|
def convert_user_basicinfo_to_hash(profile)
|
178
|
-
unless profile.nil?
|
186
|
+
unless profile.nil? || profile.isNull
|
179
187
|
profile = profile.to_hash
|
180
188
|
if profile['createdTime'] > 0
|
181
189
|
profile['createdTime'] = Time.at(profile['createdTime'] / 1000).to_s
|
@@ -327,7 +335,7 @@ module Passport
|
|
327
335
|
end
|
328
336
|
|
329
337
|
def convert_passport_to_hash(passport)
|
330
|
-
unless passport.nil?
|
338
|
+
unless passport.nil? || passport.isNull
|
331
339
|
passport = passport.to_hash
|
332
340
|
if passport['createTime'] > 0
|
333
341
|
passport['createTime'] = Time.at(passport['createTime'] / 1000).to_s
|
@@ -379,7 +387,7 @@ module Passport
|
|
379
387
|
end
|
380
388
|
|
381
389
|
def convert_stat_track_model_to_hash(statTrackModel)
|
382
|
-
unless statTrackModel.nil?
|
390
|
+
unless statTrackModel.nil? || statTrackModel.isNull
|
383
391
|
statTrackModel = statTrackModel.to_hash
|
384
392
|
return statTrackModel
|
385
393
|
end
|
@@ -460,7 +468,7 @@ module Passport
|
|
460
468
|
end
|
461
469
|
|
462
470
|
def convert_sync_set_to_hash(sync_set)
|
463
|
-
unless sync_set.nil?
|
471
|
+
unless sync_set.nil? || sync_set.isNull
|
464
472
|
return sync_set.to_hash
|
465
473
|
end
|
466
474
|
return nil
|
@@ -126,6 +126,7 @@ module Passport
|
|
126
126
|
ISROBOT = 8
|
127
127
|
ISBLACKLISTED = 9
|
128
128
|
ISDELETED = 10
|
129
|
+
ISNULL = 11
|
129
130
|
|
130
131
|
FIELDS = {
|
131
132
|
UID => {:type => ::Thrift::Types::I64, :name => 'uid'},
|
@@ -137,7 +138,8 @@ module Passport
|
|
137
138
|
CREATETIME => {:type => ::Thrift::Types::I64, :name => 'createTime'},
|
138
139
|
ISROBOT => {:type => ::Thrift::Types::BOOL, :name => 'isRobot'},
|
139
140
|
ISBLACKLISTED => {:type => ::Thrift::Types::BOOL, :name => 'isBlacklisted'},
|
140
|
-
ISDELETED => {:type => ::Thrift::Types::BOOL, :name => 'isDeleted'}
|
141
|
+
ISDELETED => {:type => ::Thrift::Types::BOOL, :name => 'isDeleted'},
|
142
|
+
ISNULL => {:type => ::Thrift::Types::BOOL, :name => 'isNull'}
|
141
143
|
}
|
142
144
|
|
143
145
|
def struct_fields; FIELDS; end
|
@@ -172,12 +174,14 @@ module Passport
|
|
172
174
|
TID = 2
|
173
175
|
TNAME = 3
|
174
176
|
TIME = 4
|
177
|
+
ISNULL = 5
|
175
178
|
|
176
179
|
FIELDS = {
|
177
180
|
UID => {:type => ::Thrift::Types::I64, :name => 'uid'},
|
178
181
|
TID => {:type => ::Thrift::Types::I64, :name => 'tid'},
|
179
182
|
TNAME => {:type => ::Thrift::Types::STRING, :name => 'tname', :optional => true},
|
180
|
-
TIME => {:type => ::Thrift::Types::DOUBLE, :name => 'time'}
|
183
|
+
TIME => {:type => ::Thrift::Types::DOUBLE, :name => 'time'},
|
184
|
+
ISNULL => {:type => ::Thrift::Types::BOOL, :name => 'isNull'}
|
181
185
|
}
|
182
186
|
|
183
187
|
def struct_fields; FIELDS; end
|
@@ -199,6 +203,7 @@ module Passport
|
|
199
203
|
RELAY = 7
|
200
204
|
THIRDPARTYNAME = 8
|
201
205
|
THIRDPARTYUSERID = 9
|
206
|
+
ISNULL = 10
|
202
207
|
|
203
208
|
FIELDS = {
|
204
209
|
ID => {:type => ::Thrift::Types::I64, :name => 'id'},
|
@@ -209,7 +214,8 @@ module Passport
|
|
209
214
|
WEBFAVORITE => {:type => ::Thrift::Types::BOOL, :name => 'webFavorite'},
|
210
215
|
RELAY => {:type => ::Thrift::Types::BOOL, :name => 'relay'},
|
211
216
|
THIRDPARTYNAME => {:type => ::Thrift::Types::STRING, :name => 'thirdpartyName', :optional => true},
|
212
|
-
THIRDPARTYUSERID => {:type => ::Thrift::Types::I64, :name => 'thirdpartyUserId'}
|
217
|
+
THIRDPARTYUSERID => {:type => ::Thrift::Types::I64, :name => 'thirdpartyUserId'},
|
218
|
+
ISNULL => {:type => ::Thrift::Types::BOOL, :name => 'isNull'}
|
213
219
|
}
|
214
220
|
|
215
221
|
def struct_fields; FIELDS; end
|
@@ -323,6 +329,7 @@ module Passport
|
|
323
329
|
WEBBACKGROUNDPIC = 73
|
324
330
|
WEBBACKGROUNDPICPOSITIONY = 74
|
325
331
|
WEBBACKGROUNDPICPOSITIONX = 75
|
332
|
+
ISNULL = 76
|
326
333
|
|
327
334
|
FIELDS = {
|
328
335
|
UID => {:type => ::Thrift::Types::I64, :name => 'uid'},
|
@@ -399,7 +406,8 @@ module Passport
|
|
399
406
|
BACKGROUNDPIC => {:type => ::Thrift::Types::STRING, :name => 'backgroundPic', :optional => true},
|
400
407
|
WEBBACKGROUNDPIC => {:type => ::Thrift::Types::STRING, :name => 'webBackgroundPic', :optional => true},
|
401
408
|
WEBBACKGROUNDPICPOSITIONY => {:type => ::Thrift::Types::DOUBLE, :name => 'webBackgroundPicPositionY'},
|
402
|
-
WEBBACKGROUNDPICPOSITIONX => {:type => ::Thrift::Types::DOUBLE, :name => 'webBackgroundPicPositionX'}
|
409
|
+
WEBBACKGROUNDPICPOSITIONX => {:type => ::Thrift::Types::DOUBLE, :name => 'webBackgroundPicPositionX'},
|
410
|
+
ISNULL => {:type => ::Thrift::Types::BOOL, :name => 'isNull'}
|
403
411
|
}
|
404
412
|
|
405
413
|
def struct_fields; FIELDS; end
|
@@ -453,6 +461,7 @@ module Passport
|
|
453
461
|
GUIDEVOICEPANEL = 39
|
454
462
|
GUIDESHAREPANEL = 40
|
455
463
|
ISINBLACKLIST = 41
|
464
|
+
ISNULL = 42
|
456
465
|
|
457
466
|
FIELDS = {
|
458
467
|
UID => {:type => ::Thrift::Types::I64, :name => 'uid'},
|
@@ -495,7 +504,8 @@ module Passport
|
|
495
504
|
GUIDEPLAYPANEL => {:type => ::Thrift::Types::BOOL, :name => 'guidePlayPanel'},
|
496
505
|
GUIDEVOICEPANEL => {:type => ::Thrift::Types::BOOL, :name => 'guideVoicePanel'},
|
497
506
|
GUIDESHAREPANEL => {:type => ::Thrift::Types::BOOL, :name => 'guideSharePanel'},
|
498
|
-
ISINBLACKLIST => {:type => ::Thrift::Types::BOOL, :name => 'isInBlackList'}
|
507
|
+
ISINBLACKLIST => {:type => ::Thrift::Types::BOOL, :name => 'isInBlackList'},
|
508
|
+
ISNULL => {:type => ::Thrift::Types::BOOL, :name => 'isNull'}
|
499
509
|
}
|
500
510
|
|
501
511
|
def struct_fields; FIELDS; end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: passport_thrift_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- rick
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-03-07 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email:
|
@@ -33,12 +33,12 @@ require_paths:
|
|
33
33
|
- lib
|
34
34
|
required_ruby_version: !ruby/object:Gem::Requirement
|
35
35
|
requirements:
|
36
|
-
- -
|
36
|
+
- - ">="
|
37
37
|
- !ruby/object:Gem::Version
|
38
38
|
version: '0'
|
39
39
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
40
40
|
requirements:
|
41
|
-
- -
|
41
|
+
- - ">="
|
42
42
|
- !ruby/object:Gem::Version
|
43
43
|
version: '0'
|
44
44
|
requirements: []
|