{
    "openapi": "3.0.0",
    "info": {
        "title": "二维码编码 - API文档",
        "version": "1.0.0",
        "description": "接口返回生成后的二维码图片base64，可以直接引用。如需解码请使用<a href=\"https:\/\/www.tianapi.com\/apiview\/41\" target=\"_blank\">二维码解码<\/a>接口，支持识别常见平台的二维码类型。"
    },
    "servers": [
        {
            "url": "https:\/\/apis.tianapi.com"
        }
    ],
    "paths": {
        "\/ewm\/index": {
            "get": {
                "summary": "二维码编码",
                "tags": [
                    "二维码编码"
                ],
                "description": "指定文本信息生成二维码图像",
                "parameters": [
                    {
                        "name": "el",
                        "in": "query",
                        "description": "纠错等级",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "L",
                            "description": "纠错等级"
                        }
                    },
                    {
                        "name": "in",
                        "in": "query",
                        "description": "二维码边距，最大100",
                        "required": false,
                        "schema": {
                            "type": "int",
                            "example": 2,
                            "description": "二维码边距，最大100"
                        }
                    },
                    {
                        "name": "ze",
                        "in": "query",
                        "description": "二维码大小，最大50",
                        "required": false,
                        "schema": {
                            "type": "int",
                            "example": 8,
                            "description": "二维码大小，最大50"
                        }
                    },
                    {
                        "name": "key",
                        "in": "query",
                        "description": "API密钥",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "description": "API密钥"
                        }
                    },
                    {
                        "name": "mode",
                        "in": "query",
                        "description": "输出模式，图片流=0，JSON=1",
                        "required": false,
                        "schema": {
                            "type": "int",
                            "example": 1,
                            "description": "输出模式，图片流=0，JSON=1"
                        }
                    },
                    {
                        "name": "text",
                        "in": "query",
                        "description": "需要编码的内容，最多500字符",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "天行数据是一个webapi平台",
                            "description": "需要编码的内容，最多500字符"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "成功响应",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "el": {
                                            "type": "string",
                                            "example": "L",
                                            "description": "容错等级，默认L"
                                        },
                                        "in": {
                                            "type": "int",
                                            "example": 2,
                                            "description": "边距，默认为2"
                                        },
                                        "ze": {
                                            "type": "int",
                                            "example": 8,
                                            "description": "二维码大小，默认为8"
                                        },
                                        "text": {
                                            "type": "string",
                                            "example": "data:image\/png;base64",
                                            "description": "二维码图片base64"
                                        }
                                    }
                                },
                                "example": {
                                    "msg": "success",
                                    "code": 200,
                                    "result": {
                                        "el": "L",
                                        "in": 2,
                                        "ze": 8,
                                        "text": "data:image\/png;base64"
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "summary": "二维码编码",
                "tags": [
                    "二维码编码"
                ],
                "description": "指定文本信息生成二维码图像",
                "requestBody": {
                    "content": {
                        "application\/x-www-form-urlencoded": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "el": {
                                        "type": "string",
                                        "example": "L",
                                        "description": "纠错等级"
                                    },
                                    "in": {
                                        "type": "int",
                                        "example": 2,
                                        "description": "二维码边距，最大100"
                                    },
                                    "ze": {
                                        "type": "int",
                                        "example": 8,
                                        "description": "二维码大小，最大50"
                                    },
                                    "key": {
                                        "type": "string",
                                        "description": "API密钥"
                                    },
                                    "mode": {
                                        "type": "int",
                                        "example": 1,
                                        "description": "输出模式，图片流=0，JSON=1"
                                    },
                                    "text": {
                                        "type": "string",
                                        "example": "天行数据是一个webapi平台",
                                        "description": "需要编码的内容，最多500字符"
                                    }
                                },
                                "required": [
                                    "key",
                                    "text"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "成功响应",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "el": {
                                            "type": "string",
                                            "example": "L",
                                            "description": "容错等级，默认L"
                                        },
                                        "in": {
                                            "type": "int",
                                            "example": 2,
                                            "description": "边距，默认为2"
                                        },
                                        "ze": {
                                            "type": "int",
                                            "example": 8,
                                            "description": "二维码大小，默认为8"
                                        },
                                        "text": {
                                            "type": "string",
                                            "example": "data:image\/png;base64",
                                            "description": "二维码图片base64"
                                        }
                                    }
                                },
                                "example": {
                                    "msg": "success",
                                    "code": 200,
                                    "result": {
                                        "el": "L",
                                        "in": 2,
                                        "ze": 8,
                                        "text": "data:image\/png;base64"
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}