# 2024/3/28 Operation API 討論的初步規格 ## Login API 描述:登入 | Request Parameter | Datatype | Description | Required | Example | |-------------------|----------|-------------|----------|--------------| | account | string | 帳號 | Yes | Sean.chang | | password | string | 密碼 | Yes | Ed8rinqrnfqn | | Response Parameter | Datatype | Description | represented | Example | |--------------------|----------|----------------------------------------|----------|--------------------------------| | code | string | Error/status code returned | Always | OK | | message | string | Error/status message | Always | Request is carried out successfully | | admin_token | string | JWT token contains administrator information | If login success | aaaaabbbbbbbbbccccc | ## Logout API 描述:登出 | Request Parameter | Datatype | Description | Required | Example | |-------------------|----------|-------------|----------|---------| | Response Parameter | Datatype | Description | Required | Example | |--------------------|----------|-----------------|----------|--------------------| | code | string | 狀態碼 | Always | OK | | message | string | 操作訊息 | Always | Logout successful | ## GetAdminList API 描述:取得系統內所有管理員的列表 | Request Parameter | Datatype | Description | Required | Example | |-------------------|----------|-------------|----------|---------| | admin_token | - | - | - | - | keyword for search... | Response Parameter | Datatype | Description | Required | Example | |--------------------|----------|---------------------------------------------------|----------|----------------------------------------------| | admins | object array | 管理員資訊陣列,每個物件包含管理員的id、名稱等資訊 | Always | `[{"id": "1", "name": "Admin1"}, {"id": "2", "name": "Admin2"}]` | 這裡需要說明一下admin這個物件的規格(admin是object) ## ChangeAdminStatus API 描述:啟用或停用指定的管理員賬號 | Request Parameter | Datatype | Description | Required | Example | |-------------------|----------|-----------------------------------|----------|---------| | admin_id | string | 管理員ID | Yes | 1 | | status | boolean | 指定的新狀態,true為啟用,false為停用 | Yes | true | admin_token | Response Parameter | Datatype | Description | Required | Example | |--------------------|----------|-----------------|----------|------------------------| | code | string | 狀態碼 | Always | OK | | message | string | 操作訊息 | Always | Status changed successfully | ## GetLogHistory API 描述:獲取系統操作的日誌歷史 | Request Parameter | Datatype | Description | Required | Example | |-------------------|----------|-------------------------------|----------|---------| | admin_token keyword | Response Parameter | Datatype | Description | Required | Example | |--------------------|----------|---------------------------------------------------|----------|--------------------------------------------------------------| | logs | object array | 日誌條目陣列,每個物件包含日誌的詳細資訊 | Always | `[{"id": "1", "action": "Login", "date": "2024-03-28"}, {"id": "2", "action": "Logout", "date": "2024-03-28"}]` | object...?(包含log_id之類的…) ## ViewLog API 描述:查看指定日誌的詳細資訊 | Request Parameter | Datatype | Description | Required | Example | |-------------------|----------|-----------------------|----------|---------| | log_id | string | 要查看的日誌ID | Yes | 1 | admin_token | Response Parameter | Datatype | Description | Required | Example | |--------------------|----------|-----------------------------------------|----------|--------------------------------------------------------| | log | object | 包含日誌詳細資訊的物件,如操作者、操作時間、操作內容等 | Always | `{"id": "1", "action": "Login", "date": "2024-03-28", "details": "User login successful"}` |
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up