tim_sdk 0.1.1 → 0.1.2
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/Gemfile.lock +1 -1
- data/lib/tim_sdk/api.rb +29 -2
- data/lib/tim_sdk/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6356b1ff18102c5a565f654ed7863610ecfabdc20925d8993fdd91351baa41e9
|
4
|
+
data.tar.gz: 81c20853863aec9ce1c03b655f46bce25685959c38a51ec4dc78369d498b3e70
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 428bee9465e375510a223cc1efafd407f787424c305fc33d2ac9037ad236d926e442d4cc7317d57d175062b0740b6e5f3ababa278bda32b9bef4d798ce98694c
|
7
|
+
data.tar.gz: 30d4dec6bfb9ae31b5efc7d7770809592a45fa39f22092d56ca7138c94b87028aa80317fd4442bb8562c9a6be143db32089738026e7a012800496a4788994783
|
data/Gemfile.lock
CHANGED
data/lib/tim_sdk/api.rb
CHANGED
@@ -92,6 +92,35 @@ module TimSdk
|
|
92
92
|
JSON.parse(response.body, symbolize_names: true) if response.success?
|
93
93
|
end
|
94
94
|
|
95
|
+
# 设置资料
|
96
|
+
def self.invoke_portrait_set(account, items)
|
97
|
+
response = connection.post('/v4/profile/portrait_set') do |request|
|
98
|
+
request.body = {
|
99
|
+
:From_Account => account.to_s,
|
100
|
+
:ProfileItem => items.map do |item|
|
101
|
+
{
|
102
|
+
:Tag => item[:tag],
|
103
|
+
:Value => item[:value],
|
104
|
+
}
|
105
|
+
end
|
106
|
+
}.to_json
|
107
|
+
end
|
108
|
+
raise TimServerError, "Response Status: #{response.status}" unless response.success?
|
109
|
+
JSON.parse(response.body, symbolize_names: true) if response.success?
|
110
|
+
end
|
111
|
+
|
112
|
+
# 拉取资料
|
113
|
+
def self.invoke_portrait_get(accounts, tags)
|
114
|
+
response = connection.post('/v4/profile/portrait_get') do |request|
|
115
|
+
request.body = {
|
116
|
+
:To_Account => accounts.map(&:to_s),
|
117
|
+
:TagList => tags.map(&:to_s),
|
118
|
+
}.to_json
|
119
|
+
end
|
120
|
+
raise TimServerError, "Response Status: #{response.status}" unless response.success?
|
121
|
+
JSON.parse(response.body, symbolize_names: true) if response.success?
|
122
|
+
end
|
123
|
+
|
95
124
|
# 拉取运营数据
|
96
125
|
def self.invoke_fetch_app_info(fields = [])
|
97
126
|
response = connection.post('/v4/openconfigsvr/getappinfo') do |request|
|
@@ -103,7 +132,6 @@ module TimSdk
|
|
103
132
|
JSON.parse(response.body, symbolize_names: true) if response.success?
|
104
133
|
end
|
105
134
|
|
106
|
-
|
107
135
|
# 下载消息记录
|
108
136
|
def self.invoke_fetch_history(chat_type, msg_time)
|
109
137
|
response = connection.post('/v4/open_msg_svc/get_history') do |request|
|
@@ -116,7 +144,6 @@ module TimSdk
|
|
116
144
|
JSON.parse(response.body, symbolize_names: true) if response.success?
|
117
145
|
end
|
118
146
|
|
119
|
-
|
120
147
|
# 获取服务器 IP 地址
|
121
148
|
def self.invoke_fetch_ip_list
|
122
149
|
response = connection.post('/v4/ConfigSvc/GetIPList') do |request|
|
data/lib/tim_sdk/version.rb
CHANGED