{
    "openapi": "3.0.0",
    "info": {
        "title": "成语接龙 - API文档",
        "version": "1.0.0",
        "description": "<p>成语接龙接口，默认为用户开局。返回字段中包含成语拼音、解释、来源、首尾字符、积分、胜负结果和友好提示。其中字段result为胜负结果，0为开局、1为胜、2-4都是负（2开局负，3接错了，4非成语）、5为赢局（2-5都会退出游戏）<\/p>\n<p style=\"color:red\">请注意：userid参数应该是一个唯一识别码，例如用户的IMEI或openid等等。否则会把你的所有用户都当成一个人，导致数据混乱。<\/p>"
    },
    "servers": [
        {
            "url": "https:\/\/apis.tianapi.com"
        }
    ],
    "paths": {
        "\/chengyujielong\/index": {
            "get": {
                "summary": "成语接龙游戏",
                "tags": [
                    "成语接龙"
                ],
                "description": "成语接龙小游戏支持上下与关联和积分",
                "parameters": [
                    {
                        "name": "key",
                        "in": "query",
                        "description": "API密钥",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "description": "API密钥"
                        }
                    },
                    {
                        "name": "word",
                        "in": "query",
                        "description": "成语",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "一马当先",
                            "description": "成语"
                        }
                    },
                    {
                        "name": "userid",
                        "in": "query",
                        "description": "用户唯一识别码",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "98105401289c18d858c169578ecf0125",
                            "description": "用户唯一识别码"
                        }
                    },
                    {
                        "name": "statetime",
                        "in": "query",
                        "description": "状态维持时间，单位秒，默认1800",
                        "required": false,
                        "schema": {
                            "type": "int",
                            "example": "1800",
                            "description": "状态维持时间，单位秒，默认1800"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "成功响应",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "tip": {
                                            "type": "string",
                                            "example": "恭喜你答对了，系统奖励了你1分......",
                                            "description": "游戏提示"
                                        },
                                        "grade": {
                                            "type": "int",
                                            "example": 0,
                                            "description": "游戏积分"
                                        },
                                        "chuchu": {
                                            "type": "string",
                                            "example": "明·施耐庵《水浒传》第九十六回：即便勒兵列阵，一马当先......",
                                            "description": "成语出处"
                                        },
                                        "endstr": {
                                            "type": "string",
                                            "example": "先",
                                            "description": "成语末尾汉字"
                                        },
                                        "jieshi": {
                                            "type": "string",
                                            "example": "原指作战时策马冲锋在前。形容领先。也比喻工作走在群众前面，积极带头。",
                                            "description": "成语解释"
                                        },
                                        "pinyin": {
                                            "type": "string",
                                            "example": "yī mǎ dāng xiān",
                                            "description": "成语拼音"
                                        },
                                        "result": {
                                            "type": "int",
                                            "example": 0,
                                            "description": "胜负结果，0为开局、1为胜、2-4都是负、5为赢局（2-5都会退出游戏）"
                                        },
                                        "chengyu": {
                                            "type": "string",
                                            "example": "一马当先",
                                            "description": "成语"
                                        },
                                        "startstr": {
                                            "type": "string",
                                            "example": "一",
                                            "description": "成语开头汉字"
                                        }
                                    }
                                },
                                "example": {
                                    "msg": "success",
                                    "code": 200,
                                    "result": {
                                        "tip": "已进入成语接龙模式：先见之明",
                                        "grade": 0,
                                        "chuchu": "《后汉书·杨彪传》：愧无日磾先见之明，犹怀老牛舐犊之爱。",
                                        "endstr": "明",
                                        "jieshi": "明·指眼力。事先看清问题的能力。指对事物发展的预见性。",
                                        "pinyin": "xiān jiàn zhī míng",
                                        "result": 0,
                                        "chengyu": "先见之明",
                                        "startstr": "先"
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "summary": "成语接龙游戏",
                "tags": [
                    "成语接龙"
                ],
                "description": "成语接龙小游戏支持上下与关联和积分",
                "requestBody": {
                    "content": {
                        "application\/x-www-form-urlencoded": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "key": {
                                        "type": "string",
                                        "description": "API密钥"
                                    },
                                    "word": {
                                        "type": "string",
                                        "example": "一马当先",
                                        "description": "成语"
                                    },
                                    "userid": {
                                        "type": "string",
                                        "example": "98105401289c18d858c169578ecf0125",
                                        "description": "用户唯一识别码"
                                    },
                                    "statetime": {
                                        "type": "int",
                                        "example": "1800",
                                        "description": "状态维持时间，单位秒，默认1800"
                                    }
                                },
                                "required": [
                                    "key",
                                    "word",
                                    "userid"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "成功响应",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "tip": {
                                            "type": "string",
                                            "example": "恭喜你答对了，系统奖励了你1分......",
                                            "description": "游戏提示"
                                        },
                                        "grade": {
                                            "type": "int",
                                            "example": 0,
                                            "description": "游戏积分"
                                        },
                                        "chuchu": {
                                            "type": "string",
                                            "example": "明·施耐庵《水浒传》第九十六回：即便勒兵列阵，一马当先......",
                                            "description": "成语出处"
                                        },
                                        "endstr": {
                                            "type": "string",
                                            "example": "先",
                                            "description": "成语末尾汉字"
                                        },
                                        "jieshi": {
                                            "type": "string",
                                            "example": "原指作战时策马冲锋在前。形容领先。也比喻工作走在群众前面，积极带头。",
                                            "description": "成语解释"
                                        },
                                        "pinyin": {
                                            "type": "string",
                                            "example": "yī mǎ dāng xiān",
                                            "description": "成语拼音"
                                        },
                                        "result": {
                                            "type": "int",
                                            "example": 0,
                                            "description": "胜负结果，0为开局、1为胜、2-4都是负、5为赢局（2-5都会退出游戏）"
                                        },
                                        "chengyu": {
                                            "type": "string",
                                            "example": "一马当先",
                                            "description": "成语"
                                        },
                                        "startstr": {
                                            "type": "string",
                                            "example": "一",
                                            "description": "成语开头汉字"
                                        }
                                    }
                                },
                                "example": {
                                    "msg": "success",
                                    "code": 200,
                                    "result": {
                                        "tip": "已进入成语接龙模式：先见之明",
                                        "grade": 0,
                                        "chuchu": "《后汉书·杨彪传》：愧无日磾先见之明，犹怀老牛舐犊之爱。",
                                        "endstr": "明",
                                        "jieshi": "明·指眼力。事先看清问题的能力。指对事物发展的预见性。",
                                        "pinyin": "xiān jiàn zhī míng",
                                        "result": 0,
                                        "chengyu": "先见之明",
                                        "startstr": "先"
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}