{
    "openapi": "3.0.0",
    "info": {
        "title": "故事大全 - API文档",
        "version": "1.0.0",
        "description": "返回成语故事、童话故事、寓言故事、睡前故事、民间故事。type可以指定故事类型，不传参数情况下，每30秒更新一个故事。"
    },
    "servers": [
        {
            "url": "https:\/\/apis.tianapi.com"
        }
    ],
    "paths": {
        "\/story\/index": {
            "get": {
                "summary": "故事查询",
                "tags": [
                    "故事大全"
                ],
                "description": "故事查询支持翻页和关键词搜索",
                "parameters": [
                    {
                        "name": "key",
                        "in": "query",
                        "description": "API密钥",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "description": "API密钥"
                        }
                    },
                    {
                        "name": "num",
                        "in": "query",
                        "description": "返回数量",
                        "required": false,
                        "schema": {
                            "type": "int",
                            "example": 5,
                            "description": "返回数量"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "description": "翻页",
                        "required": false,
                        "schema": {
                            "type": "int",
                            "example": 1,
                            "description": "翻页"
                        }
                    },
                    {
                        "name": "type",
                        "in": "query",
                        "description": "故事类型，成语1、睡前2、童话3、寓言4",
                        "required": false,
                        "schema": {
                            "type": "int",
                            "example": 4,
                            "description": "故事类型，成语1、睡前2、童话3、寓言4"
                        }
                    },
                    {
                        "name": "word",
                        "in": "query",
                        "description": "故事标题（支持模糊搜索）",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "乌鸦喝水",
                            "description": "故事标题（支持模糊搜索）"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "成功响应",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "title": {
                                            "type": "string",
                                            "example": "乌鸦喝水",
                                            "description": "故事标题"
                                        },
                                        "content": {
                                            "type": "string",
                                            "example": "有一天，乌鸦准备去参加一个世界动物大会。乌鸦飞呀飞呀，后来乌鸦口渴难忍了......",
                                            "description": "故事内容"
                                        },
                                        "storytype": {
                                            "type": "int",
                                            "example": 4,
                                            "description": "故事类型，成语1、睡前2、童话3、寓言4"
                                        }
                                    }
                                },
                                "example": {
                                    "msg": "success",
                                    "code": 200,
                                    "result": {
                                        "list": [
                                            {
                                                "title": "乌鸦与兔子",
                                                "content": "乌鸦站在高大的树枝上，整天无所事事，悠哉游哉好不快活。一只小兔子看见了，心中非常羡慕，就问乌鸦：“乌鸦大哥，你这么自在逍遥，真好呀，我能不能跟你一样，也整天呆着不做事？”乌鸦回答：“当然行，为什么不呢...",
                                                "storytype": 4
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "summary": "故事查询",
                "tags": [
                    "故事大全"
                ],
                "description": "故事查询支持翻页和关键词搜索",
                "requestBody": {
                    "content": {
                        "application\/x-www-form-urlencoded": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "key": {
                                        "type": "string",
                                        "description": "API密钥"
                                    },
                                    "num": {
                                        "type": "int",
                                        "example": 5,
                                        "description": "返回数量"
                                    },
                                    "page": {
                                        "type": "int",
                                        "example": 1,
                                        "description": "翻页"
                                    },
                                    "type": {
                                        "type": "int",
                                        "example": 4,
                                        "description": "故事类型，成语1、睡前2、童话3、寓言4"
                                    },
                                    "word": {
                                        "type": "string",
                                        "example": "乌鸦喝水",
                                        "description": "故事标题（支持模糊搜索）"
                                    }
                                },
                                "required": [
                                    "key"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "成功响应",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "title": {
                                            "type": "string",
                                            "example": "乌鸦喝水",
                                            "description": "故事标题"
                                        },
                                        "content": {
                                            "type": "string",
                                            "example": "有一天，乌鸦准备去参加一个世界动物大会。乌鸦飞呀飞呀，后来乌鸦口渴难忍了......",
                                            "description": "故事内容"
                                        },
                                        "storytype": {
                                            "type": "int",
                                            "example": 4,
                                            "description": "故事类型，成语1、睡前2、童话3、寓言4"
                                        }
                                    }
                                },
                                "example": {
                                    "msg": "success",
                                    "code": 200,
                                    "result": {
                                        "list": [
                                            {
                                                "title": "乌鸦与兔子",
                                                "content": "乌鸦站在高大的树枝上，整天无所事事，悠哉游哉好不快活。一只小兔子看见了，心中非常羡慕，就问乌鸦：“乌鸦大哥，你这么自在逍遥，真好呀，我能不能跟你一样，也整天呆着不做事？”乌鸦回答：“当然行，为什么不呢...",
                                                "storytype": 4
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}