zsgf_client 2.0.0 → 2.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/README.md +536 -406
- data/docs/AccessTokenApi.md +15 -7
- data/docs/AccessTokenPostRequest.md +0 -2
- data/docs/ExternalAccountApi.md +22 -8
- data/docs/HbFqPayInfo.md +2 -0
- data/docs/UserCurrencyApi.md +20 -8
- data/docs/UserFriendsApi.md +34 -14
- data/docs/UserLocationApi.md +23 -9
- data/lib/zsgf_client/api/access_token_api.rb +12 -3
- data/lib/zsgf_client/api/external_account_api.rb +15 -0
- data/lib/zsgf_client/api/user_currency_api.rb +27 -12
- data/lib/zsgf_client/api/user_friends_api.rb +24 -0
- data/lib/zsgf_client/api/user_location_api.rb +15 -0
- data/lib/zsgf_client/models/access_token_post_request.rb +1 -10
- data/lib/zsgf_client/models/hb_fq_pay_info.rb +11 -1
- data/lib/zsgf_client/version.rb +1 -1
- data/spec/api/access_token_api_spec.rb +4 -1
- data/spec/api/external_account_api_spec.rb +5 -0
- data/spec/api/user_currency_api_spec.rb +7 -2
- data/spec/api/user_friends_api_spec.rb +8 -0
- data/spec/api/user_location_api_spec.rb +5 -0
- data/spec/models/access_token_post_request_spec.rb +0 -6
- data/spec/models/hb_fq_pay_info_spec.rb +6 -0
- metadata +121 -121
data/README.md
CHANGED
|
@@ -1,430 +1,560 @@
|
|
|
1
|
-
#
|
|
1
|
+
# ZSGF Client Ruby SDK
|
|
2
2
|
|
|
3
3
|

