Module: JPSClient::API::AppLevel

Included in:
Client
Defined in:
lib/jpsclient/api/app_level.rb

Overview

应用关卡管理相关 API 处理 /api/level/* 路径的所有接口

Instance Method Summary collapse

Instance Method Details

#create_app_level(params: {}) ⇒ Hash

创建关卡

Parameters:

  • params (Hash) (defaults to: {})

    关卡信息参数

Returns:

  • (Hash)

    API响应

Raises:



50
51
52
53
54
55
56
# File 'lib/jpsclient/api/app_level.rb', line 50

def create_app_level(params: {})
  config = @request_config && @request_config["app_level_create"]
  raise JPSClient::ExceptionError, "Missing config for app_level_create" unless config && config["url"]
  path = config["url"]

  return request_with_auth(:post, path, body: params)
end

#delete_app_level(resourceId:) ⇒ Hash

删除关卡

Parameters:

  • resourceId (String)

    资源ID(必需)

Returns:

  • (Hash)

    API响应

Raises:



25
26
27
28
29
30
31
32
# File 'lib/jpsclient/api/app_level.rb', line 25

def delete_app_level(resourceId:)
  config = @request_config && @request_config["app_level_delete"]
  raise JPSClient::ExceptionError, "Missing config for app_level_delete" unless config && config["url"]

  path = config["url"].gsub("{resourceId}", resourceId.to_s)

  return request_with_auth(:delete, path)
end

#get_all_category_levels(params: {}) ⇒ Hash

获取所有分类的关卡

Parameters:

  • params (Hash) (defaults to: {})

    查询参数

Returns:

  • (Hash)

    API响应

Raises:



74
75
76
77
78
79
80
# File 'lib/jpsclient/api/app_level.rb', line 74

def get_all_category_levels(params: {})
  config = @request_config && @request_config["category_all_levels"]
  raise JPSClient::ExceptionError, "Missing config for category_all_levels" unless config && config["url"]
  path = config["url"]

  return request_with_auth(:post, path, body: params)
end

#get_app_levels(params: {}) ⇒ Hash

获取关卡列表

Parameters:

  • params (Hash) (defaults to: {})

    查询参数

Returns:

  • (Hash)

    API响应

Raises:



38
39
40
41
42
43
44
# File 'lib/jpsclient/api/app_level.rb', line 38

def get_app_levels(params: {})
  config = @request_config && @request_config["app_levels_list"]
  raise JPSClient::ExceptionError, "Missing config for app_levels_list" unless config && config["url"]
  path = config["url"]

  return request_with_auth(:post, path, body: params)
end

#update_app_level(resourceId:, params: {}) ⇒ Hash

更新关卡信息

Parameters:

  • resourceId (String)

    资源ID(必需)

  • params (Hash) (defaults to: {})

    更新参数

Returns:

  • (Hash)

    API响应

Raises:



12
13
14
15
16
17
18
19
# File 'lib/jpsclient/api/app_level.rb', line 12

def update_app_level(resourceId:, params: {})
  config = @request_config && @request_config["app_level_update"]
  raise JPSClient::ExceptionError, "Missing config for app_level_update" unless config && config["url"]

  path = config["url"].gsub("{resourceId}", resourceId.to_s)

  return request_with_auth(:put, path, body: params)
end

#upload_app_level_zip(params: {}) ⇒ Hash

上传关卡压缩包

Parameters:

  • params (Hash) (defaults to: {})

    上传参数

Returns:

  • (Hash)

    API响应

Raises:



62
63
64
65
66
67
68
# File 'lib/jpsclient/api/app_level.rb', line 62

def upload_app_level_zip(params: {})
  config = @request_config && @request_config["app_level_zip_upload"]
  raise JPSClient::ExceptionError, "Missing config for app_level_zip_upload" unless config && config["url"]
  path = config["url"]

  return request_with_auth(:post, path, body: params)
end