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
@@ -0,0 +1,120 @@
|
|
1
|
+
module JPSClient
|
2
|
+
module API
|
3
|
+
# ResourceCategory 相关 API
|
4
|
+
# 自动生成的模块,处理 resource_category 相关接口
|
5
|
+
module ResourceCategory
|
6
|
+
|
7
|
+
# Update Resource Category
|
8
|
+
#
|
9
|
+
# @param params [Hash] 请求参数
|
10
|
+
# @return [Hash] API响应
|
11
|
+
def update_resource_category(categoryId:, params: {})
|
12
|
+
config = @request_config && @request_config["resource_category_resource_category"]
|
13
|
+
raise JPSClient::ExceptionError, "Missing config for resource_category_resource_category" unless config && config["url"]
|
14
|
+
|
15
|
+
path = config["url"]
|
16
|
+
path = path.gsub("{categoryId}", categoryId.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
|
+
# Delete Resource Category
|
31
|
+
#
|
32
|
+
# @param params [Hash] 请求参数
|
33
|
+
# @return [Hash] API响应
|
34
|
+
def delete_resource_category(categoryId:, params: {})
|
35
|
+
config = @request_config && @request_config["resource_category_resource_category"]
|
36
|
+
raise JPSClient::ExceptionError, "Missing config for resource_category_resource_category" unless config && config["url"]
|
37
|
+
|
38
|
+
path = config["url"]
|
39
|
+
path = path.gsub("{categoryId}", categoryId.to_s)
|
40
|
+
|
41
|
+
response = @http_client.delete(path)
|
42
|
+
result = JPSClient::Response.new(response)
|
43
|
+
|
44
|
+
if result.need_login?
|
45
|
+
do_login(force_login: true)
|
46
|
+
response = @http_client.delete(path)
|
47
|
+
result = JPSClient::Response.new(response)
|
48
|
+
end
|
49
|
+
|
50
|
+
return result.to_h
|
51
|
+
end
|
52
|
+
|
53
|
+
# Create Resource Category
|
54
|
+
#
|
55
|
+
# @param params [Hash] 请求参数
|
56
|
+
# @return [Hash] API响应
|
57
|
+
def create_resource_category(params: {})
|
58
|
+
config = @request_config && @request_config["resource_category_resource_category"]
|
59
|
+
raise JPSClient::ExceptionError, "Missing config for resource_category_resource_category" unless config && config["url"]
|
60
|
+
|
61
|
+
path = config["url"]
|
62
|
+
|
63
|
+
response = @http_client.post(path, body: params)
|
64
|
+
result = JPSClient::Response.new(response)
|
65
|
+
|
66
|
+
if result.need_login?
|
67
|
+
do_login(force_login: true)
|
68
|
+
response = @http_client.post(path, body: params)
|
69
|
+
result = JPSClient::Response.new(response)
|
70
|
+
end
|
71
|
+
|
72
|
+
return result.to_h
|
73
|
+
end
|
74
|
+
|
75
|
+
# Create Weights
|
76
|
+
#
|
77
|
+
# @param params [Hash] 请求参数
|
78
|
+
# @return [Hash] API响应
|
79
|
+
def create_weights(params: {})
|
80
|
+
config = @request_config && @request_config["resource_category_weights"]
|
81
|
+
raise JPSClient::ExceptionError, "Missing config for resource_category_weights" unless config && config["url"]
|
82
|
+
|
83
|
+
path = config["url"]
|
84
|
+
|
85
|
+
response = @http_client.post(path, body: params)
|
86
|
+
result = JPSClient::Response.new(response)
|
87
|
+
|
88
|
+
if result.need_login?
|
89
|
+
do_login(force_login: true)
|
90
|
+
response = @http_client.post(path, body: params)
|
91
|
+
result = JPSClient::Response.new(response)
|
92
|
+
end
|
93
|
+
|
94
|
+
return result.to_h
|
95
|
+
end
|
96
|
+
|
97
|
+
# Create Resource Categories
|
98
|
+
#
|
99
|
+
# @param params [Hash] 请求参数
|
100
|
+
# @return [Hash] API响应
|
101
|
+
def create_resource_categories(params: {})
|
102
|
+
config = @request_config && @request_config["resource_category_resource_categories"]
|
103
|
+
raise JPSClient::ExceptionError, "Missing config for resource_category_resource_categories" unless config && config["url"]
|
104
|
+
|
105
|
+
path = config["url"]
|
106
|
+
|
107
|
+
response = @http_client.post(path, body: params)
|
108
|
+
result = JPSClient::Response.new(response)
|
109
|
+
|
110
|
+
if result.need_login?
|
111
|
+
do_login(force_login: true)
|
112
|
+
response = @http_client.post(path, body: params)
|
113
|
+
result = JPSClient::Response.new(response)
|
114
|
+
end
|
115
|
+
|
116
|
+
return result.to_h
|
117
|
+
end
|
118
|
+
end
|
119
|
+
end
|
120
|
+
end
|
@@ -0,0 +1,165 @@
|
|
1
|
+
module JPSClient
|
2
|
+
module API
|
3
|
+
# Role 相关 API
|
4
|
+
# 自动生成的模块,处理 role 相关接口
|
5
|
+
module Role
|
6
|
+
|
7
|
+
# Get Role Detail
|
8
|
+
#
|
9
|
+
# @param params [Hash] 请求参数
|
10
|
+
# @return [Hash] API响应
|
11
|
+
def get_role_detail(roleId:, params: {})
|
12
|
+
config = @request_config && @request_config["role_role_detail"]
|
13
|
+
raise JPSClient::ExceptionError, "Missing config for role_role_detail" unless config && config["url"]
|
14
|
+
|
15
|
+
path = config["url"]
|
16
|
+
path = path.gsub("{roleId}", roleId.to_s)
|
17
|
+
|
18
|
+
response = @http_client.get(path, params: params)
|
19
|
+
result = JPSClient::Response.new(response)
|
20
|
+
|
21
|
+
if result.need_login?
|
22
|
+
do_login(force_login: true)
|
23
|
+
response = @http_client.get(path, params: params)
|
24
|
+
result = JPSClient::Response.new(response)
|
25
|
+
end
|
26
|
+
|
27
|
+
return result.to_h
|
28
|
+
end
|
29
|
+
|
30
|
+
# Update Role
|
31
|
+
#
|
32
|
+
# @param params [Hash] 请求参数
|
33
|
+
# @return [Hash] API响应
|
34
|
+
def update_role(roleId:, params: {})
|
35
|
+
config = @request_config && @request_config["role_role"]
|
36
|
+
raise JPSClient::ExceptionError, "Missing config for role_role" unless config && config["url"]
|
37
|
+
|
38
|
+
path = config["url"]
|
39
|
+
path = path.gsub("{roleId}", roleId.to_s)
|
40
|
+
|
41
|
+
response = @http_client.put(path, body: params)
|
42
|
+
result = JPSClient::Response.new(response)
|
43
|
+
|
44
|
+
if result.need_login?
|
45
|
+
do_login(force_login: true)
|
46
|
+
response = @http_client.put(path, body: params)
|
47
|
+
result = JPSClient::Response.new(response)
|
48
|
+
end
|
49
|
+
|
50
|
+
return result.to_h
|
51
|
+
end
|
52
|
+
|
53
|
+
# Delete Role
|
54
|
+
#
|
55
|
+
# @param params [Hash] 请求参数
|
56
|
+
# @return [Hash] API响应
|
57
|
+
def delete_role(roleId:, params: {})
|
58
|
+
config = @request_config && @request_config["role_role"]
|
59
|
+
raise JPSClient::ExceptionError, "Missing config for role_role" unless config && config["url"]
|
60
|
+
|
61
|
+
path = config["url"]
|
62
|
+
path = path.gsub("{roleId}", roleId.to_s)
|
63
|
+
|
64
|
+
response = @http_client.delete(path)
|
65
|
+
result = JPSClient::Response.new(response)
|
66
|
+
|
67
|
+
if result.need_login?
|
68
|
+
do_login(force_login: true)
|
69
|
+
response = @http_client.delete(path)
|
70
|
+
result = JPSClient::Response.new(response)
|
71
|
+
end
|
72
|
+
|
73
|
+
return result.to_h
|
74
|
+
end
|
75
|
+
|
76
|
+
# Create Role
|
77
|
+
#
|
78
|
+
# @param params [Hash] 请求参数
|
79
|
+
# @return [Hash] API响应
|
80
|
+
def create_role(params: {})
|
81
|
+
config = @request_config && @request_config["role_role"]
|
82
|
+
raise JPSClient::ExceptionError, "Missing config for role_role" unless config && config["url"]
|
83
|
+
|
84
|
+
path = config["url"]
|
85
|
+
|
86
|
+
response = @http_client.post(path, body: params)
|
87
|
+
result = JPSClient::Response.new(response)
|
88
|
+
|
89
|
+
if result.need_login?
|
90
|
+
do_login(force_login: true)
|
91
|
+
response = @http_client.post(path, body: params)
|
92
|
+
result = JPSClient::Response.new(response)
|
93
|
+
end
|
94
|
+
|
95
|
+
return result.to_h
|
96
|
+
end
|
97
|
+
|
98
|
+
# Create User
|
99
|
+
#
|
100
|
+
# @param params [Hash] 请求参数
|
101
|
+
# @return [Hash] API响应
|
102
|
+
def create_user(params: {})
|
103
|
+
config = @request_config && @request_config["role_user"]
|
104
|
+
raise JPSClient::ExceptionError, "Missing config for role_user" unless config && config["url"]
|
105
|
+
|
106
|
+
path = config["url"]
|
107
|
+
|
108
|
+
response = @http_client.post(path, body: params)
|
109
|
+
result = JPSClient::Response.new(response)
|
110
|
+
|
111
|
+
if result.need_login?
|
112
|
+
do_login(force_login: true)
|
113
|
+
response = @http_client.post(path, body: params)
|
114
|
+
result = JPSClient::Response.new(response)
|
115
|
+
end
|
116
|
+
|
117
|
+
return result.to_h
|
118
|
+
end
|
119
|
+
|
120
|
+
# Create Menu
|
121
|
+
#
|
122
|
+
# @param params [Hash] 请求参数
|
123
|
+
# @return [Hash] API响应
|
124
|
+
def create_menu(params: {})
|
125
|
+
config = @request_config && @request_config["role_menu"]
|
126
|
+
raise JPSClient::ExceptionError, "Missing config for role_menu" unless config && config["url"]
|
127
|
+
|
128
|
+
path = config["url"]
|
129
|
+
|
130
|
+
response = @http_client.post(path, body: params)
|
131
|
+
result = JPSClient::Response.new(response)
|
132
|
+
|
133
|
+
if result.need_login?
|
134
|
+
do_login(force_login: true)
|
135
|
+
response = @http_client.post(path, body: params)
|
136
|
+
result = JPSClient::Response.new(response)
|
137
|
+
end
|
138
|
+
|
139
|
+
return result.to_h
|
140
|
+
end
|
141
|
+
|
142
|
+
# Get Roles
|
143
|
+
#
|
144
|
+
# @param params [Hash] 请求参数
|
145
|
+
# @return [Hash] API响应
|
146
|
+
def get_roles(params: {})
|
147
|
+
config = @request_config && @request_config["role_roles"]
|
148
|
+
raise JPSClient::ExceptionError, "Missing config for role_roles" unless config && config["url"]
|
149
|
+
|
150
|
+
path = config["url"]
|
151
|
+
|
152
|
+
response = @http_client.get(path, params: params)
|
153
|
+
result = JPSClient::Response.new(response)
|
154
|
+
|
155
|
+
if result.need_login?
|
156
|
+
do_login(force_login: true)
|
157
|
+
response = @http_client.get(path, params: params)
|
158
|
+
result = JPSClient::Response.new(response)
|
159
|
+
end
|
160
|
+
|
161
|
+
return result.to_h
|
162
|
+
end
|
163
|
+
end
|
164
|
+
end
|
165
|
+
end
|
@@ -0,0 +1,162 @@
|
|
1
|
+
module JPSClient
|
2
|
+
module API
|
3
|
+
# SimpleSearch 相关 API
|
4
|
+
# 自动生成的模块,处理 simple_search 相关接口
|
5
|
+
module SimpleSearch
|
6
|
+
|
7
|
+
# Get Tag
|
8
|
+
#
|
9
|
+
# @param params [Hash] 请求参数
|
10
|
+
# @return [Hash] API响应
|
11
|
+
def get_tag(params: {})
|
12
|
+
config = @request_config && @request_config["simple_search_tag"]
|
13
|
+
raise JPSClient::ExceptionError, "Missing config for simple_search_tag" unless config && config["url"]
|
14
|
+
|
15
|
+
path = config["url"]
|
16
|
+
|
17
|
+
response = @http_client.get(path, params: params)
|
18
|
+
result = JPSClient::Response.new(response)
|
19
|
+
|
20
|
+
if result.need_login?
|
21
|
+
do_login(force_login: true)
|
22
|
+
response = @http_client.get(path, params: params)
|
23
|
+
result = JPSClient::Response.new(response)
|
24
|
+
end
|
25
|
+
|
26
|
+
return result.to_h
|
27
|
+
end
|
28
|
+
|
29
|
+
# Get Publisher Group
|
30
|
+
#
|
31
|
+
# @param params [Hash] 请求参数
|
32
|
+
# @return [Hash] API响应
|
33
|
+
def get_publisher_group(params: {})
|
34
|
+
config = @request_config && @request_config["simple_search_publisher_group"]
|
35
|
+
raise JPSClient::ExceptionError, "Missing config for simple_search_publisher_group" unless config && config["url"]
|
36
|
+
|
37
|
+
path = config["url"]
|
38
|
+
|
39
|
+
response = @http_client.get(path, params: params)
|
40
|
+
result = JPSClient::Response.new(response)
|
41
|
+
|
42
|
+
if result.need_login?
|
43
|
+
do_login(force_login: true)
|
44
|
+
response = @http_client.get(path, params: params)
|
45
|
+
result = JPSClient::Response.new(response)
|
46
|
+
end
|
47
|
+
|
48
|
+
return result.to_h
|
49
|
+
end
|
50
|
+
|
51
|
+
# Get Publisher
|
52
|
+
#
|
53
|
+
# @param params [Hash] 请求参数
|
54
|
+
# @return [Hash] API响应
|
55
|
+
def get_publisher(params: {})
|
56
|
+
config = @request_config && @request_config["simple_search_publisher"]
|
57
|
+
raise JPSClient::ExceptionError, "Missing config for simple_search_publisher" unless config && config["url"]
|
58
|
+
|
59
|
+
path = config["url"]
|
60
|
+
|
61
|
+
response = @http_client.get(path, params: params)
|
62
|
+
result = JPSClient::Response.new(response)
|
63
|
+
|
64
|
+
if result.need_login?
|
65
|
+
do_login(force_login: true)
|
66
|
+
response = @http_client.get(path, params: params)
|
67
|
+
result = JPSClient::Response.new(response)
|
68
|
+
end
|
69
|
+
|
70
|
+
return result.to_h
|
71
|
+
end
|
72
|
+
|
73
|
+
# Get Idea
|
74
|
+
#
|
75
|
+
# @param params [Hash] 请求参数
|
76
|
+
# @return [Hash] API响应
|
77
|
+
def get_idea(params: {})
|
78
|
+
config = @request_config && @request_config["simple_search_idea"]
|
79
|
+
raise JPSClient::ExceptionError, "Missing config for simple_search_idea" unless config && config["url"]
|
80
|
+
|
81
|
+
path = config["url"]
|
82
|
+
|
83
|
+
response = @http_client.get(path, params: params)
|
84
|
+
result = JPSClient::Response.new(response)
|
85
|
+
|
86
|
+
if result.need_login?
|
87
|
+
do_login(force_login: true)
|
88
|
+
response = @http_client.get(path, params: params)
|
89
|
+
result = JPSClient::Response.new(response)
|
90
|
+
end
|
91
|
+
|
92
|
+
return result.to_h
|
93
|
+
end
|
94
|
+
|
95
|
+
# Get Collection
|
96
|
+
#
|
97
|
+
# @param params [Hash] 请求参数
|
98
|
+
# @return [Hash] API响应
|
99
|
+
def get_collection(params: {})
|
100
|
+
config = @request_config && @request_config["simple_search_collection"]
|
101
|
+
raise JPSClient::ExceptionError, "Missing config for simple_search_collection" 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 Asset
|
118
|
+
#
|
119
|
+
# @param params [Hash] 请求参数
|
120
|
+
# @return [Hash] API响应
|
121
|
+
def get_asset(params: {})
|
122
|
+
config = @request_config && @request_config["simple_search_asset"]
|
123
|
+
raise JPSClient::ExceptionError, "Missing config for simple_search_asset" 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
|
+
|
139
|
+
# Get Application
|
140
|
+
#
|
141
|
+
# @param params [Hash] 请求参数
|
142
|
+
# @return [Hash] API响应
|
143
|
+
def get_application(params: {})
|
144
|
+
config = @request_config && @request_config["simple_search_application"]
|
145
|
+
raise JPSClient::ExceptionError, "Missing config for simple_search_application" unless config && config["url"]
|
146
|
+
|
147
|
+
path = config["url"]
|
148
|
+
|
149
|
+
response = @http_client.get(path, params: params)
|
150
|
+
result = JPSClient::Response.new(response)
|
151
|
+
|
152
|
+
if result.need_login?
|
153
|
+
do_login(force_login: true)
|
154
|
+
response = @http_client.get(path, params: params)
|
155
|
+
result = JPSClient::Response.new(response)
|
156
|
+
end
|
157
|
+
|
158
|
+
return result.to_h
|
159
|
+
end
|
160
|
+
end
|
161
|
+
end
|
162
|
+
end
|
@@ -0,0 +1,74 @@
|
|
1
|
+
module JPSClient
|
2
|
+
module API
|
3
|
+
# Sketch 相关 API
|
4
|
+
# 自动生成的模块,处理 sketch 相关接口
|
5
|
+
module Sketch
|
6
|
+
|
7
|
+
# Create Sketch
|
8
|
+
#
|
9
|
+
# @param params [Hash] 请求参数
|
10
|
+
# @return [Hash] API响应
|
11
|
+
def create_sketch(params: {})
|
12
|
+
config = @request_config && @request_config["sketch_sketch"]
|
13
|
+
raise JPSClient::ExceptionError, "Missing config for sketch_sketch" 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 Sketches
|
30
|
+
#
|
31
|
+
# @param params [Hash] 请求参数
|
32
|
+
# @return [Hash] API响应
|
33
|
+
def create_sketches(params: {})
|
34
|
+
config = @request_config && @request_config["sketch_sketches"]
|
35
|
+
raise JPSClient::ExceptionError, "Missing config for sketch_sketches" 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 Sketches
|
52
|
+
#
|
53
|
+
# @param params [Hash] 请求参数
|
54
|
+
# @return [Hash] API响应
|
55
|
+
def create_sketches(params: {})
|
56
|
+
config = @request_config && @request_config["sketch_sketches"]
|
57
|
+
raise JPSClient::ExceptionError, "Missing config for sketch_sketches" 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
|
+
end
|
73
|
+
end
|
74
|
+
end
|
@@ -0,0 +1,97 @@
|
|
1
|
+
module JPSClient
|
2
|
+
module API
|
3
|
+
# SketchCategory 相关 API
|
4
|
+
# 自动生成的模块,处理 sketch_category 相关接口
|
5
|
+
module SketchCategory
|
6
|
+
|
7
|
+
# Update Sketch Category
|
8
|
+
#
|
9
|
+
# @param params [Hash] 请求参数
|
10
|
+
# @return [Hash] API响应
|
11
|
+
def update_sketch_category(categoryId:, params: {})
|
12
|
+
config = @request_config && @request_config["sketch_category_sketch_category"]
|
13
|
+
raise JPSClient::ExceptionError, "Missing config for sketch_category_sketch_category" unless config && config["url"]
|
14
|
+
|
15
|
+
path = config["url"]
|
16
|
+
path = path.gsub("{categoryId}", categoryId.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
|
+
# Create Sketch Category
|
31
|
+
#
|
32
|
+
# @param params [Hash] 请求参数
|
33
|
+
# @return [Hash] API响应
|
34
|
+
def create_sketch_category(params: {})
|
35
|
+
config = @request_config && @request_config["sketch_category_sketch_category"]
|
36
|
+
raise JPSClient::ExceptionError, "Missing config for sketch_category_sketch_category" unless config && config["url"]
|
37
|
+
|
38
|
+
path = config["url"]
|
39
|
+
|
40
|
+
response = @http_client.post(path, body: params)
|
41
|
+
result = JPSClient::Response.new(response)
|
42
|
+
|
43
|
+
if result.need_login?
|
44
|
+
do_login(force_login: true)
|
45
|
+
response = @http_client.post(path, body: params)
|
46
|
+
result = JPSClient::Response.new(response)
|
47
|
+
end
|
48
|
+
|
49
|
+
return result.to_h
|
50
|
+
end
|
51
|
+
|
52
|
+
# Create Weights
|
53
|
+
#
|
54
|
+
# @param params [Hash] 请求参数
|
55
|
+
# @return [Hash] API响应
|
56
|
+
def create_weights(params: {})
|
57
|
+
config = @request_config && @request_config["sketch_category_weights"]
|
58
|
+
raise JPSClient::ExceptionError, "Missing config for sketch_category_weights" 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
|
+
# Create Sketch Categories
|
75
|
+
#
|
76
|
+
# @param params [Hash] 请求参数
|
77
|
+
# @return [Hash] API响应
|
78
|
+
def create_sketch_categories(params: {})
|
79
|
+
config = @request_config && @request_config["sketch_category_sketch_categories"]
|
80
|
+
raise JPSClient::ExceptionError, "Missing config for sketch_category_sketch_categories" 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
|
+
end
|
96
|
+
end
|
97
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
module JPSClient
|
2
|
+
module API
|
3
|
+
# Sov 相关 API
|
4
|
+
# 自动生成的模块,处理 sov 相关接口
|
5
|
+
module Sov
|
6
|
+
|
7
|
+
# Create Sovs
|
8
|
+
#
|
9
|
+
# @param params [Hash] 请求参数
|
10
|
+
# @return [Hash] API响应
|
11
|
+
def create_sovs(params: {})
|
12
|
+
config = @request_config && @request_config["sov_sovs"]
|
13
|
+
raise JPSClient::ExceptionError, "Missing config for sov_sovs" 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
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
module JPSClient
|
2
|
+
module API
|
3
|
+
# Statistics 相关 API
|
4
|
+
# 自动生成的模块,处理 statistics 相关接口
|
5
|
+
module Statistics
|
6
|
+
|
7
|
+
# Create Rankings
|
8
|
+
#
|
9
|
+
# @param params [Hash] 请求参数
|
10
|
+
# @return [Hash] API响应
|
11
|
+
def create_rankings(params: {})
|
12
|
+
config = @request_config && @request_config["statistics_rankings"]
|
13
|
+
raise JPSClient::ExceptionError, "Missing config for statistics_rankings" 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
|
+
end
|
29
|
+
end
|
30
|
+
end
|