{
    "openapi": "3.0.0",
    "info": {
        "title": "天气诗句 - API文档",
        "version": "1.0.0",
        "description": "描写天气的唯美诗句API接口，不同的天气配合应景有意境的诗句。可以和天气类应用配合使用，或者生成天气海报，增加用户分享的概率。默认为随机，可以通过参数tqtype指定天气类型。返回字段中tqtype表示适合的天气类型，1=风、2=云、3=雨、4=雪、5=霜、6=露 、7=雾、8=雷、9=晴、10=阴。"
    },
    "servers": [
        {
            "url": "https:\/\/apis.tianapi.com"
        }
    ],
    "paths": {
        "\/tianqishiju\/index": {
            "get": {
                "summary": "天气诗句查询",
                "tags": [
                    "天气诗句"
                ],
                "description": "根据天气类型查询对应的古诗名句",
                "parameters": [
                    {
                        "name": "key",
                        "in": "query",
                        "description": "API密钥",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "description": "API密钥"
                        }
                    },
                    {
                        "name": "tqtype",
                        "in": "query",
                        "description": "天气类型",
                        "required": false,
                        "schema": {
                            "type": "int",
                            "example": 1,
                            "description": "天气类型"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "成功响应",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "author": {
                                            "type": "string",
                                            "example": "刘禹锡",
                                            "description": "作者"
                                        },
                                        "source": {
                                            "type": "string",
                                            "example": "竹枝词",
                                            "description": "来源"
                                        },
                                        "tqtype": {
                                            "type": "int",
                                            "example": 3,
                                            "description": "适合的天气类型"
                                        },
                                        "content": {
                                            "type": "string",
                                            "example": "东边日出西边雨，道是无晴却有晴",
                                            "description": "内容"
                                        }
                                    }
                                },
                                "example": {
                                    "msg": "success",
                                    "code": 200,
                                    "result": {
                                        "author": "刘禹锡",
                                        "source": "竹枝词",
                                        "tqtype": 3,
                                        "content": "东边日出西边雨，道是无晴却有晴"
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "summary": "天气诗句查询",
                "tags": [
                    "天气诗句"
                ],
                "description": "根据天气类型查询对应的古诗名句",
                "requestBody": {
                    "content": {
                        "application\/x-www-form-urlencoded": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "key": {
                                        "type": "string",
                                        "description": "API密钥"
                                    },
                                    "tqtype": {
                                        "type": "int",
                                        "example": 1,
                                        "description": "天气类型"
                                    }
                                },
                                "required": [
                                    "key"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "成功响应",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "author": {
                                            "type": "string",
                                            "example": "刘禹锡",
                                            "description": "作者"
                                        },
                                        "source": {
                                            "type": "string",
                                            "example": "竹枝词",
                                            "description": "来源"
                                        },
                                        "tqtype": {
                                            "type": "int",
                                            "example": 3,
                                            "description": "适合的天气类型"
                                        },
                                        "content": {
                                            "type": "string",
                                            "example": "东边日出西边雨，道是无晴却有晴",
                                            "description": "内容"
                                        }
                                    }
                                },
                                "example": {
                                    "msg": "success",
                                    "code": 200,
                                    "result": {
                                        "author": "刘禹锡",
                                        "source": "竹枝词",
                                        "tqtype": 3,
                                        "content": "东边日出西边雨，道是无晴却有晴"
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}