app-cloudep-portal-api-gateway/gateway.json

815 lines
19 KiB
JSON
Raw Permalink Normal View History

2024-08-25 07:08:49 +00:00
{
"swagger": "2.0",
"info": {
"title": "",
"version": ""
},
"host": "dev-api.30cm.net",
"schemes": [
"http",
"https"
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"paths": {
"/api/v1/member": {
"post": {
"summary": "創建新會員",
"description": "創建一個全新的帳號",
"operationId": "createAccount",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/CreateAccountResp"
}
},
"400": {
"description": "輸入的參數錯誤",
"schema": {
"$ref": "#/definitions/BaseResponse"
}
},
"500": {
"description": "伺服器出錯",
"schema": {
"$ref": "#/definitions/BaseResponse"
}
}
},
"parameters": [
2024-08-27 07:40:00 +00:00
{
"name": "device_id",
"in": "header",
"required": true,
"type": "string"
},
{
"name": "ip_address",
"in": "header",
"required": true,
"type": "string"
},
{
"name": "brewser",
"in": "header",
"required": true,
"type": "string"
},
2024-08-25 07:08:49 +00:00
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/CreateAccountRequest"
}
}
],
"tags": [
"gateway/member"
]
}
},
"/api/v1/member/check-verify-code": {
"get": {
"summary": "確認驗證碼是否有效",
"description": "確認驗證碼是否有效",
"operationId": "CheckVerifyCode",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/BaseResponse"
}
},
"400": {
"description": "輸入的參數錯誤",
"schema": {
"$ref": "#/definitions/BaseResponse"
}
},
"403": {
"description": "無效的驗證碼",
"schema": {
"$ref": "#/definitions/BaseResponse"
}
},
"500": {
"description": "伺服器出錯",
"schema": {
"$ref": "#/definitions/BaseResponse"
}
}
},
"parameters": [
{
"name": "account",
"description": "帳號名稱",
"in": "query",
"required": true,
"type": "string"
},
{
"name": "verify_code",
"description": "驗證碼長度為6",
"in": "query",
"required": true,
"type": "string"
}
],
"tags": [
"gateway/member"
]
}
},
"/api/v1/member/forget-password-code": {
"post": {
"summary": "發送忘記密碼驗證",
"description": "發送忘記密碼驗證(三分鐘內只能發一次信)",
2024-08-27 07:40:00 +00:00
"operationId": "ForgetPasswordCode",
2024-08-25 07:08:49 +00:00
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/BaseResponse"
}
},
"400": {
"description": "輸入的參數錯誤",
"schema": {
"$ref": "#/definitions/BaseResponse"
}
},
"500": {
"description": "伺服器出錯",
"schema": {
"$ref": "#/definitions/BaseResponse"
}
}
},
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/ForgetPasswordCodeReq"
}
}
],
"tags": [
"gateway/member"
]
}
},
"/api/v1/member/info": {
"get": {
"summary": "取得會員資訊",
"operationId": "Info",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/UserInfoResp"
}
},
"400": {
"description": "輸入的參數錯誤",
"schema": {
"$ref": "#/definitions/BaseResponse"
}
},
"403": {
"description": "無效的Token",
"schema": {
"$ref": "#/definitions/BaseResponse"
}
},
"500": {
"description": "伺服器出錯",
"schema": {
"$ref": "#/definitions/BaseResponse"
}
}
},
"parameters": [
{
"name": "token",
"in": "header",
"required": true,
"type": "string"
}
],
"tags": [
"gateway/member"
]
}
},
"/api/v1/member/login": {
"post": {
"summary": "登入",
"description": "會員登入",
"operationId": "Login",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/LoginResp"
}
},
"400": {
"description": "輸入的參數錯誤",
"schema": {
"$ref": "#/definitions/BaseResponse"
}
},
"500": {
"description": "伺服器出錯",
"schema": {
"$ref": "#/definitions/BaseResponse"
}
}
},
"parameters": [
2024-08-27 07:40:00 +00:00
{
"name": "device_id",
"in": "header",
"required": true,
"type": "string"
},
{
"name": "ip_address",
"in": "header",
"required": true,
"type": "string"
},
{
"name": "brewser",
"in": "header",
"required": true,
"type": "string"
},
2024-08-25 07:08:49 +00:00
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/LoginReq"
}
}
],
"tags": [
"gateway/member"
]
}
},
"/api/v1/member/logout": {
"get": {
"summary": "會員登出",
"operationId": "Logout",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/BaseResponse"
}
},
"400": {
"description": "輸入的參數錯誤",
"schema": {
"$ref": "#/definitions/BaseResponse"
}
},
"403": {
"description": "無效的Token",
"schema": {
"$ref": "#/definitions/BaseResponse"
}
},
"500": {
"description": "伺服器出錯",
"schema": {
"$ref": "#/definitions/BaseResponse"
}
}
},
"parameters": [
{
2024-08-27 07:40:00 +00:00
"name": "token",
"in": "header",
"required": true,
"type": "string"
}
],
"tags": [
"gateway/member"
]
}
},
"/api/v1/member/refresh_access_token": {
"put": {
"summary": "更新Token",
"description": "用 RefreshToken 換取 AccessToken",
"operationId": "RefreshAccessToken",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/LoginResp"
}
},
"400": {
"description": "輸入的參數錯誤",
"schema": {
"$ref": "#/definitions/BaseResponse"
}
},
"403": {
"description": "無效的驗證碼",
"schema": {
"$ref": "#/definitions/BaseResponse"
}
},
"500": {
"description": "伺服器出錯",
"schema": {
"$ref": "#/definitions/BaseResponse"
}
}
},
"parameters": [
{
"name": "device_id",
2024-08-25 07:08:49 +00:00
"in": "header",
"required": true,
"type": "string"
},
{
2024-08-27 07:40:00 +00:00
"name": "ip_address",
"in": "header",
"required": true,
"type": "string"
},
{
"name": "brewser",
2024-08-25 07:08:49 +00:00
"in": "header",
"required": true,
"type": "string"
2024-08-27 07:40:00 +00:00
},
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/UpdateTokenReq"
}
2024-08-25 07:08:49 +00:00
}
],
"tags": [
"gateway/member"
]
}
},
"/api/v1/member/update-password": {
"put": {
"summary": "更新密碼",
"description": "更新密碼",
"operationId": "UpadtePassword",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/BaseResponse"
}
},
"400": {
"description": "輸入的參數錯誤",
"schema": {
"$ref": "#/definitions/BaseResponse"
}
},
"403": {
"description": "無效的驗證碼",
"schema": {
"$ref": "#/definitions/BaseResponse"
}
},
"500": {
"description": "伺服器出錯",
"schema": {
"$ref": "#/definitions/BaseResponse"
}
}
},
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/UpdatePasswordReq"
}
}
],
"tags": [
"gateway/member"
]
}
}
},
"definitions": {
"BaseResponse": {
"type": "object",
"properties": {
"status": {
"$ref": "#/definitions/Status",
"description": "狀態"
}
},
"title": "BaseResponse",
"required": [
"status"
]
},
"CheckoutVerifyReq": {
"type": "object",
"properties": {
"account": {
"type": "string",
"description": "帳號名稱"
},
"verify_code": {
"type": "string",
"description": "驗證碼長度為6"
}
},
"title": "CheckoutVerifyReq",
"required": [
"account",
"verify_code"
]
},
"CreateAccountItem": {
"type": "object",
"properties": {
"uid": {
"type": "string",
"description": "使用者UID"
2024-08-26 06:36:58 +00:00
},
"access_token": {
"type": "string",
"description": "訪問令牌 預設 5 分鐘過期"
},
"refresh_token": {
"type": "string",
"description": "刷新令牌 (預設一天過期,只能用一次)當呼叫更新token api 時,會自動把舊的失效,變成新的 refresh_token ,前端要記得過其實協助刷新,刷新不過表示全失效了(重新登入)"
},
"token_type": {
"type": "string",
"description": "Bearer"
2024-08-25 07:08:49 +00:00
}
},
"title": "CreateAccountItem",
"required": [
2024-08-26 06:36:58 +00:00
"uid",
"access_token",
"refresh_token",
"token_type"
2024-08-25 07:08:49 +00:00
]
},
"CreateAccountRequest": {
"type": "object",
"properties": {
"account": {
"type": "string",
"description": "帳號名稱"
},
"token": {
"type": "string",
"description": "密碼或平台token密碼請 sha256 轉碼"
},
"token_check": {
"type": "string",
"description": "密碼或平台token密碼請 sha256 轉碼"
},
"platform": {
"type": "string",
"enum": [
"digimon",
"google",
"twitter"
],
"description": "平台名稱 digimon, google, twitter"
},
"account_type": {
2024-08-27 07:40:00 +00:00
"type": "integer",
"format": "int64",
2024-08-25 07:08:49 +00:00
"enum": [
"1",
"2",
"3"
],
2024-08-27 07:40:00 +00:00
"description": "帳號類型 1 手機 2 信箱 3 自定義帳號"
2024-08-25 07:08:49 +00:00
}
},
"title": "CreateAccountRequest",
"required": [
"account",
"token",
"token_check",
"platform",
"account_type"
]
},
"CreateAccountResp": {
"type": "object",
"properties": {
"status": {
"$ref": "#/definitions/Status",
"description": "狀態"
},
"data": {
"$ref": "#/definitions/CreateAccountItem"
}
},
"title": "CreateAccountResp",
"required": [
"status",
"data"
]
},
"ForgetPasswordCodeReq": {
"type": "object",
"properties": {
"account": {
"type": "string",
"description": "帳號名稱"
},
"account_type": {
2024-08-27 07:40:00 +00:00
"type": "integer",
"format": "int32",
2024-08-25 07:08:49 +00:00
"enum": [
"1",
"2",
"3"
],
2024-08-27 07:40:00 +00:00
"description": "帳號類型 1 手機 2 信箱 3 自定義帳號"
2024-08-25 07:08:49 +00:00
}
},
"title": "ForgetPasswordCodeReq",
"required": [
"account",
"account_type"
]
},
2024-08-27 07:40:00 +00:00
"GetMemberHeader": {
"type": "object",
"properties": {},
"title": "GetMemberHeader"
},
2024-08-25 07:08:49 +00:00
"Header": {
"type": "object",
"properties": {},
"title": "Header"
},
"LoginItem": {
"type": "object",
"properties": {
2024-08-27 07:40:00 +00:00
"uid": {
"type": "string",
"description": "Account"
},
2024-08-25 07:08:49 +00:00
"access_token": {
"type": "string",
"description": "訪問令牌 預設 5 分鐘過期"
},
"refresh_token": {
"type": "string",
"description": "刷新令牌 (預設一天過期,只能用一次)當呼叫更新token api 時,會自動把舊的失效,變成新的 refresh_token ,前端要記得過其實協助刷新,刷新不過表示全失效了(重新登入)"
},
"token_type": {
"type": "string",
"description": "Bearer"
}
},
"title": "LoginItem",
"required": [
2024-08-27 07:40:00 +00:00
"uid",
2024-08-25 07:08:49 +00:00
"access_token",
"refresh_token",
"token_type"
]
},
"LoginReq": {
"type": "object",
"properties": {
"account": {
"type": "string",
"description": "帳號名稱"
},
"token": {
"type": "string",
"description": "密碼或平台token密碼請 sha256 轉碼"
},
"platform": {
"type": "string",
"enum": [
"digimon",
"google",
"twitter"
],
"description": "平台名稱 digimon, google, twitter"
},
"account_type": {
2024-08-27 07:40:00 +00:00
"type": "integer",
"format": "int64",
2024-08-25 07:08:49 +00:00
"enum": [
"1",
"2",
"3"
],
2024-08-27 07:40:00 +00:00
"description": "帳號類型 1 手機 2 信箱 3 自定義帳號"
2024-08-25 07:08:49 +00:00
}
},
"title": "LoginReq",
"required": [
"account",
"token",
"platform",
"account_type"
]
},
"LoginResp": {
"type": "object",
"properties": {
"status": {
"$ref": "#/definitions/Status",
"description": "狀態"
},
"data": {
"$ref": "#/definitions/LoginItem"
}
},
"title": "LoginResp",
"required": [
"status",
"data"
]
},
2024-08-27 07:40:00 +00:00
"MemberLoginHeader": {
"type": "object",
"properties": {},
"title": "MemberLoginHeader"
},
2024-08-25 07:08:49 +00:00
"Status": {
"type": "object",
"properties": {
"code": {
"type": "integer",
"format": "int64",
"description": "狀態碼"
},
"message": {
"type": "string",
"description": "訊息"
},
"data": {
"type": "object",
"description": "可選的數據,當有返回時才出現"
},
"error": {
"type": "object",
"description": "可選的錯誤信息"
}
},
"title": "Status",
"required": [
"code",
"message"
]
},
"UpdatePasswordReq": {
"type": "object",
"properties": {
"account": {
"type": "string",
"description": "帳號名稱"
},
"verify_code": {
"type": "string",
"description": "驗證碼長度為6"
},
"token": {
"type": "string",
"description": "密碼或平台token密碼請 sha256 轉碼"
},
"token_check": {
"type": "string",
"description": "密碼或平台token密碼請 sha256 轉碼"
}
},
"title": "UpdatePasswordReq",
"required": [
"account",
"verify_code",
"token",
"token_check"
]
},
2024-08-27 07:40:00 +00:00
"UpdateTokenReq": {
"type": "object",
"properties": {
"uid": {
"type": "string",
"description": "uid"
},
"token": {
"type": "string",
"description": "refresh token"
}
},
"title": "UpdateTokenReq",
"required": [
"uid",
"token"
]
},
2024-08-25 07:08:49 +00:00
"UserInfo": {
"type": "object",
2024-08-27 07:40:00 +00:00
"properties": {
"uid": {
"type": "string"
},
"verify_type": {
"type": "string"
},
"alarm_type": {
"type": "string"
},
"status": {
"type": "string"
},
"language": {
"type": "string"
},
"currency": {
"type": "string"
},
"avatar": {
"type": "string"
},
"curreate_time": {
"type": "string"
},
"update_time": {
"type": "string"
},
"nick_name": {
"type": "string"
}
},
"title": "UserInfo",
"required": [
"uid",
"verify_type",
"alarm_type",
"status",
"language",
"currency",
"avatar",
"curreate_time",
"update_time"
]
2024-08-25 07:08:49 +00:00
},
"UserInfoResp": {
"type": "object",
"properties": {
"status": {
"$ref": "#/definitions/Status",
"description": "狀態"
},
"data": {
"$ref": "#/definitions/UserInfo"
}
},
"title": "UserInfoResp",
"required": [
"status",
"data"
]
}
},
"securityDefinitions": {
"apiKey": {
"type": "apiKey",
"description": "Enter JWT Bearer token **_only_**",
"name": "Authorization",
"in": "header"
}
}
}