Module: JPSClient::API::Category
- Included in:
- Client
- Defined in:
- lib/jpsclient/api/category.rb
Overview
Category 相关 API 通用分类管理接口 (/api/category,分类 controller)
Instance Method Summary collapse
-
#create_category(params: {}) ⇒ Hash
创建分类.
-
#delete_category(params: {}) ⇒ Hash
删除分类.
-
#get_category_list(params: {}) ⇒ Hash
分类列表.
-
#get_category_tree(params: {}) ⇒ Hash
分类树.
-
#sort_categories(params: []) ⇒ Hash
分类排序.
-
#update_category(params: {}) ⇒ Hash
更新分类.
Instance Method Details
#create_category(params: {}) ⇒ Hash
创建分类
37 38 39 40 41 42 43 44 |
# File 'lib/jpsclient/api/category.rb', line 37 def create_category(params: {}) config = @request_config && @request_config["category_create"] raise JPSClient::ExceptionError, "Missing config for category_create" unless config && config["url"] path = config["url"] return request_with_auth(:post, path, body: params) end |
#delete_category(params: {}) ⇒ Hash
删除分类
63 64 65 66 67 68 69 70 |
# File 'lib/jpsclient/api/category.rb', line 63 def delete_category(params: {}) config = @request_config && @request_config["category_delete"] raise JPSClient::ExceptionError, "Missing config for category_delete" unless config && config["url"] path = config["url"] return request_with_auth(:post, path, body: params) end |
#get_category_list(params: {}) ⇒ Hash
分类列表
11 12 13 14 15 16 17 18 |
# File 'lib/jpsclient/api/category.rb', line 11 def get_category_list(params: {}) config = @request_config && @request_config["category_list"] raise JPSClient::ExceptionError, "Missing config for category_list" unless config && config["url"] path = config["url"] return request_with_auth(:get, path, params: params) end |
#get_category_tree(params: {}) ⇒ Hash
分类树
24 25 26 27 28 29 30 31 |
# File 'lib/jpsclient/api/category.rb', line 24 def get_category_tree(params: {}) config = @request_config && @request_config["category_tree"] raise JPSClient::ExceptionError, "Missing config for category_tree" unless config && config["url"] path = config["url"] return request_with_auth(:get, path, params: params) end |
#sort_categories(params: []) ⇒ Hash
分类排序
76 77 78 79 80 81 82 83 |
# File 'lib/jpsclient/api/category.rb', line 76 def sort_categories(params: []) config = @request_config && @request_config["category_sort"] raise JPSClient::ExceptionError, "Missing config for category_sort" unless config && config["url"] path = config["url"] return request_with_auth(:post, path, body: params) end |
#update_category(params: {}) ⇒ Hash
更新分类
50 51 52 53 54 55 56 57 |
# File 'lib/jpsclient/api/category.rb', line 50 def update_category(params: {}) config = @request_config && @request_config["category_update"] raise JPSClient::ExceptionError, "Missing config for category_update" unless config && config["url"] path = config["url"] return request_with_auth(:post, path, body: params) end |