core-documentation

Act Feature

List act features

GET /console/lab/act_features

Auth

Paging

YES

Available query parameters

Key Type Description Match Example
st integer: specific topic ID 用關聯小議題過濾法案比較清單 exact 1 2
act integer: act ID 用關聯法案過濾法案比較清單 exact 1 2
act_dir integer: act dir ID 用關聯修法方向過濾法案比較清單 exact 1 2

Response

{
  rows: [
    {
      id
      st: {
        id
        title
        image
        index
      }
      act: {
        id
        title
        official_seq_no
      }
      act_dir: {
        id
        name
      }
      feature
      dir
    }
    ...
  ]
  totalRowCount
  paging: {
    pages
    pageSize
    previous
    next
    page
  }
}

Get a single act feature

GET /console/lab/act_features/:id

Auth

Paging

NO

Response

{
  id
  st: {
    id
    title
    image
    index
  }
  act: {
    id
    title
    official_seq_no
  }
  act_dir: {
    id
    name
  }
  feature
  dir
  content
  scale_score_max
  scale: [
    {
      score
      description
    }
    ...
  ]
}

Create an act feature

POST /console/lab/act_features

Auth

Paging

NO

Input

Key Type Required Description
st integer 🌕 小議題 ID
act integer 🌕 法案 ID
act_dir integer 🌕 修法方向 ID
feature string 🌕 法案比較名稱
dir string 🌕 法案比較價值判斷
content string 🌕 內容說明
scale_score_max integer 🌕 量尺分數最大值
scale [1] array of object 🌕 量尺

[1]

Key Type Required Description
score integer 🌕 分數
description string 🌕 敘述

Sample input

{
  "st": 1,
  "act": 2,
  "act_dir": 4,
  "feature": "提案門檻",
  "dir": "降低提案門檻",
  "content": "Lorem ipsum.",
  "scale_score_max": 5,
  "scale": [
    {
      "score": 1,
      "description": "0.5%"
    },
    {
      "score": 2,
      "description": "0.1%"
    },
    {
      "score": 3,
      "description": "0.05%"
    },
    {
      "score": 4,
      "description": "100人"
    },
    {
      "score": 5,
      "description": "刪除門檻"
    }
  ]
}

Response

Returns the newly created act feature

Update an act feature

PATCH /console/lab/act_features/:id

Auth

Paging

NO

參考 Create an act feature

Delete an act feature

DELETE /console/lab/act_features/:id

Auth

Paging

NO

Response

204 No Content