GET /api/users/:user_id/table_preferences
列出用户的表偏好

示例

GET /api/users/135138680/table_preferences
200
{
  "total": 0,
  "subtotal": 0,
  "page": 1,
  "per_page": 20,
  "search": null,
  "sort": {
    "by": null,
    "order": null
  },
  "results": []
}

参数

参数名字 描述
location_id
选填

根据位置界定的范围

Validations:

  • Must be a Integer

organization_id
选填

根据机构界定的范围

Validations:

  • Must be a Integer


GET /api/users/:user_id/table_preferences/:name
一个指定表的表偏好详情

示例

GET /api/users/135138680/table_preferences/test_subscriptions_resource
200
{
  "id": 4,
  "name": "test_subscriptions_resource",
  "columns": [
    "1",
    "2",
    "3"
  ],
  "created_at": "2019-09-11 14:56:37 UTC",
  "updated_at": "2019-09-11 14:56:37 UTC"
}

参数

参数名字 描述
location_id
选填

根据位置界定的范围

Validations:

  • Must be a Integer

organization_id
选填

根据机构界定的范围

Validations:

  • Must be a Integer

name
必填

Validations:

  • Must be a String


POST /api/users/:user_id/table_preferences
为一个指定的表创建表偏好

示例

POST /api/users/135138680/table_preferences
{
  "name": "test_subscriptions_resource",
  "columns": [
    "1",
    "2",
    "3"
  ],
  "table_preference": {
    "name": "test_subscriptions_resource",
    "columns": [
      "1",
      "2",
      "3"
    ]
  }
}
201
{
  "id": 3,
  "name": "test_subscriptions_resource",
  "columns": [
    "1",
    "2",
    "3"
  ],
  "created_at": "2019-09-11 14:56:37 UTC",
  "updated_at": "2019-09-11 14:56:37 UTC"
}

参数

参数名字 描述
location_id
选填

根据位置界定的范围

Validations:

  • Must be a Integer

organization_id
选填

根据机构界定的范围

Validations:

  • Must be a Integer

table_preferences
必填

Validations:

  • Must be a Hash

table_preferences[name]
必填

表的名称

Validations:

  • Must be a String

table_preferences[columns]
选填

用户选择的栏目列表

Validations:

  • Must be an array of any type


PUT /api/users/:user_id/table_preferences/:name
为一个指定的表更新表偏好

示例

PUT /api/users/135138680/table_preferences/test_subscriptions_resource
{
  "columns": [
    "1",
    "2",
    "3"
  ],
  "table_preference": {
    "columns": [
      "1",
      "2",
      "3"
    ]
  }
}
200
{
  "id": 5,
  "name": "test_subscriptions_resource",
  "columns": [
    "1",
    "2",
    "3"
  ],
  "created_at": "2019-09-11 14:56:37 UTC",
  "updated_at": "2019-09-11 14:56:37 UTC"
}

参数

参数名字 描述
location_id
选填

根据位置界定的范围

Validations:

  • Must be a Integer

organization_id
选填

根据机构界定的范围

Validations:

  • Must be a Integer

table_preferences
必填

Validations:

  • Must be a Hash

table_preferences[name]
必填

表的名称

Validations:

  • Must be a String

table_preferences[columns]
选填

用户选择的栏目列表

Validations:

  • Must be an array of any type


DELETE /api/users/:user_id/table_preferences/:name
为一个指定的表删除表偏好

示例

DELETE /api/users/135138680/table_preferences/test_subscriptions_resource
{
  "table_preference": {}
}
200
{
  "id": 1,
  "name": "test_subscriptions_resource",
  "columns": [
    "1",
    "2",
    "3"
  ],
  "created_at": "2019-09-11 14:56:37 UTC",
  "updated_at": "2019-09-11 14:56:37 UTC"
}

参数

参数名字 描述
location_id
选填

根据位置界定的范围

Validations:

  • Must be a Integer

organization_id
选填

根据机构界定的范围

Validations:

  • Must be a Integer

name
必填

表的名称

Validations:

  • Must be a String