|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
掌事高发(ZSGF)Ruby SDK,为开发者提供便捷的API访问接口。
|
|
6
|
+
|
|
7
|
+
## 📦 安装
|
|
8
|
+
|
|
9
|
+
### 使用 gem 安装
|
|
6
10
|
|
|
7
11
|
```shell
|
|
8
12
|
gem install zsgf_client
|
|
9
13
|
```
|
|
10
14
|
|
|
11
|
-
|
|
15
|
+
### 使用 Bundler
|
|
16
|
+
|
|
17
|
+
在您的 `Gemfile` 中添加:
|
|
18
|
+
|
|
19
|
+
```ruby
|
|
20
|
+
gem 'zsgf_client'
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
然后执行:
|
|
24
|
+
|
|
25
|
+
```shell
|
|
26
|
+
bundle install
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## 🚀 快速开始
|
|
30
|
+
|
|
31
|
+
### 基础配置
|
|
12
32
|
|
|
13
33
|
```ruby
|
|
14
|
-
# 加载gem
|
|
15
34
|
require 'zsgf_client'
|
|
16
35
|
|
|
17
|
-
#
|
|
36
|
+
# 配置SDK
|
|
18
37
|
ZSGFClient.configure do |config|
|
|
19
|
-
#
|
|
38
|
+
# 方式1:直接设置访问令牌
|
|
20
39
|
config.access_token = 'YOUR_BEARER_TOKEN'
|
|
21
|
-
|
|
22
|
-
|
|
40
|
+
|
|
41
|
+
# 方式2:动态获取访问令牌(推荐)
|
|
42
|
+
config.access_token_getter = -> {
|
|
43
|
+
# 这里可以实现您的令牌获取逻辑
|
|
44
|
+
# 例如从数据库、缓存或其他服务获取
|
|
45
|
+
get_token_from_database()
|
|
46
|
+
}
|
|
23
47
|
end
|
|
48
|
+
```
|
|
24
49
|
|
|
50
|
+
### 简单示例
|
|
51
|
+
|
|
52
|
+
```ruby
|
|
53
|
+
# 获取应用信息
|
|
25
54
|
api_instance = ZSGFClient::AppApi.new
|
|
26
|
-
app_key = '
|
|
55
|
+
app_key = 'your_app_key'
|
|
56
|
+
|
|
57
|
+
begin
|
|
58
|
+
result = api_instance.app_info(app_key)
|
|
59
|
+
puts "应用名称: #{result.data.name}"
|
|
60
|
+
puts "应用描述: #{result.data.description}"
|
|
61
|
+
rescue ZSGFClient::ApiError => e
|
|
62
|
+
puts "API调用失败: #{e.message}"
|
|
63
|
+
puts "错误代码: #{e.code}"
|
|
64
|
+
end
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## 📚 核心功能模块
|
|
68
|
+
|
|
69
|
+
### 🔐 用户认证与管理
|
|
70
|
+
|
|
71
|
+
#### 用户注册与登录
|
|
72
|
+
|
|
73
|
+
```ruby
|
|
74
|
+
user_api = ZSGFClient::UserApi.new
|
|
75
|
+
|
|
76
|
+
# 邮箱注册
|
|
77
|
+
signup_request = ZSGFClient::EmailSignUpRequest.new(
|
|
78
|
+
email: 'user@example.com',
|
|
79
|
+
password: 'secure_password',
|
|
80
|
+
code: 'verification_code'
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
begin
|
|
84
|
+
result = user_api.user_email_sign_up(app_key, signup_request)
|
|
85
|
+
puts "注册成功,用户ID: #{result.data.user_id}"
|
|
86
|
+
rescue ZSGFClient::ApiError => e
|
|
87
|
+
puts "注册失败: #{e.message}"
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# 邮箱登录
|
|
91
|
+
signin_request = ZSGFClient::EmailSignInRequest.new(
|
|
92
|
+
email: 'user@example.com',
|
|
93
|
+
password: 'secure_password'
|
|
94
|
+
)
|
|
95
|
+
|
|
96
|
+
result = user_api.user_email_sign_in(app_key, signin_request)
|
|
97
|
+
access_token = result.data.access_token
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
#### 用户资料管理
|
|
101
|
+
|
|
102
|
+
```ruby
|
|
103
|
+
# 获取用户资料
|
|
104
|
+
profile = user_api.user_profile(app_key)
|
|
105
|
+
puts "用户昵称: #{profile.data.nickname}"
|
|
106
|
+
|
|
107
|
+
# 更新用户资料
|
|
108
|
+
update_request = ZSGFClient::UpdateProfileRequest.new(
|
|
109
|
+
nickname: '新昵称',
|
|
110
|
+
avatar: 'https://example.com/avatar.jpg'
|
|
111
|
+
)
|
|
112
|
+
|
|
113
|
+
user_api.user_update_profile(app_key, update_request)
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### 💰 虚拟货币系统
|
|
117
|
+
|
|
118
|
+
```ruby
|
|
119
|
+
currency_api = ZSGFClient::UserCurrencyApi.new
|
|
120
|
+
|
|
121
|
+
# 查询用户资产
|
|
122
|
+
currencies = currency_api.user_currencies(app_key, user_id)
|
|
123
|
+
currencies.data.each do |currency|
|
|
124
|
+
puts "货币: #{currency.name}, 余额: #{currency.balance}"
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
# 充值虚拟币
|
|
128
|
+
recharge_request = ZSGFClient::RechargePointRequest.new(
|
|
129
|
+
currency_id: 1,
|
|
130
|
+
amount: 100,
|
|
131
|
+
reason: '充值'
|
|
132
|
+
)
|
|
133
|
+
|
|
134
|
+
currency_api.user_currency_recharge(app_key, recharge_request)
|
|
135
|
+
|
|
136
|
+
# 消费虚拟币
|
|
137
|
+
consume_request = ZSGFClient::CurrencyConsumeRequest.new(
|
|
138
|
+
currency_id: 1,
|
|
139
|
+
amount: 50,
|
|
140
|
+
reason: '购买商品'
|
|
141
|
+
)
|
|
142
|
+
|
|
143
|
+
currency_api.user_currency_consume(app_key, consume_request)
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
### 📂 文件存储
|
|
147
|
+
|
|
148
|
+
```ruby
|
|
149
|
+
file_api = ZSGFClient::FileApi.new
|
|
150
|
+
|
|
151
|
+
# 获取文件列表
|
|
152
|
+
files = file_api.files(app_key, path: '/')
|
|
153
|
+
files.data.each do |file|
|
|
154
|
+
puts "文件名: #{file.name}, 大小: #{file.size}"
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
# 创建文件夹
|
|
158
|
+
file_api.file_create_folder(app_key, {
|
|
159
|
+
path: '/新文件夹',
|
|
160
|
+
name: '我的文件夹'
|
|
161
|
+
})
|
|
162
|
+
|
|
163
|
+
# 上传文件
|
|
164
|
+
File.open('local_file.txt', 'rb') do |file|
|
|
165
|
+
file_api.file_upload(app_key, {
|
|
166
|
+
path: '/',
|
|
167
|
+
file: file
|
|
168
|
+
})
|
|
169
|
+
end
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
### 🗄️ 数据存储
|
|
173
|
+
|
|
174
|
+
```ruby
|
|
175
|
+
storage_api = ZSGFClient::StorageApi.new
|
|
176
|
+
table_name = 'users'
|
|
177
|
+
|
|
178
|
+
# 添加数据
|
|
179
|
+
data = {
|
|
180
|
+
name: '张三',
|
|
181
|
+
age: 25,
|
|
182
|
+
email: 'zhangsan@example.com'
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
result = storage_api.storage_post(app_key, table_name, data)
|
|
186
|
+
record_id = result.data.id
|
|
187
|
+
|
|
188
|
+
# 查询数据
|
|
189
|
+
records = storage_api.storage_list(app_key, table_name, {
|
|
190
|
+
filter: 'age > 20',
|
|
191
|
+
limit: 10
|
|
192
|
+
})
|
|
193
|
+
|
|
194
|
+
# 更新数据
|
|
195
|
+
update_data = { age: 26 }
|
|
196
|
+
storage_api.storage_put(app_key, table_name, record_id, update_data)
|
|
197
|
+
|
|
198
|
+
# 删除数据
|
|
199
|
+
storage_api.storage_delete(app_key, table_name, record_id)
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
### 💳 支付功能
|
|
203
|
+
|
|
204
|
+
```ruby
|
|
205
|
+
# 支付宝支付
|
|
206
|
+
alipay_api = ZSGFClient::AlipayApi.new
|
|
207
|
+
|
|
208
|
+
# 创建当面付订单
|
|
209
|
+
order_request = ZSGFClient::AlipayCreateOrderRequest.new(
|
|
210
|
+
out_trade_no: "ORDER_#{Time.now.to_i}",
|
|
211
|
+
total_amount: '99.00',
|
|
212
|
+
subject: '商品标题',
|
|
213
|
+
body: '商品描述'
|
|
214
|
+
)
|
|
215
|
+
|
|
216
|
+
result = alipay_api.alipay_create_order(app_key, order_request)
|
|
217
|
+
puts "支付二维码: #{result.data.qr_code}"
|
|
218
|
+
|
|
219
|
+
# 查询订单状态
|
|
220
|
+
order_detail = alipay_api.alipay_order_detail(app_key, {
|
|
221
|
+
out_trade_no: order_request.out_trade_no
|
|
222
|
+
})
|
|
223
|
+
puts "订单状态: #{order_detail.data.trade_status}"
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
### 📱 微信功能
|
|
227
|
+
|
|
228
|
+
```ruby
|
|
229
|
+
wechat_api = ZSGFClient::WechatApi.new
|
|
230
|
+
|
|
231
|
+
# 小程序登录
|
|
232
|
+
js_code = 'wx_js_code_from_frontend'
|
|
233
|
+
session_result = wechat_api.wechat_js_code2_session(app_key, {
|
|
234
|
+
js_code: js_code
|
|
235
|
+
})
|
|
236
|
+
|
|
237
|
+
openid = session_result.data.openid
|
|
238
|
+
session_key = session_result.data.session_key
|
|
239
|
+
|
|
240
|
+
# 发送订阅消息
|
|
241
|
+
subscribe_msg = {
|
|
242
|
+
touser: openid,
|
|
243
|
+
template_id: 'template_id',
|
|
244
|
+
data: {
|
|
245
|
+
thing1: { value: '消息内容' },
|
|
246
|
+
time2: { value: Time.now.strftime('%Y-%m-%d %H:%M:%S') }
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
wechat_api.wechat_subscribe_send(app_key, subscribe_msg)
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
## 🔧 高级配置
|
|
27
254
|
|
|
255
|
+
### 错误处理
|
|
256
|
+
|
|
257
|
+
```ruby
|
|
28
258
|
begin
|
|
29
|
-
|
|
30
|
-
result = api_instance.app(app_key)
|
|
31
|
-
p result
|
|
259
|
+
result = api_instance.some_method(params)
|
|
32
260
|
rescue ZSGFClient::ApiError => e
|
|
33
|
-
|
|
261
|
+
case e.code
|
|
262
|
+
when 401
|
|
263
|
+
puts "认证失败,请检查访问令牌"
|
|
264
|
+
when 403
|
|
265
|
+
puts "权限不足"
|
|
266
|
+
when 404
|
|
267
|
+
puts "资源不存在"
|
|
268
|
+
when 429
|
|
269
|
+
puts "请求过于频繁,请稍后再试"
|
|
270
|
+
else
|
|
271
|
+
puts "API错误: #{e.message}"
|
|
272
|
+
end
|
|
273
|
+
rescue StandardError => e
|
|
274
|
+
puts "系统错误: #{e.message}"
|
|
34
275
|
end
|
|
276
|
+
```
|
|
35
277
|
|
|
278
|
+
### 自定义配置
|
|
279
|
+
|
|
280
|
+
```ruby
|
|
281
|
+
ZSGFClient.configure do |config|
|
|
282
|
+
# API基础URL(通常不需要修改)
|
|
283
|
+
config.host = 'api.zashigaofa.cn'
|
|
284
|
+
|
|
285
|
+
# 超时设置
|
|
286
|
+
config.timeout = 30
|
|
287
|
+
|
|
288
|
+
# 调试模式
|
|
289
|
+
config.debugging = true
|
|
290
|
+
|
|
291
|
+
# 自定义用户代理
|
|
292
|
+
config.user_agent = 'MyApp/1.0'
|
|
293
|
+
end
|
|
36
294
|
```
|
|
37
295
|
|
|
38
|
-
## API
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
- [ZSGFClient::FulfillmentDetail](docs/FulfillmentDetail.md)
|
|
304
|
-
- [ZSGFClient::GeoLocationModel](docs/GeoLocationModel.md)
|
|
305
|
-
- [ZSGFClient::GeoLocationModelApiResponse](docs/GeoLocationModelApiResponse.md)
|
|
306
|
-
- [ZSGFClient::GeoLocationResponseModel](docs/GeoLocationResponseModel.md)
|
|
307
|
-
- [ZSGFClient::GoodsDetail](docs/GoodsDetail.md)
|
|
308
|
-
- [ZSGFClient::GrantRequest](docs/GrantRequest.md)
|
|
309
|
-
- [ZSGFClient::GrantResult](docs/GrantResult.md)
|
|
310
|
-
- [ZSGFClient::GrantResultApiResponse](docs/GrantResultApiResponse.md)
|
|
311
|
-
- [ZSGFClient::HbFqPayInfo](docs/HbFqPayInfo.md)
|
|
312
|
-
- [ZSGFClient::Int64ApiResponse](docs/Int64ApiResponse.md)
|
|
313
|
-
- [ZSGFClient::IntactChargeInfo](docs/IntactChargeInfo.md)
|
|
314
|
-
- [ZSGFClient::ListResponseItem](docs/ListResponseItem.md)
|
|
315
|
-
- [ZSGFClient::ListResponseItemListApiResponse](docs/ListResponseItemListApiResponse.md)
|
|
316
|
-
- [ZSGFClient::OAuthAccountBindRequest](docs/OAuthAccountBindRequest.md)
|
|
317
|
-
- [ZSGFClient::OAuthAccountPutBindRequest](docs/OAuthAccountPutBindRequest.md)
|
|
318
|
-
- [ZSGFClient::OAuthAccountSignInRequest](docs/OAuthAccountSignInRequest.md)
|
|
319
|
-
- [ZSGFClient::ObjectApiResponse](docs/ObjectApiResponse.md)
|
|
320
|
-
- [ZSGFClient::ObjectListApiResponse](docs/ObjectListApiResponse.md)
|
|
321
|
-
- [ZSGFClient::Order](docs/Order.md)
|
|
322
|
-
- [ZSGFClient::OrderApiResponse](docs/OrderApiResponse.md)
|
|
323
|
-
- [ZSGFClient::OrderListResult](docs/OrderListResult.md)
|
|
324
|
-
- [ZSGFClient::OrderListResultApiResponse](docs/OrderListResultApiResponse.md)
|
|
325
|
-
- [ZSGFClient::PaymentInfoWithId](docs/PaymentInfoWithId.md)
|
|
326
|
-
- [ZSGFClient::PhoneSignInRequest](docs/PhoneSignInRequest.md)
|
|
327
|
-
- [ZSGFClient::PhoneSignUpRequest](docs/PhoneSignUpRequest.md)
|
|
328
|
-
- [ZSGFClient::PostIndexRequest](docs/PostIndexRequest.md)
|
|
329
|
-
- [ZSGFClient::PostResult](docs/PostResult.md)
|
|
330
|
-
- [ZSGFClient::PostResultApiResponse](docs/PostResultApiResponse.md)
|
|
331
|
-
- [ZSGFClient::PresetPayToolInfo](docs/PresetPayToolInfo.md)
|
|
332
|
-
- [ZSGFClient::ProfileResult](docs/ProfileResult.md)
|
|
333
|
-
- [ZSGFClient::ProfileResultApiResponse](docs/ProfileResultApiResponse.md)
|
|
334
|
-
- [ZSGFClient::Project](docs/Project.md)
|
|
335
|
-
- [ZSGFClient::ProjectApiResponse](docs/ProjectApiResponse.md)
|
|
336
|
-
- [ZSGFClient::ProjectListResult](docs/ProjectListResult.md)
|
|
337
|
-
- [ZSGFClient::ProjectListResultApiResponse](docs/ProjectListResultApiResponse.md)
|
|
338
|
-
- [ZSGFClient::QRCodePreSignInRequest](docs/QRCodePreSignInRequest.md)
|
|
339
|
-
- [ZSGFClient::QRCodeScanRequest](docs/QRCodeScanRequest.md)
|
|
340
|
-
- [ZSGFClient::QRCodeSignInRequest](docs/QRCodeSignInRequest.md)
|
|
341
|
-
- [ZSGFClient::QRCodeSignUpRequest](docs/QRCodeSignUpRequest.md)
|
|
342
|
-
- [ZSGFClient::RechargePointRequest](docs/RechargePointRequest.md)
|
|
343
|
-
- [ZSGFClient::RecommendFriend](docs/RecommendFriend.md)
|
|
344
|
-
- [ZSGFClient::RefundChargeInfo](docs/RefundChargeInfo.md)
|
|
345
|
-
- [ZSGFClient::RefundSubFee](docs/RefundSubFee.md)
|
|
346
|
-
- [ZSGFClient::ReturnPageNotifyRequest](docs/ReturnPageNotifyRequest.md)
|
|
347
|
-
- [ZSGFClient::SendEmailCodeRequest](docs/SendEmailCodeRequest.md)
|
|
348
|
-
- [ZSGFClient::SendSMSCodeRequest](docs/SendSMSCodeRequest.md)
|
|
349
|
-
- [ZSGFClient::ServiceGroup](docs/ServiceGroup.md)
|
|
350
|
-
- [ZSGFClient::ServiceGroupApiResponse](docs/ServiceGroupApiResponse.md)
|
|
351
|
-
- [ZSGFClient::ServiceGroupListApiResponse](docs/ServiceGroupListApiResponse.md)
|
|
352
|
-
- [ZSGFClient::ServiceItem](docs/ServiceItem.md)
|
|
353
|
-
- [ZSGFClient::ServiceItemApiResponse](docs/ServiceItemApiResponse.md)
|
|
354
|
-
- [ZSGFClient::ServiceItemListApiResponse](docs/ServiceItemListApiResponse.md)
|
|
355
|
-
- [ZSGFClient::ServiceProvider](docs/ServiceProvider.md)
|
|
356
|
-
- [ZSGFClient::ServiceProviderApiResponse](docs/ServiceProviderApiResponse.md)
|
|
357
|
-
- [ZSGFClient::ServiceProviderListApiResponse](docs/ServiceProviderListApiResponse.md)
|
|
358
|
-
- [ZSGFClient::ServiceSettingGroupPostResult](docs/ServiceSettingGroupPostResult.md)
|
|
359
|
-
- [ZSGFClient::ServiceSettingGroupPostResultApiResponse](docs/ServiceSettingGroupPostResultApiResponse.md)
|
|
360
|
-
- [ZSGFClient::ServiceSettingItemPostResult](docs/ServiceSettingItemPostResult.md)
|
|
361
|
-
- [ZSGFClient::ServiceSettingItemPostResultApiResponse](docs/ServiceSettingItemPostResultApiResponse.md)
|
|
362
|
-
- [ZSGFClient::ServiceSettingProviderPostResult](docs/ServiceSettingProviderPostResult.md)
|
|
363
|
-
- [ZSGFClient::ServiceSettingProviderPostResultApiResponse](docs/ServiceSettingProviderPostResultApiResponse.md)
|
|
364
|
-
- [ZSGFClient::ServiceSettingSettingPostResult](docs/ServiceSettingSettingPostResult.md)
|
|
365
|
-
- [ZSGFClient::ServiceSettingSettingPostResultApiResponse](docs/ServiceSettingSettingPostResultApiResponse.md)
|
|
366
|
-
- [ZSGFClient::Settings](docs/Settings.md)
|
|
367
|
-
- [ZSGFClient::SettingsApiResponse](docs/SettingsApiResponse.md)
|
|
368
|
-
- [ZSGFClient::SettingsListApiResponse](docs/SettingsListApiResponse.md)
|
|
369
|
-
- [ZSGFClient::SetupCode](docs/SetupCode.md)
|
|
370
|
-
- [ZSGFClient::SetupCodeApiResponse](docs/SetupCodeApiResponse.md)
|
|
371
|
-
- [ZSGFClient::SignInRequest](docs/SignInRequest.md)
|
|
372
|
-
- [ZSGFClient::SignUpRequest](docs/SignUpRequest.md)
|
|
373
|
-
- [ZSGFClient::StorageListResult](docs/StorageListResult.md)
|
|
374
|
-
- [ZSGFClient::StorageListResultApiResponse](docs/StorageListResultApiResponse.md)
|
|
375
|
-
- [ZSGFClient::StringApiResponse](docs/StringApiResponse.md)
|
|
376
|
-
- [ZSGFClient::StringListApiResponse](docs/StringListApiResponse.md)
|
|
377
|
-
- [ZSGFClient::SubFee](docs/SubFee.md)
|
|
378
|
-
- [ZSGFClient::SystemDirectoryItem](docs/SystemDirectoryItem.md)
|
|
379
|
-
- [ZSGFClient::SystemFileItem](docs/SystemFileItem.md)
|
|
380
|
-
- [ZSGFClient::SystemFileListResult](docs/SystemFileListResult.md)
|
|
381
|
-
- [ZSGFClient::SystemFileListResultApiResponse](docs/SystemFileListResultApiResponse.md)
|
|
382
|
-
- [ZSGFClient::TapPayInfo](docs/TapPayInfo.md)
|
|
383
|
-
- [ZSGFClient::Team](docs/Team.md)
|
|
384
|
-
- [ZSGFClient::TokenModel](docs/TokenModel.md)
|
|
385
|
-
- [ZSGFClient::TokenModelApiResponse](docs/TokenModelApiResponse.md)
|
|
386
|
-
- [ZSGFClient::TradeFundBill](docs/TradeFundBill.md)
|
|
387
|
-
- [ZSGFClient::TradeSettleDetail](docs/TradeSettleDetail.md)
|
|
388
|
-
- [ZSGFClient::TradeSettleInfo](docs/TradeSettleInfo.md)
|
|
389
|
-
- [ZSGFClient::UnionIDSignInRequest](docs/UnionIDSignInRequest.md)
|
|
390
|
-
- [ZSGFClient::UnionIDSignUpRequest](docs/UnionIDSignUpRequest.md)
|
|
391
|
-
- [ZSGFClient::UpdateProfileRequest](docs/UpdateProfileRequest.md)
|
|
392
|
-
- [ZSGFClient::User](docs/User.md)
|
|
393
|
-
- [ZSGFClient::UserAccessToken](docs/UserAccessToken.md)
|
|
394
|
-
- [ZSGFClient::UserApiResponse](docs/UserApiResponse.md)
|
|
395
|
-
- [ZSGFClient::UserCommonInterestsResult](docs/UserCommonInterestsResult.md)
|
|
396
|
-
- [ZSGFClient::UserCommonInterestsResultApiResponse](docs/UserCommonInterestsResultApiResponse.md)
|
|
397
|
-
- [ZSGFClient::UserCurrency](docs/UserCurrency.md)
|
|
398
|
-
- [ZSGFClient::UserCurrencyCurrencyTransResult](docs/UserCurrencyCurrencyTransResult.md)
|
|
399
|
-
- [ZSGFClient::UserCurrencyCurrencyTransResultApiResponse](docs/UserCurrencyCurrencyTransResultApiResponse.md)
|
|
400
|
-
- [ZSGFClient::UserCurrencyListApiResponse](docs/UserCurrencyListApiResponse.md)
|
|
401
|
-
- [ZSGFClient::UserFollowersResult](docs/UserFollowersResult.md)
|
|
402
|
-
- [ZSGFClient::UserFollowersResultApiResponse](docs/UserFollowersResultApiResponse.md)
|
|
403
|
-
- [ZSGFClient::UserFollowingResult](docs/UserFollowingResult.md)
|
|
404
|
-
- [ZSGFClient::UserFollowingResultApiResponse](docs/UserFollowingResultApiResponse.md)
|
|
405
|
-
- [ZSGFClient::UserFriendsNearByResult](docs/UserFriendsNearByResult.md)
|
|
406
|
-
- [ZSGFClient::UserFriendsNearByResultApiResponse](docs/UserFriendsNearByResultApiResponse.md)
|
|
407
|
-
- [ZSGFClient::UserListResult](docs/UserListResult.md)
|
|
408
|
-
- [ZSGFClient::UserListResultApiResponse](docs/UserListResultApiResponse.md)
|
|
409
|
-
- [ZSGFClient::UserLocationPostResult](docs/UserLocationPostResult.md)
|
|
410
|
-
- [ZSGFClient::UserLocationPostResultApiResponse](docs/UserLocationPostResultApiResponse.md)
|
|
411
|
-
- [ZSGFClient::UserLocationsResult](docs/UserLocationsResult.md)
|
|
412
|
-
- [ZSGFClient::UserLocationsResultApiResponse](docs/UserLocationsResultApiResponse.md)
|
|
413
|
-
- [ZSGFClient::UserLogins](docs/UserLogins.md)
|
|
414
|
-
- [ZSGFClient::UserLoginsListApiResponse](docs/UserLoginsListApiResponse.md)
|
|
415
|
-
- [ZSGFClient::UserMutualFollowersResult](docs/UserMutualFollowersResult.md)
|
|
416
|
-
- [ZSGFClient::UserMutualFollowersResultApiResponse](docs/UserMutualFollowersResultApiResponse.md)
|
|
417
|
-
- [ZSGFClient::UserMutualFollowingsResult](docs/UserMutualFollowingsResult.md)
|
|
418
|
-
- [ZSGFClient::UserMutualFollowingsResultApiResponse](docs/UserMutualFollowingsResultApiResponse.md)
|
|
419
|
-
- [ZSGFClient::UserProfileResult](docs/UserProfileResult.md)
|
|
420
|
-
- [ZSGFClient::UserProfileResultApiResponse](docs/UserProfileResultApiResponse.md)
|
|
421
|
-
- [ZSGFClient::UserQRCodeScanResult](docs/UserQRCodeScanResult.md)
|
|
422
|
-
- [ZSGFClient::UserQRCodeScanResultApiResponse](docs/UserQRCodeScanResultApiResponse.md)
|
|
423
|
-
- [ZSGFClient::UserSetting](docs/UserSetting.md)
|
|
424
|
-
- [ZSGFClient::UserSettingApiResponse](docs/UserSettingApiResponse.md)
|
|
425
|
-
- [ZSGFClient::UserSettingListApiResponse](docs/UserSettingListApiResponse.md)
|
|
426
|
-
- [ZSGFClient::UserSettingPostResult](docs/UserSettingPostResult.md)
|
|
427
|
-
- [ZSGFClient::UserSettingPostResultApiResponse](docs/UserSettingPostResultApiResponse.md)
|
|
428
|
-
- [ZSGFClient::VoucherDetail](docs/VoucherDetail.md)
|
|
429
|
-
- [ZSGFClient::WechatJSConfigResult](docs/WechatJSConfigResult.md)
|
|
430
|
-
- [ZSGFClient::WechatJSConfigResultApiResponse](docs/WechatJSConfigResultApiResponse.md)
|
|
296
|
+
## 📖 API端点分类
|
|
297
|
+
|
|
298
|
+
### 🏢 应用管理
|
|
299
|
+
- **应用信息**: 获取应用详情和配置
|
|
300
|
+
|
|
301
|
+
### 👥 用户系统
|
|
302
|
+
- **认证注册**: 邮箱注册、手机注册、第三方登录
|
|
303
|
+
- **用户管理**: 资料管理、密码重置、账号注销
|
|
304
|
+
- **社交功能**: 关注/粉丝、好友推荐、位置服务
|
|
305
|
+
|
|
306
|
+
### 💳 支付系统
|
|
307
|
+
- **支付宝**: 当面付、网页支付、手机支付
|
|
308
|
+
- **订单管理**: 订单创建、查询、退款
|
|
309
|
+
|
|
310
|
+
### 📁 数据服务
|
|
311
|
+
- **文件存储**: 文件上传、下载、管理
|
|
312
|
+
- **数据存储**: CRUD操作、聚合查询
|
|
313
|
+
- **虚拟货币**: 充值、消费、交易记录
|
|
314
|
+
|
|
315
|
+
### 🔗 第三方集成
|
|
316
|
+
- **微信服务**: 小程序、公众号、支付
|
|
317
|
+
- **钉钉集成**: 用户信息获取
|
|
318
|
+
- **OAuth**: 授权码、访问令牌
|
|
319
|
+
|
|
320
|
+
### ⚙️ 系统功能
|
|
321
|
+
- **访问令牌**: 令牌管理、权限控制
|
|
322
|
+
|
|
323
|
+
## 📝 完整API列表
|
|
324
|
+
|
|
325
|
+
### 应用管理 (AppApi)
|
|
326
|
+
| 方法 | HTTP请求 | 描述 |
|
|
327
|
+
|------|----------|------|
|
|
328
|
+
| `app_info` | GET /App/{appKey}/Info | 获取应用详情 |
|
|
329
|
+
|
|
330
|
+
### 用户管理 (UserApi)
|
|
331
|
+
| 方法 | HTTP请求 | 描述 |
|
|
332
|
+
|------|----------|------|
|
|
333
|
+
| `user_email_sign_up` | POST /User/{appKey}/EmailSignUp | 邮箱注册 |
|
|
334
|
+
| `user_email_sign_in` | POST /User/{appKey}/EmailSignIn | 邮箱登录 |
|
|
335
|
+
| `user_phone_sign_up` | POST /User/{appKey}/PhoneSignUp | 手机注册 |
|
|
336
|
+
| `user_phone_sign_in` | POST /User/{appKey}/PhoneSignIn | 手机登录 |
|
|
337
|
+
| `user_sign_up` | POST /User/{appKey}/SignUp | 通用注册 |
|
|
338
|
+
| `user_sign_in` | POST /User/{appKey}/SignIn | 密码登录 |
|
|
339
|
+
| `user_profile` | GET /User/{appKey}/Profile | 获取个人资料 |
|
|
340
|
+
| `user_update_profile` | PUT /User/{appKey}/Profile | 更新个人资料 |
|
|
341
|
+
| `user_reset_pwd` | POST /User/{appKey}/ResetPwd | 重置密码 |
|
|
342
|
+
| `user_reset_email` | PUT /User/{appKey}/ResetEmail | 重置邮箱 |
|
|
343
|
+
| `user_reset_phone` | PUT /User/{appKey}/ResetPhone | 重置手机号 |
|
|
344
|
+
| `user_send_email_code` | POST /User/{appKey}/SendEmailCode | 发送邮箱验证码 |
|
|
345
|
+
| `user_send_sms_code` | POST /User/{appKey}/SendSMSCode | 发送手机验证码 |
|
|
346
|
+
| `user_union_id_sign_up` | POST /User/{appKey}/UnionIDSignUp | UnionID注册 |
|
|
347
|
+
| `user_union_id_sign_in` | POST /User/{appKey}/UnionIDSignIn | UnionID登录 |
|
|
348
|
+
| `user_two_factor_auth` | GET /User/{appKey}/TwoFactorAuth | 二次验证 |
|
|
349
|
+
| `user_deactivate_hard` | DELETE /User/{appKey}/DeactivateHard | 注销账号 |
|
|
350
|
+
|
|
351
|
+
### 虚拟货币 (UserCurrencyApi)
|
|
352
|
+
| 方法 | HTTP请求 | 描述 |
|
|
353
|
+
|------|----------|------|
|
|
354
|
+
| `user_currencies` | GET /UserCurrency/{appKey}/{id} | 获取用户资产 |
|
|
355
|
+
| `user_currency_recharge` | POST /UserCurrency/{appKey}/CurrencyRecharge | 充值虚拟币 |
|
|
356
|
+
| `user_currency_consume` | POST /UserCurrency/{appKey}/CurrencyConsume | 消费虚拟币 |
|
|
357
|
+
| `user_currency_exchange` | POST /UserCurrency/{appKey}/CurrencyExchange | 兑换虚拟币 |
|
|
358
|
+
| `user_currency_transactions` | GET /UserCurrency/{appKey}/CurrencyTransactions | 交易记录 |
|
|
359
|
+
|
|
360
|
+
### 社交功能 (UserFriendsApi)
|
|
361
|
+
| 方法 | HTTP请求 | 描述 |
|
|
362
|
+
|------|----------|------|
|
|
363
|
+
| `user_follow_user` | POST /UserFriends/{appKey}/Follower/{userId} | 添加关注 |
|
|
364
|
+
| `user_unfollow_user` | DELETE /UserFriends/{appKey}/Follower/{userId} | 取消关注 |
|
|
365
|
+
| `user_followers` | GET /UserFriends/{appKey}/Followers | 获取粉丝列表 |
|
|
366
|
+
| `user_following` | GET /UserFriends/{appKey}/Following | 获取关注列表 |
|
|
367
|
+
| `user_mutual_followers` | GET /UserFriends/{appKey}/MutualFollowers | 共同粉丝 |
|
|
368
|
+
| `user_mutual_followings` | GET /UserFriends/{appKey}/MutualFollowings | 共同关注 |
|
|
369
|
+
| `user_common_interests` | GET /UserFriends/{appKey}/CommonInterests | 相似兴趣用户 |
|
|
370
|
+
| `user_friends_near_by` | GET /UserFriends/{appKey}/NearBy | 附近用户 |
|
|
371
|
+
| `user_profile_by_id` | GET /UserFriends/{appKey}/Profile/{userId} | 获取用户资料 |
|
|
372
|
+
| `user_follower_put` | PUT /UserFriends/{appKey}/Follower/{id} | 刷新粉丝数据 |
|
|
373
|
+
|
|
374
|
+
### 位置服务 (UserLocationApi)
|
|
375
|
+
| 方法 | HTTP请求 | 描述 |
|
|
376
|
+
|------|----------|------|
|
|
377
|
+
| `user_locations` | GET /UserLocation/{appKey} | 获取位置列表 |
|
|
378
|
+
| `user_location` | GET /UserLocation/{appKey}/{id} | 获取位置详情 |
|
|
379
|
+
| `user_location_post` | POST /UserLocation/{appKey} | 添加位置 |
|
|
380
|
+
| `user_location_put` | PUT /UserLocation/{appKey}/{id} | 更新位置 |
|
|
381
|
+
| `user_location_delete` | DELETE /UserLocation/{appKey}/{id} | 删除位置 |
|
|
382
|
+
|
|
383
|
+
### 文件存储 (FileApi)
|
|
384
|
+
| 方法 | HTTP请求 | 描述 |
|
|
385
|
+
|------|----------|------|
|
|
386
|
+
| `files` | GET /File/{appKey} | 获取文件列表 |
|
|
387
|
+
| `file_upload` | POST /File/{appKey}/Upload | 上传文件 |
|
|
388
|
+
| `file_create_folder` | POST /File/{appKey}/CreateFolder | 创建文件夹 |
|
|
389
|
+
| `file_rename` | POST /File/{appKey}/Rename | 重命名文件/文件夹 |
|
|
390
|
+
| `file_delete` | DELETE /File/{appKey} | 删除文件/文件夹 |
|
|
391
|
+
|
|
392
|
+
### 数据存储 (StorageApi)
|
|
393
|
+
| 方法 | HTTP请求 | 描述 |
|
|
394
|
+
|------|----------|------|
|
|
395
|
+
| `storage_list` | GET /Storage/{appKey}/{table} | 查询数据 |
|
|
396
|
+
| `storage_detail` | GET /Storage/{appKey}/{table}/{id} | 数据详情 |
|
|
397
|
+
| `storage_post` | POST /Storage/{appKey}/{table} | 添加数据 |
|
|
398
|
+
| `storage_put` | PUT /Storage/{appKey}/{table}/{id} | 更新数据 |
|
|
399
|
+
| `storage_delete` | DELETE /Storage/{appKey}/{table}/{id} | 删除数据 |
|
|
400
|
+
| `storage_aggregate` | GET /Storage/{appKey}/{table}/Aggregate | 聚合查询 |
|
|
401
|
+
|
|
402
|
+
### 支付宝支付 (AlipayApi)
|
|
403
|
+
| 方法 | HTTP请求 | 描述 |
|
|
404
|
+
|------|----------|------|
|
|
405
|
+
| `alipay_create_order` | POST /Alipay/{appKey}/CreateOrder | 创建当面付订单 |
|
|
406
|
+
| `alipay_create_order_page_pay` | POST /Alipay/{appKey}/CreateOrderPagePay | 创建PC支付订单 |
|
|
407
|
+
| `alipay_create_order_wap_pay` | POST /Alipay/{appKey}/CreateOrderWapPay | 创建WAP支付订单 |
|
|
408
|
+
| `alipay_order_detail` | GET /Alipay/{appKey}/OrderDetail | 获取订单详情 |
|
|
409
|
+
| `alipay_order_refund` | POST /Alipay/{appKey}/OrderRefund | 发起订单退款 |
|
|
410
|
+
| `alipay_return_page_notify` | POST /Alipay/{appKey}/ReturnPageNotify | 支付回调通知 |
|
|
411
|
+
|
|
412
|
+
### 订单管理 (OrderApi)
|
|
413
|
+
| 方法 | HTTP请求 | 描述 |
|
|
414
|
+
|------|----------|------|
|
|
415
|
+
| `orders` | GET /Order/{appKey} | 获取订单列表 |
|
|
416
|
+
| `order` | GET /Order/{appKey}/{id} | 获取订单详情 |
|
|
417
|
+
| `order_create` | POST /Order/{appKey}/Create | 创建订单 |
|
|
418
|
+
|
|
419
|
+
### 微信服务 (WechatApi)
|
|
420
|
+
| 方法 | HTTP请求 | 描述 |
|
|
421
|
+
|------|----------|------|
|
|
422
|
+
| `wechat_js_code2_session` | GET /Wechat/{appKey}/JSCode2Session | 小程序登录 |
|
|
423
|
+
| `wechat_decrypt` | GET /Wechat/{appKey}/Decrypt | 解密用户数据 |
|
|
424
|
+
| `wechat_subscribe_send` | POST /Wechat/{appKey}/SubscribeSend | 发送订阅消息 |
|
|
425
|
+
| `wechat_subscribe_msg` | POST /Wechat/{appKey}/SubscribeMSG | 发送一次性订阅消息 |
|
|
426
|
+
| `wechat_user_info` | GET /Wechat/{appKey}/UserInfo | 获取公众号用户信息 |
|
|
427
|
+
| `wechat_js_config` | GET /Wechat/{appKey}/JSConfig | 配置JS SDK |
|
|
428
|
+
| `wechat_wxa_code_get` | POST /Wechat/{appKey}/WXACodeGet | 获取小程序码 |
|
|
429
|
+
| `wechat_wxa_code_get_unlimited` | POST /Wechat/{appKey}/WXACodeGetUnlimited | 获取小程序码(无限制) |
|
|
430
|
+
| `wechat_generate_scheme` | POST /Wechat/{appKey}/GenerateScheme | 生成Scheme码 |
|
|
431
|
+
| `wechat_url_link_generate` | POST /Wechat/{appKey}/UrlLinkGenerate | 生成URL跳转链接 |
|
|
432
|
+
| `wechat_msg_sec_check` | POST /Wechat/{appKey}/MsgSecCheck | 内容安全检测 |
|
|
433
|
+
| `initiate_qr_auth_session` | POST /Wechat/{appKey}/QR-Auth/Initiate | 初始化二维码认证 |
|
|
434
|
+
| `scan_qr_code_for_auth` | POST /Wechat/{appKey}/QR-Auth/Scan | 验证二维码扫描 |
|
|
435
|
+
| `confirm_qr_code_login` | POST /Wechat/{appKey}/QR-Auth/Confirm-Login | 确认二维码登录 |
|
|
436
|
+
| `confirm_qr_code_registration` | POST /Wechat/{appKey}/QR-Auth/Confirm-Register | 确认二维码注册 |
|
|
437
|
+
|
|
438
|
+
### OAuth授权 (OAuthApi)
|
|
439
|
+
| 方法 | HTTP请求 | 描述 |
|
|
440
|
+
|------|----------|------|
|
|
441
|
+
| `o_auth_grant_code` | POST /OAuth/{appKey}/GrantCode | 获取授权码 |
|
|
442
|
+
| `o_auth_authorize` | POST /OAuth/{appKey}/Authorize | 获取访问令牌 |
|
|
443
|
+
| `o_auth_profile` | GET /OAuth/{appKey}/Profile | 获取用户资料 |
|
|
444
|
+
| `o_auth_consents` | GET /OAuth/{appKey}/Consents | 获取授权记录 |
|
|
445
|
+
| `o_auth_delete_consent` | DELETE /OAuth/{appKey}/Consents/{id} | 删除授权记录 |
|
|
446
|
+
|
|
447
|
+
### 外部账号 (ExternalAccountApi)
|
|
448
|
+
| 方法 | HTTP请求 | 描述 |
|
|
449
|
+
|------|----------|------|
|
|
450
|
+
| `external_account_sign_in` | POST /ExternalAccount/{appKey}/SignIn | 外部账号登录 |
|
|
451
|
+
| `user_external_account_bind` | POST /ExternalAccount/{appKey} | 绑定外部账号 |
|
|
452
|
+
| `user_o_auth_accounts` | GET /ExternalAccount/{appKey} | 外部账号列表 |
|
|
453
|
+
| `user_o_auth_accounts_put_bind` | PUT /ExternalAccount/{appKey}/{id} | 更新绑定账号 |
|
|
454
|
+
| `user_o_auth_accounts_un_bind` | DELETE /ExternalAccount/{appKey}/{id} | 删除绑定账号 |
|
|
455
|
+
|
|
456
|
+
### 访问令牌 (AccessTokenApi)
|
|
457
|
+
| 方法 | HTTP请求 | 描述 |
|
|
458
|
+
|------|----------|------|
|
|
459
|
+
| `access_tokens` | GET /AccessToken/{appKey} | 令牌列表 |
|
|
460
|
+
| `access_token_post` | POST /AccessToken/{appKey} | 创建令牌 |
|
|
461
|
+
| `access_token_put` | PUT /AccessToken/{appKey}/{id} | 更新令牌 |
|
|
462
|
+
| `access_token_delete` | DELETE /AccessToken/{appKey}/{id} | 删除令牌 |
|
|
463
|
+
|
|
464
|
+
### 钉钉集成 (DingTalkApi)
|
|
465
|
+
| 方法 | HTTP请求 | 描述 |
|
|
466
|
+
|------|----------|------|
|
|
467
|
+
| `ding_talk_user_info` | GET /DingTalk/{appKey}/UserInfo | 获取钉钉用户资料 |
|
|
468
|
+
|
|
469
|
+
## 🛠️ 开发指南
|
|
470
|
+
|
|
471
|
+
### 最佳实践
|
|
472
|
+
|
|
473
|
+
1. **令牌管理**: 建议使用动态令牌获取方式,确保令牌安全性
|
|
474
|
+
2. **错误处理**: 始终包装API调用在异常处理块中
|
|
475
|
+
3. **分页查询**: 对于列表类接口,合理使用分页参数
|
|
476
|
+
4. **缓存策略**: 对于不经常变化的数据,考虑实现缓存机制
|
|
477
|
+
|
|
478
|
+
### 测试环境
|
|
479
|
+
|
|
480
|
+
```ruby
|
|
481
|
+
# 测试环境配置
|
|
482
|
+
ZSGFClient.configure do |config|
|
|
483
|
+
config.host = 'test-api.zashigaofa.cn' # 测试环境地址
|
|
484
|
+
config.access_token = 'test_token'
|
|
485
|
+
config.debugging = true
|
|
486
|
+
end
|
|
487
|
+
```
|
|
488
|
+
|
|
489
|
+
### 常见问题
|
|
490
|
+
|
|
491
|
+
#### Q: 如何处理令牌过期?
|
|
492
|
+
|
|
493
|
+
```ruby
|
|
494
|
+
ZSGFClient.configure do |config|
|
|
495
|
+
config.access_token_getter = -> {
|
|
496
|
+
# 实现自动刷新令牌的逻辑
|
|
497
|
+
token = get_cached_token()
|
|
498
|
+
if token_expired?(token)
|
|
499
|
+
token = refresh_token()
|
|
500
|
+
cache_token(token)
|
|
501
|
+
end
|
|
502
|
+
token
|
|
503
|
+
}
|
|
504
|
+
end
|
|
505
|
+
```
|
|
506
|
+
|
|
507
|
+
#### Q: 如何实现请求重试?
|
|
508
|
+
|
|
509
|
+
```ruby
|
|
510
|
+
def api_call_with_retry(api_method, *args, max_retries: 3)
|
|
511
|
+
retries = 0
|
|
512
|
+
begin
|
|
513
|
+
api_method.call(*args)
|
|
514
|
+
rescue ZSGFClient::ApiError => e
|
|
515
|
+
retries += 1
|
|
516
|
+
if retries <= max_retries && [429, 500, 502, 503].include?(e.code)
|
|
517
|
+
sleep(2 ** retries) # 指数退避
|
|
518
|
+
retry
|
|
519
|
+
else
|
|
520
|
+
raise e
|
|
521
|
+
end
|
|
522
|
+
end
|
|
523
|
+
end
|
|
524
|
+
```
|
|
525
|
+
|
|
526
|
+
## 📚 数据模型
|
|
527
|
+
|
|
528
|
+
### 核心模型
|
|
529
|
+
|
|
530
|
+
- **User**: 用户信息模型
|
|
531
|
+
- **Order**: 订单信息模型
|
|
532
|
+
- **FileItem**: 文件信息模型
|
|
533
|
+
- **UserCurrency**: 用户虚拟货币模型
|
|
534
|
+
- **GeoLocation**: 地理位置模型
|
|
535
|
+
|
|
536
|
+
### 请求模型
|
|
537
|
+
|
|
538
|
+
- **EmailSignUpRequest**: 邮箱注册请求
|
|
539
|
+
- **CreateOrderRequest**: 创建订单请求
|
|
540
|
+
- **UpdateProfileRequest**: 更新资料请求
|
|
541
|
+
|
|
542
|
+
### 响应模型
|
|
543
|
+
|
|
544
|
+
- **ApiResponse**: 标准API响应格式
|
|
545
|
+
- **ProfileResult**: 用户资料响应
|
|
546
|
+
- **OrderListResult**: 订单列表响应
|
|
547
|
+
|
|
548
|
+
详细的模型文档请参考 [docs/](docs/) 目录。
|
|
549
|
+
|
|
550
|
+
## 📞 技术支持
|
|
551
|
+
|
|
552
|
+
- **官方文档**: [https://doc.zashigaofa.com](https://api.zashigaofa.cn)
|
|
553
|
+
|
|
554
|
+
## 📄 许可证
|
|
555
|
+
|
|
556
|
+
请参考相关许可证条款。
|
|
557
|
+
|
|
558
|
+
---
|
|
559
|
+
|
|
560
|
+
*此文档持续更新中,如有疑问请联系技术支持。*
|