634 lines
15 KiB
JSON
634 lines
15 KiB
JSON
|
{
|
|||
|
"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": [
|
|||
|
{
|
|||
|
"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": "發送忘記密碼驗證(三分鐘內只能發一次信)",
|
|||
|
"operationId": "ForgetPassworCode",
|
|||
|
"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": "uid",
|
|||
|
"in": "header",
|
|||
|
"required": true,
|
|||
|
"type": "string"
|
|||
|
},
|
|||
|
{
|
|||
|
"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": [
|
|||
|
{
|
|||
|
"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": [
|
|||
|
{
|
|||
|
"name": "uid",
|
|||
|
"in": "header",
|
|||
|
"required": true,
|
|||
|
"type": "string"
|
|||
|
},
|
|||
|
{
|
|||
|
"name": "token",
|
|||
|
"in": "header",
|
|||
|
"required": true,
|
|||
|
"type": "string"
|
|||
|
}
|
|||
|
],
|
|||
|
"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"
|
|||
|
}
|
|||
|
},
|
|||
|
"title": "CreateAccountItem",
|
|||
|
"required": [
|
|||
|
"uid"
|
|||
|
]
|
|||
|
},
|
|||
|
"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": {
|
|||
|
"type": "string",
|
|||
|
"enum": [
|
|||
|
"1",
|
|||
|
"2",
|
|||
|
"3"
|
|||
|
],
|
|||
|
"description": "帳號類型 1 Email 2. 台灣手機 3. 任意"
|
|||
|
}
|
|||
|
},
|
|||
|
"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": {
|
|||
|
"type": "string",
|
|||
|
"enum": [
|
|||
|
"1",
|
|||
|
"2",
|
|||
|
"3"
|
|||
|
],
|
|||
|
"description": "帳號類型 1 Email 2. 台灣手機 3. 任意"
|
|||
|
}
|
|||
|
},
|
|||
|
"title": "ForgetPasswordCodeReq",
|
|||
|
"required": [
|
|||
|
"account",
|
|||
|
"account_type"
|
|||
|
]
|
|||
|
},
|
|||
|
"Header": {
|
|||
|
"type": "object",
|
|||
|
"properties": {},
|
|||
|
"title": "Header"
|
|||
|
},
|
|||
|
"LoginItem": {
|
|||
|
"type": "object",
|
|||
|
"properties": {
|
|||
|
"access_token": {
|
|||
|
"type": "string",
|
|||
|
"description": "訪問令牌 預設 5 分鐘過期"
|
|||
|
},
|
|||
|
"refresh_token": {
|
|||
|
"type": "string",
|
|||
|
"description": "刷新令牌 (預設一天過期,只能用一次),當呼叫更新token api 時,會自動把舊的失效,變成新的 refresh_token ,前端要記得過其實協助刷新,刷新不過表示全失效了(重新登入)"
|
|||
|
},
|
|||
|
"token_type": {
|
|||
|
"type": "string",
|
|||
|
"description": "Bearer"
|
|||
|
}
|
|||
|
},
|
|||
|
"title": "LoginItem",
|
|||
|
"required": [
|
|||
|
"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": {
|
|||
|
"type": "string",
|
|||
|
"enum": [
|
|||
|
"1",
|
|||
|
"2",
|
|||
|
"3"
|
|||
|
],
|
|||
|
"description": "帳號類型 1 Email 2. 台灣手機 3. 任意"
|
|||
|
}
|
|||
|
},
|
|||
|
"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"
|
|||
|
]
|
|||
|
},
|
|||
|
"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"
|
|||
|
]
|
|||
|
},
|
|||
|
"UserInfo": {
|
|||
|
"type": "object",
|
|||
|
"properties": {},
|
|||
|
"title": "UserInfo"
|
|||
|
},
|
|||
|
"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"
|
|||
|
}
|
|||
|
}
|
|||
|
}
|