Module: JPSClient::API::ToolCategory

Defined in:
lib/jpsclient/api/archived_outdated/tool_category.rb

Overview

ToolCategory 相关 API 自动生成的模块,处理 tool_category 相关接口

Instance Method Summary collapse

Instance Method Details

#create_tool_category(params: {}) ⇒ Hash

Create Tool Category

Parameters:

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

    请求参数

Returns:

  • (Hash)

    API响应

Raises:



57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/jpsclient/api/archived_outdated/tool_category.rb', line 57

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

  path = config["url"]

  response = @http_client.post(path, body: params)
  result = JPSClient::Response.new(response)

  if result.need_login?
    (force_login: true)
    response = @http_client.post(path, body: params)
    result = JPSClient::Response.new(response)
  end

  return result.to_h
end

#create_weights(params: {}) ⇒ Hash

Create Weights

Parameters:

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

    请求参数

Returns:

  • (Hash)

    API响应

Raises:



79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# File 'lib/jpsclient/api/archived_outdated/tool_category.rb', line 79

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

  path = config["url"]

  response = @http_client.post(path, body: params)
  result = JPSClient::Response.new(response)

  if result.need_login?
    (force_login: true)
    response = @http_client.post(path, body: params)
    result = JPSClient::Response.new(response)
  end

  return result.to_h
end

#delete_tool_category(categoryId:, params: {}) ⇒ Hash

Delete Tool Category

Parameters:

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

    请求参数

Returns:

  • (Hash)

    API响应

Raises:



34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/jpsclient/api/archived_outdated/tool_category.rb', line 34

def delete_tool_category(categoryId:, params: {})
  config = @request_config && @request_config["tool_category_tool_category"]
  raise JPSClient::ExceptionError, "Missing config for tool_category_tool_category" unless config && config["url"]

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

  response = @http_client.delete(path)
  result = JPSClient::Response.new(response)

  if result.need_login?
    (force_login: true)
    response = @http_client.delete(path)
    result = JPSClient::Response.new(response)
  end

  return result.to_h
end

#get_tool_categories(params: {}) ⇒ Hash

Get Tool Categories

Parameters:

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

    请求参数

Returns:

  • (Hash)

    API响应

Raises:



101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# File 'lib/jpsclient/api/archived_outdated/tool_category.rb', line 101

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

  path = config["url"]

  response = @http_client.get(path, params: params)
  result = JPSClient::Response.new(response)

  if result.need_login?
    (force_login: true)
    response = @http_client.get(path, params: params)
    result = JPSClient::Response.new(response)
  end

  return result.to_h
end

#update_tool_category(categoryId:, params: {}) ⇒ Hash

Update Tool Category

Parameters:

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

    请求参数

Returns:

  • (Hash)

    API响应

Raises:



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/jpsclient/api/archived_outdated/tool_category.rb', line 11

def update_tool_category(categoryId:, params: {})
  config = @request_config && @request_config["tool_category_tool_category"]
  raise JPSClient::ExceptionError, "Missing config for tool_category_tool_category" unless config && config["url"]

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

  response = @http_client.put(path, body: params)
  result = JPSClient::Response.new(response)

  if result.need_login?
    (force_login: true)
    response = @http_client.put(path, body: params)
    result = JPSClient::Response.new(response)
  end

  return result.to_h
end