jpsclient 0.2.0
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 +7 -0
- data/LICENSE +21 -0
- data/bin/jpsclient +28 -0
- data/lib/jpsclient/api/app_level.rb +138 -0
- data/lib/jpsclient/api/app_resource.rb +164 -0
- data/lib/jpsclient/api/app_resource_version.rb +52 -0
- data/lib/jpsclient/api/apple_account.rb +140 -0
- data/lib/jpsclient/api/application.rb +268 -0
- data/lib/jpsclient/api/application_category.rb +120 -0
- data/lib/jpsclient/api/application_design.rb +118 -0
- data/lib/jpsclient/api/application_income.rb +54 -0
- data/lib/jpsclient/api/application_sales.rb +52 -0
- data/lib/jpsclient/api/application_version.rb +77 -0
- data/lib/jpsclient/api/assets_category.rb +120 -0
- data/lib/jpsclient/api/bug.rb +140 -0
- data/lib/jpsclient/api/cert.rb +27 -0
- data/lib/jpsclient/api/client.rb +268 -0
- data/lib/jpsclient/api/collect.rb +52 -0
- data/lib/jpsclient/api/collection.rb +162 -0
- data/lib/jpsclient/api/commit_log.rb +104 -0
- data/lib/jpsclient/api/creative.rb +52 -0
- data/lib/jpsclient/api/custom_application.rb +230 -0
- data/lib/jpsclient/api/custom_application_web.rb +52 -0
- data/lib/jpsclient/api/document_text.rb +30 -0
- data/lib/jpsclient/api/experience.rb +143 -0
- data/lib/jpsclient/api/experience_category.rb +97 -0
- data/lib/jpsclient/api/fgui_export.rb +52 -0
- data/lib/jpsclient/api/file.rb +84 -0
- data/lib/jpsclient/api/game_assets.rb +140 -0
- data/lib/jpsclient/api/healthy.rb +30 -0
- data/lib/jpsclient/api/icon_and_snapshot.rb +54 -0
- data/lib/jpsclient/api/idea.rb +121 -0
- data/lib/jpsclient/api/jssdk.rb +30 -0
- data/lib/jpsclient/api/lark_bitable.rb +30 -0
- data/lib/jpsclient/api/lark_chat_group.rb +30 -0
- data/lib/jpsclient/api/lark_comment.rb +118 -0
- data/lib/jpsclient/api/lark_task.rb +140 -0
- data/lib/jpsclient/api/lark_task_list.rb +118 -0
- data/lib/jpsclient/api/lark_task_section.rb +74 -0
- data/lib/jpsclient/api/lark_user.rb +30 -0
- data/lib/jpsclient/api/lark_wiki_node.rb +30 -0
- data/lib/jpsclient/api/lark_wiki_space.rb +30 -0
- data/lib/jpsclient/api/lazy_client.rb +290 -0
- data/lib/jpsclient/api/login.rb +96 -0
- data/lib/jpsclient/api/m3u8.rb +30 -0
- data/lib/jpsclient/api/menu.rb +143 -0
- data/lib/jpsclient/api/modular_client.rb +228 -0
- data/lib/jpsclient/api/project.rb +46 -0
- data/lib/jpsclient/api/project_package.rb +249 -0
- data/lib/jpsclient/api/publisher.rb +165 -0
- data/lib/jpsclient/api/publisher_category.rb +142 -0
- data/lib/jpsclient/api/publisher_group.rb +118 -0
- data/lib/jpsclient/api/publisher_group_category.rb +120 -0
- data/lib/jpsclient/api/requirements.rb +143 -0
- data/lib/jpsclient/api/requirements_category.rb +97 -0
- data/lib/jpsclient/api/resource_category.rb +120 -0
- data/lib/jpsclient/api/role.rb +165 -0
- data/lib/jpsclient/api/simple_search.rb +162 -0
- data/lib/jpsclient/api/sketch.rb +74 -0
- data/lib/jpsclient/api/sketch_category.rb +97 -0
- data/lib/jpsclient/api/sov.rb +30 -0
- data/lib/jpsclient/api/statistics.rb +30 -0
- data/lib/jpsclient/api/store.rb +30 -0
- data/lib/jpsclient/api/survey.rb +143 -0
- data/lib/jpsclient/api/survey_category.rb +97 -0
- data/lib/jpsclient/api/tag.rb +142 -0
- data/lib/jpsclient/api/tool.rb +121 -0
- data/lib/jpsclient/api/tool_category.rb +120 -0
- data/lib/jpsclient/api/trending.rb +30 -0
- data/lib/jpsclient/api/ud_id.rb +118 -0
- data/lib/jpsclient/api/user.rb +99 -0
- data/lib/jpsclient/api/util.rb +30 -0
- data/lib/jpsclient/api/video_cover.rb +30 -0
- data/lib/jpsclient/api/webhook.rb +118 -0
- data/lib/jpsclient/api/workflow.rb +118 -0
- data/lib/jpsclient/auth/auth.rb +676 -0
- data/lib/jpsclient/auth/token.rb +209 -0
- data/lib/jpsclient/base/api_config.rb +225 -0
- data/lib/jpsclient/base/exception.rb +5 -0
- data/lib/jpsclient/http/http_client.rb +148 -0
- data/lib/jpsclient/upload/upload_client.rb +334 -0
- data/lib/jpsclient/upload/upload_config.rb +128 -0
- data/lib/jpsclient/upload/upload_progress.rb +73 -0
- data/lib/jpsclient/utils/aes.rb +49 -0
- data/lib/jpsclient/utils/logger.rb +38 -0
- data/lib/jpsclient/version.rb +3 -0
- data/lib/jpsclient.rb +34 -0
- metadata +269 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: cfb3b57bef0059ee817639ba13b5ecea0f00529ff4ff5027bd879409856c4bb3
|
4
|
+
data.tar.gz: d3ea235254b1758c89f46b06a7ed3f6f63e39559fe1ecf7d91efa5729d18a17a
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 5db062c5adb6db3285cb442b05a289d49f2bea1d7da539d99d27286eb2e69a17567e8ff39299420374b6ccd58e0aba7fba0dbf799d29415ecb2cfbcae9b1a9f1
|
7
|
+
data.tar.gz: 80c4aba3a98162885c947e4ef2219b82ea4e4acd5680bc6403a9e1d672243d72e2cfdf56582f8143bad3e26a52f563700f1d027920b60730191842fcc1ee9c19
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2024 [Your Name]
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/bin/jpsclient
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'jpsclient'
|
4
|
+
require 'optparse'
|
5
|
+
|
6
|
+
OptionParser.new do |opts|
|
7
|
+
opts.banner = "JPSClient - JPS Platform API Client Library"
|
8
|
+
opts.separator ""
|
9
|
+
opts.separator "Usage: jpsclient [options]"
|
10
|
+
opts.separator ""
|
11
|
+
opts.separator "Options:"
|
12
|
+
|
13
|
+
opts.on("-v", "--version", "Show version") do
|
14
|
+
puts "JPSClient #{JPSClient::VERSION}"
|
15
|
+
exit
|
16
|
+
end
|
17
|
+
|
18
|
+
opts.on("-h", "--help", "Show this help message") do
|
19
|
+
puts opts
|
20
|
+
puts ""
|
21
|
+
puts "For more information, see: https://github.com/yourusername/jpsclient"
|
22
|
+
exit
|
23
|
+
end
|
24
|
+
end.parse!
|
25
|
+
|
26
|
+
# 如果没有参数,显示帮助信息
|
27
|
+
puts "JPSClient #{JPSClient::VERSION}"
|
28
|
+
puts "Use 'jpsclient -h' for help."
|
@@ -0,0 +1,138 @@
|
|
1
|
+
module JPSClient
|
2
|
+
module API
|
3
|
+
# 应用关卡管理相关 API
|
4
|
+
# 处理 /api/level/* 路径的所有接口
|
5
|
+
module AppLevel
|
6
|
+
|
7
|
+
# 更新关卡信息
|
8
|
+
#
|
9
|
+
# @param resourceId [String] 资源ID(必需)
|
10
|
+
# @param params [Hash] 更新参数
|
11
|
+
# @return [Hash] API响应
|
12
|
+
def update_app_level(resourceId:, params: {})
|
13
|
+
config = @request_config && @request_config["app_level_update"]
|
14
|
+
raise JPSClient::ExceptionError, "Missing config for app_level_update" unless config && config["url"]
|
15
|
+
|
16
|
+
path = config["url"].gsub("{resourceId}", resourceId.to_s)
|
17
|
+
|
18
|
+
response = @http_client.put(path, body: params)
|
19
|
+
result = JPSClient::Response.new(response)
|
20
|
+
|
21
|
+
if result.need_login?
|
22
|
+
do_login(force_login: true)
|
23
|
+
response = @http_client.put(path, body: params)
|
24
|
+
result = JPSClient::Response.new(response)
|
25
|
+
end
|
26
|
+
|
27
|
+
return result.to_h
|
28
|
+
end
|
29
|
+
|
30
|
+
# 删除关卡
|
31
|
+
#
|
32
|
+
# @param resourceId [String] 资源ID(必需)
|
33
|
+
# @return [Hash] API响应
|
34
|
+
def delete_app_level(resourceId:)
|
35
|
+
config = @request_config && @request_config["app_level_delete"]
|
36
|
+
raise JPSClient::ExceptionError, "Missing config for app_level_delete" unless config && config["url"]
|
37
|
+
|
38
|
+
path = config["url"].gsub("{resourceId}", resourceId.to_s)
|
39
|
+
|
40
|
+
response = @http_client.delete(path)
|
41
|
+
result = JPSClient::Response.new(response)
|
42
|
+
|
43
|
+
if result.need_login?
|
44
|
+
do_login(force_login: true)
|
45
|
+
response = @http_client.delete(path)
|
46
|
+
result = JPSClient::Response.new(response)
|
47
|
+
end
|
48
|
+
|
49
|
+
return result.to_h
|
50
|
+
end
|
51
|
+
|
52
|
+
# 获取关卡列表
|
53
|
+
#
|
54
|
+
# @param params [Hash] 查询参数
|
55
|
+
# @return [Hash] API响应
|
56
|
+
def get_app_levels(params: {})
|
57
|
+
config = @request_config && @request_config["app_levels_list"]
|
58
|
+
raise JPSClient::ExceptionError, "Missing config for app_levels_list" unless config && config["url"]
|
59
|
+
path = config["url"]
|
60
|
+
|
61
|
+
response = @http_client.post(path, body: params)
|
62
|
+
result = JPSClient::Response.new(response)
|
63
|
+
|
64
|
+
if result.need_login?
|
65
|
+
do_login(force_login: true)
|
66
|
+
response = @http_client.post(path, body: params)
|
67
|
+
result = JPSClient::Response.new(response)
|
68
|
+
end
|
69
|
+
|
70
|
+
return result.to_h
|
71
|
+
end
|
72
|
+
|
73
|
+
# 创建关卡
|
74
|
+
#
|
75
|
+
# @param params [Hash] 关卡信息参数
|
76
|
+
# @return [Hash] API响应
|
77
|
+
def create_app_level(params: {})
|
78
|
+
config = @request_config && @request_config["app_level_create"]
|
79
|
+
raise JPSClient::ExceptionError, "Missing config for app_level_create" unless config && config["url"]
|
80
|
+
path = config["url"]
|
81
|
+
|
82
|
+
response = @http_client.post(path, body: params)
|
83
|
+
result = JPSClient::Response.new(response)
|
84
|
+
|
85
|
+
if result.need_login?
|
86
|
+
do_login(force_login: true)
|
87
|
+
response = @http_client.post(path, body: params)
|
88
|
+
result = JPSClient::Response.new(response)
|
89
|
+
end
|
90
|
+
|
91
|
+
return result.to_h
|
92
|
+
end
|
93
|
+
|
94
|
+
# 上传关卡压缩包
|
95
|
+
#
|
96
|
+
# @param params [Hash] 上传参数
|
97
|
+
# @return [Hash] API响应
|
98
|
+
def upload_app_level_zip(params: {})
|
99
|
+
config = @request_config && @request_config["app_level_zip_upload"]
|
100
|
+
raise JPSClient::ExceptionError, "Missing config for app_level_zip_upload" unless config && config["url"]
|
101
|
+
path = config["url"]
|
102
|
+
|
103
|
+
response = @http_client.post(path, body: params)
|
104
|
+
result = JPSClient::Response.new(response)
|
105
|
+
|
106
|
+
if result.need_login?
|
107
|
+
do_login(force_login: true)
|
108
|
+
response = @http_client.post(path, body: params)
|
109
|
+
result = JPSClient::Response.new(response)
|
110
|
+
end
|
111
|
+
|
112
|
+
return result.to_h
|
113
|
+
end
|
114
|
+
|
115
|
+
# 获取所有分类的关卡
|
116
|
+
#
|
117
|
+
# @param params [Hash] 查询参数
|
118
|
+
# @return [Hash] API响应
|
119
|
+
def get_all_category_levels(params: {})
|
120
|
+
config = @request_config && @request_config["category_all_levels"]
|
121
|
+
raise JPSClient::ExceptionError, "Missing config for category_all_levels" unless config && config["url"]
|
122
|
+
path = config["url"]
|
123
|
+
|
124
|
+
response = @http_client.post(path, body: params)
|
125
|
+
result = JPSClient::Response.new(response)
|
126
|
+
|
127
|
+
if result.need_login?
|
128
|
+
do_login(force_login: true)
|
129
|
+
response = @http_client.post(path, body: params)
|
130
|
+
result = JPSClient::Response.new(response)
|
131
|
+
end
|
132
|
+
|
133
|
+
return result.to_h
|
134
|
+
end
|
135
|
+
|
136
|
+
end
|
137
|
+
end
|
138
|
+
end
|
@@ -0,0 +1,164 @@
|
|
1
|
+
module JPSClient
|
2
|
+
module API
|
3
|
+
# AppResource 相关 API
|
4
|
+
# 处理 /api/aso/* 和 /api/elements/* 路径的接口
|
5
|
+
module AppResource
|
6
|
+
|
7
|
+
# 更新素材
|
8
|
+
#
|
9
|
+
# @param resourceId [Integer] 资源ID(必需)
|
10
|
+
# @param params [Hash] 更新参数
|
11
|
+
# @return [Hash] API响应
|
12
|
+
def update_app_resource(resourceId:, params: {})
|
13
|
+
config = @request_config && @request_config["app_resource_update"]
|
14
|
+
raise JPSClient::ExceptionError, "Missing config for app_resource_update" unless config && config["url"]
|
15
|
+
|
16
|
+
path = config["url"].gsub("{resourceId}", resourceId.to_s)
|
17
|
+
|
18
|
+
response = @http_client.put(path, body: params)
|
19
|
+
result = JPSClient::Response.new(response)
|
20
|
+
|
21
|
+
if result.need_login?
|
22
|
+
do_login(force_login: true)
|
23
|
+
response = @http_client.put(path, body: params)
|
24
|
+
result = JPSClient::Response.new(response)
|
25
|
+
end
|
26
|
+
|
27
|
+
return result.to_h
|
28
|
+
end
|
29
|
+
|
30
|
+
# 删除素材
|
31
|
+
#
|
32
|
+
# @param resourceId [Integer] 资源ID(必需)
|
33
|
+
# @return [Hash] API响应
|
34
|
+
def delete_app_resource(resourceId:)
|
35
|
+
config = @request_config && @request_config["app_resource_delete"]
|
36
|
+
raise JPSClient::ExceptionError, "Missing config for app_resource_delete" unless config && config["url"]
|
37
|
+
|
38
|
+
path = config["url"].gsub("{resourceId}", resourceId.to_s)
|
39
|
+
|
40
|
+
response = @http_client.delete(path)
|
41
|
+
result = JPSClient::Response.new(response)
|
42
|
+
|
43
|
+
if result.need_login?
|
44
|
+
do_login(force_login: true)
|
45
|
+
response = @http_client.delete(path)
|
46
|
+
result = JPSClient::Response.new(response)
|
47
|
+
end
|
48
|
+
|
49
|
+
return result.to_h
|
50
|
+
end
|
51
|
+
|
52
|
+
# 应用详情下发素材列表
|
53
|
+
#
|
54
|
+
# @param params [Hash] 请求参数
|
55
|
+
# @return [Hash] API响应
|
56
|
+
def get_app_elements(params: {})
|
57
|
+
config = @request_config && @request_config["app_elements"]
|
58
|
+
raise JPSClient::ExceptionError, "Missing config for app_elements" unless config && config["url"]
|
59
|
+
|
60
|
+
path = config["url"]
|
61
|
+
|
62
|
+
response = @http_client.post(path, body: params)
|
63
|
+
result = JPSClient::Response.new(response)
|
64
|
+
|
65
|
+
if result.need_login?
|
66
|
+
do_login(force_login: true)
|
67
|
+
response = @http_client.post(path, body: params)
|
68
|
+
result = JPSClient::Response.new(response)
|
69
|
+
end
|
70
|
+
|
71
|
+
return result.to_h
|
72
|
+
end
|
73
|
+
|
74
|
+
# 素材库下发素材列表
|
75
|
+
#
|
76
|
+
# @param params [Hash] 请求参数
|
77
|
+
# @return [Hash] API响应
|
78
|
+
def get_category_elements(params: {})
|
79
|
+
config = @request_config && @request_config["category_elements"]
|
80
|
+
raise JPSClient::ExceptionError, "Missing config for category_elements" unless config && config["url"]
|
81
|
+
|
82
|
+
path = config["url"]
|
83
|
+
|
84
|
+
response = @http_client.post(path, body: params)
|
85
|
+
result = JPSClient::Response.new(response)
|
86
|
+
|
87
|
+
if result.need_login?
|
88
|
+
do_login(force_login: true)
|
89
|
+
response = @http_client.post(path, body: params)
|
90
|
+
result = JPSClient::Response.new(response)
|
91
|
+
end
|
92
|
+
|
93
|
+
return result.to_h
|
94
|
+
end
|
95
|
+
|
96
|
+
# 新增素材
|
97
|
+
#
|
98
|
+
# @param params [Hash] 请求参数
|
99
|
+
# @return [Hash] API响应
|
100
|
+
def create_app_resource(params: {})
|
101
|
+
config = @request_config && @request_config["app_resource_create"]
|
102
|
+
raise JPSClient::ExceptionError, "Missing config for app_resource_create" unless config && config["url"]
|
103
|
+
|
104
|
+
path = config["url"]
|
105
|
+
|
106
|
+
response = @http_client.post(path, body: params)
|
107
|
+
result = JPSClient::Response.new(response)
|
108
|
+
|
109
|
+
if result.need_login?
|
110
|
+
do_login(force_login: true)
|
111
|
+
response = @http_client.post(path, body: params)
|
112
|
+
result = JPSClient::Response.new(response)
|
113
|
+
end
|
114
|
+
|
115
|
+
return result.to_h
|
116
|
+
end
|
117
|
+
|
118
|
+
# 批量新增素材(通过ZIP)
|
119
|
+
#
|
120
|
+
# @param params [Hash] 请求参数
|
121
|
+
# @return [Hash] API响应
|
122
|
+
def create_app_resource_by_zip(params: {})
|
123
|
+
config = @request_config && @request_config["app_resource_zip_create"]
|
124
|
+
raise JPSClient::ExceptionError, "Missing config for app_resource_zip_create" unless config && config["url"]
|
125
|
+
|
126
|
+
path = config["url"]
|
127
|
+
|
128
|
+
response = @http_client.post(path, body: params)
|
129
|
+
result = JPSClient::Response.new(response)
|
130
|
+
|
131
|
+
if result.need_login?
|
132
|
+
do_login(force_login: true)
|
133
|
+
response = @http_client.post(path, body: params)
|
134
|
+
result = JPSClient::Response.new(response)
|
135
|
+
end
|
136
|
+
|
137
|
+
return result.to_h
|
138
|
+
end
|
139
|
+
|
140
|
+
# 移动或复制素材
|
141
|
+
#
|
142
|
+
# @param params [Array] 请求参数数组
|
143
|
+
# @return [Hash] API响应
|
144
|
+
def copy_or_transfer_resource(params: [])
|
145
|
+
config = @request_config && @request_config["app_resource_copy_transfer"]
|
146
|
+
raise JPSClient::ExceptionError, "Missing config for app_resource_copy_transfer" unless config && config["url"]
|
147
|
+
|
148
|
+
path = config["url"]
|
149
|
+
|
150
|
+
response = @http_client.post(path, body: params)
|
151
|
+
result = JPSClient::Response.new(response)
|
152
|
+
|
153
|
+
if result.need_login?
|
154
|
+
do_login(force_login: true)
|
155
|
+
response = @http_client.post(path, body: params)
|
156
|
+
result = JPSClient::Response.new(response)
|
157
|
+
end
|
158
|
+
|
159
|
+
return result.to_h
|
160
|
+
end
|
161
|
+
|
162
|
+
end
|
163
|
+
end
|
164
|
+
end
|
@@ -0,0 +1,52 @@
|
|
1
|
+
module JPSClient
|
2
|
+
module API
|
3
|
+
# AppResourceVersion 相关 API
|
4
|
+
# 自动生成的模块,处理 app_resource_version 相关接口
|
5
|
+
module AppResourceVersion
|
6
|
+
|
7
|
+
# Get List
|
8
|
+
#
|
9
|
+
# @param params [Hash] 请求参数
|
10
|
+
# @return [Hash] API响应
|
11
|
+
def get_list(params: {})
|
12
|
+
config = @request_config && @request_config["app_resource_version_list"]
|
13
|
+
raise JPSClient::ExceptionError, "Missing config for app_resource_version_list" unless config && config["url"]
|
14
|
+
|
15
|
+
path = config["url"]
|
16
|
+
|
17
|
+
response = @http_client.post(path, body: params)
|
18
|
+
result = JPSClient::Response.new(response)
|
19
|
+
|
20
|
+
if result.need_login?
|
21
|
+
do_login(force_login: true)
|
22
|
+
response = @http_client.post(path, body: params)
|
23
|
+
result = JPSClient::Response.new(response)
|
24
|
+
end
|
25
|
+
|
26
|
+
return result.to_h
|
27
|
+
end
|
28
|
+
|
29
|
+
# Create Add
|
30
|
+
#
|
31
|
+
# @param params [Hash] 请求参数
|
32
|
+
# @return [Hash] API响应
|
33
|
+
def create_add(params: {})
|
34
|
+
config = @request_config && @request_config["app_resource_version_add"]
|
35
|
+
raise JPSClient::ExceptionError, "Missing config for app_resource_version_add" unless config && config["url"]
|
36
|
+
|
37
|
+
path = config["url"]
|
38
|
+
|
39
|
+
response = @http_client.post(path, body: params)
|
40
|
+
result = JPSClient::Response.new(response)
|
41
|
+
|
42
|
+
if result.need_login?
|
43
|
+
do_login(force_login: true)
|
44
|
+
response = @http_client.post(path, body: params)
|
45
|
+
result = JPSClient::Response.new(response)
|
46
|
+
end
|
47
|
+
|
48
|
+
return result.to_h
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
@@ -0,0 +1,140 @@
|
|
1
|
+
module JPSClient
|
2
|
+
module API
|
3
|
+
# AppleAccount 相关 API
|
4
|
+
# 自动生成的模块,处理 apple_account 相关接口
|
5
|
+
module AppleAccount
|
6
|
+
|
7
|
+
# Create Update
|
8
|
+
#
|
9
|
+
# @param params [Hash] 请求参数
|
10
|
+
# @return [Hash] API响应
|
11
|
+
def create_update(params: {})
|
12
|
+
config = @request_config && @request_config["apple_account_update"]
|
13
|
+
raise JPSClient::ExceptionError, "Missing config for apple_account_update" unless config && config["url"]
|
14
|
+
|
15
|
+
path = config["url"]
|
16
|
+
|
17
|
+
response = @http_client.post(path, body: params)
|
18
|
+
result = JPSClient::Response.new(response)
|
19
|
+
|
20
|
+
if result.need_login?
|
21
|
+
do_login(force_login: true)
|
22
|
+
response = @http_client.post(path, body: params)
|
23
|
+
result = JPSClient::Response.new(response)
|
24
|
+
end
|
25
|
+
|
26
|
+
return result.to_h
|
27
|
+
end
|
28
|
+
|
29
|
+
# Create Delete
|
30
|
+
#
|
31
|
+
# @param params [Hash] 请求参数
|
32
|
+
# @return [Hash] API响应
|
33
|
+
def create_delete(params: {})
|
34
|
+
config = @request_config && @request_config["apple_account_delete"]
|
35
|
+
raise JPSClient::ExceptionError, "Missing config for apple_account_delete" unless config && config["url"]
|
36
|
+
|
37
|
+
path = config["url"]
|
38
|
+
|
39
|
+
response = @http_client.post(path, body: params)
|
40
|
+
result = JPSClient::Response.new(response)
|
41
|
+
|
42
|
+
if result.need_login?
|
43
|
+
do_login(force_login: true)
|
44
|
+
response = @http_client.post(path, body: params)
|
45
|
+
result = JPSClient::Response.new(response)
|
46
|
+
end
|
47
|
+
|
48
|
+
return result.to_h
|
49
|
+
end
|
50
|
+
|
51
|
+
# Create Create
|
52
|
+
#
|
53
|
+
# @param params [Hash] 请求参数
|
54
|
+
# @return [Hash] API响应
|
55
|
+
def create_create(params: {})
|
56
|
+
config = @request_config && @request_config["apple_account_create"]
|
57
|
+
raise JPSClient::ExceptionError, "Missing config for apple_account_create" unless config && config["url"]
|
58
|
+
|
59
|
+
path = config["url"]
|
60
|
+
|
61
|
+
response = @http_client.post(path, body: params)
|
62
|
+
result = JPSClient::Response.new(response)
|
63
|
+
|
64
|
+
if result.need_login?
|
65
|
+
do_login(force_login: true)
|
66
|
+
response = @http_client.post(path, body: params)
|
67
|
+
result = JPSClient::Response.new(response)
|
68
|
+
end
|
69
|
+
|
70
|
+
return result.to_h
|
71
|
+
end
|
72
|
+
|
73
|
+
# Create Bind
|
74
|
+
#
|
75
|
+
# @param params [Hash] 请求参数
|
76
|
+
# @return [Hash] API响应
|
77
|
+
def create_bind(params: {})
|
78
|
+
config = @request_config && @request_config["apple_account_bind"]
|
79
|
+
raise JPSClient::ExceptionError, "Missing config for apple_account_bind" unless config && config["url"]
|
80
|
+
|
81
|
+
path = config["url"]
|
82
|
+
|
83
|
+
response = @http_client.post(path, body: params)
|
84
|
+
result = JPSClient::Response.new(response)
|
85
|
+
|
86
|
+
if result.need_login?
|
87
|
+
do_login(force_login: true)
|
88
|
+
response = @http_client.post(path, body: params)
|
89
|
+
result = JPSClient::Response.new(response)
|
90
|
+
end
|
91
|
+
|
92
|
+
return result.to_h
|
93
|
+
end
|
94
|
+
|
95
|
+
# Get List
|
96
|
+
#
|
97
|
+
# @param params [Hash] 请求参数
|
98
|
+
# @return [Hash] API响应
|
99
|
+
def get_list(params: {})
|
100
|
+
config = @request_config && @request_config["apple_account_list"]
|
101
|
+
raise JPSClient::ExceptionError, "Missing config for apple_account_list" unless config && config["url"]
|
102
|
+
|
103
|
+
path = config["url"]
|
104
|
+
|
105
|
+
response = @http_client.get(path, params: params)
|
106
|
+
result = JPSClient::Response.new(response)
|
107
|
+
|
108
|
+
if result.need_login?
|
109
|
+
do_login(force_login: true)
|
110
|
+
response = @http_client.get(path, params: params)
|
111
|
+
result = JPSClient::Response.new(response)
|
112
|
+
end
|
113
|
+
|
114
|
+
return result.to_h
|
115
|
+
end
|
116
|
+
|
117
|
+
# Get Detail
|
118
|
+
#
|
119
|
+
# @param params [Hash] 请求参数
|
120
|
+
# @return [Hash] API响应
|
121
|
+
def get_detail(params: {})
|
122
|
+
config = @request_config && @request_config["apple_account_detail"]
|
123
|
+
raise JPSClient::ExceptionError, "Missing config for apple_account_detail" unless config && config["url"]
|
124
|
+
|
125
|
+
path = config["url"]
|
126
|
+
|
127
|
+
response = @http_client.get(path, params: params)
|
128
|
+
result = JPSClient::Response.new(response)
|
129
|
+
|
130
|
+
if result.need_login?
|
131
|
+
do_login(force_login: true)
|
132
|
+
response = @http_client.get(path, params: params)
|
133
|
+
result = JPSClient::Response.new(response)
|
134
|
+
end
|
135
|
+
|
136
|
+
return result.to_h
|
137
|
+
end
|
138
|
+
end
|
139
|
+
end
|
140
|
+
end
|