{
    "openapi": "3.0.0",
    "info": {
        "title": "生成小程序 - API文档",
        "version": "1.0.0",
        "description": "<p>此接口可一键生成打包天行数据的接口模板小程序，并返回文件地址，方便下载学习使用。目前已支持平台70%以上的接口。下载解压后导入到开发者工具即可使用，无需其他操作。如有问题或更多UI模板，请及时反馈适配或定制开发。<\/p>\n<p>打包功能主要为了方便不太了解小程序开发的朋友，系统自动根据默认参数和一定的规则生成完整的小程序应用源码包。下载后可根据源码中的注释说明，和已有功能自行对照增添删改。代码中的请求域名和密钥key都已经在util.js文件中定义好了，如无必要请忽修改。\n<p>天行数据接口ID如何获得？1，在接口文档页logo图左下的数字ID。2，在<a href=\"https:\/\/www.tianapi.com\/openapilist.html\" target=\"_blank\">接口列表<\/a>页可查看所有接口文档url，末尾数字即为接口ID。<\/p>"
    },
    "servers": [
        {
            "url": "https:\/\/apis.tianapi.com"
        }
    ],
    "paths": {
        "\/packapp\/index": {
            "get": {
                "summary": "生成小程序",
                "tags": [
                    "生成小程序"
                ],
                "description": "根据接口ID生成微信或百度小程序源码",
                "parameters": [
                    {
                        "name": "key",
                        "in": "query",
                        "description": "API密钥",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "description": "API密钥"
                        }
                    },
                    {
                        "name": "apiid",
                        "in": "query",
                        "description": "天行数据平台的接口（接口ID、英文、中文均可）",
                        "required": true,
                        "schema": {
                            "type": "int",
                            "example": 80,
                            "description": "天行数据平台的接口（接口ID、英文、中文均可）"
                        }
                    },
                    {
                        "name": "app_name",
                        "in": "query",
                        "description": "小程序名称，为空时默认接口名",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "example": "我的土味情话小程序",
                            "description": "小程序名称，为空时默认接口名"
                        }
                    },
                    {
                        "name": "app_type",
                        "in": "query",
                        "description": "打包小程序类型，0微信小程序、1百度小程序",
                        "required": false,
                        "schema": {
                            "type": "int",
                            "example": 0,
                            "description": "打包小程序类型，0微信小程序、1百度小程序"
                        }
                    },
                    {
                        "name": "app_apikey",
                        "in": "query",
                        "description": "小程序中的接口密钥apikey，为空时默认自己的API密钥",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "description": "小程序中的接口密钥apikey，为空时默认自己的API密钥"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "成功响应",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "apiid": {
                                            "type": "int",
                                            "example": 79,
                                            "description": "天行数据平台的接口ID"
                                        },
                                        "apiname": {
                                            "type": "string",
                                            "example": "互联网资讯",
                                            "description": "天行数据平台的接口名称"
                                        },
                                        "appname": {
                                            "type": "string",
                                            "example": "互联网资讯小程序",
                                            "description": "自定义的小程序名称"
                                        },
                                        "apptype": {
                                            "type": "int",
                                            "example": 0,
                                            "description": "打包小程序类型，0微信小程序、1百度小程序"
                                        },
                                        "fileurl": {
                                            "type": "string",
                                            "example": "http:\/\/pack.tianapi.com\/packwxapp\/packfile\/internet_15736169047481.zip",
                                            "description": "打包文件的下载地址"
                                        },
                                        "packtime": {
                                            "type": "string",
                                            "example": "2019-11-12 20:07:23",
                                            "description": "打包时间"
                                        }
                                    }
                                },
                                "example": {
                                    "msg": "success",
                                    "code": 200,
                                    "result": {
                                        "apiid": 80,
                                        "apiname": "土味情话",
                                        "appname": "我的土味情话小程序",
                                        "apptype": 0,
                                        "fileurl": "http:\/\/pack.tianapi.com\/packwxapp\/packfile\/internet_15736169047481.zip",
                                        "packtime": "2019-11-24 11:48:24"
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "summary": "生成小程序",
                "tags": [
                    "生成小程序"
                ],
                "description": "根据接口ID生成微信或百度小程序源码",
                "requestBody": {
                    "content": {
                        "application\/x-www-form-urlencoded": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "key": {
                                        "type": "string",
                                        "description": "API密钥"
                                    },
                                    "apiid": {
                                        "type": "int",
                                        "example": 80,
                                        "description": "天行数据平台的接口（接口ID、英文、中文均可）"
                                    },
                                    "app_name": {
                                        "type": "string",
                                        "example": "我的土味情话小程序",
                                        "description": "小程序名称，为空时默认接口名"
                                    },
                                    "app_type": {
                                        "type": "int",
                                        "example": 0,
                                        "description": "打包小程序类型，0微信小程序、1百度小程序"
                                    },
                                    "app_apikey": {
                                        "type": "string",
                                        "description": "小程序中的接口密钥apikey，为空时默认自己的API密钥"
                                    }
                                },
                                "required": [
                                    "key",
                                    "apiid"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "成功响应",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "apiid": {
                                            "type": "int",
                                            "example": 79,
                                            "description": "天行数据平台的接口ID"
                                        },
                                        "apiname": {
                                            "type": "string",
                                            "example": "互联网资讯",
                                            "description": "天行数据平台的接口名称"
                                        },
                                        "appname": {
                                            "type": "string",
                                            "example": "互联网资讯小程序",
                                            "description": "自定义的小程序名称"
                                        },
                                        "apptype": {
                                            "type": "int",
                                            "example": 0,
                                            "description": "打包小程序类型，0微信小程序、1百度小程序"
                                        },
                                        "fileurl": {
                                            "type": "string",
                                            "example": "http:\/\/pack.tianapi.com\/packwxapp\/packfile\/internet_15736169047481.zip",
                                            "description": "打包文件的下载地址"
                                        },
                                        "packtime": {
                                            "type": "string",
                                            "example": "2019-11-12 20:07:23",
                                            "description": "打包时间"
                                        }
                                    }
                                },
                                "example": {
                                    "msg": "success",
                                    "code": 200,
                                    "result": {
                                        "apiid": 80,
                                        "apiname": "土味情话",
                                        "appname": "我的土味情话小程序",
                                        "apptype": 0,
                                        "fileurl": "http:\/\/pack.tianapi.com\/packwxapp\/packfile\/internet_15736169047481.zip",
                                        "packtime": "2019-11-24 11:48:24"
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}