{
    "openapi": "3.0.0",
    "info": {
        "title": "科学计算 - API文档",
        "version": "1.0.0",
        "description": "支持加减乘除、绝对值、平方根、正切、阶乘、幂次方等二十多个科学计算规则，适合各类工程计算场景。注意num参数可能一个数或者两个数（用,半角逗号分隔，如100,50），表示某个算法规则的两个数字相互计算。例如加法时表示逗号两侧的数字相加，在百分比计算时逗号左侧表示分子，右侧为分母。在四舍五入计算时，第二个数字表示保留的小数点位数。支持的算法规格和其他提示：<a href=\"https:\/\/www.tianapi.com\/article\/198\" target=\"_blank\">科学计算API​支持的算法规则列表<\/a>"
    },
    "servers": [
        {
            "url": "https:\/\/apis.tianapi.com"
        }
    ],
    "paths": {
        "\/scncalc\/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": true,
                        "schema": {
                            "type": "string",
                            "example": "100",
                            "description": "数值，部分计算需两个数字以,分隔"
                        }
                    },
                    {
                        "name": "type",
                        "in": "query",
                        "description": "类型，可查询支持类型列表",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "log",
                            "description": "类型，可查询支持类型列表"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "成功响应",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "tip": {
                                            "type": "string",
                                            "example": "normal",
                                            "description": "提示，数字错误err_num、缺失数字lack_num、类型不支持type_not"
                                        },
                                        "value": {
                                            "type": "int",
                                            "example": 102,
                                            "description": "计算结果值"
                                        }
                                    }
                                },
                                "example": {
                                    "msg": "success",
                                    "code": 200,
                                    "result": {
                                        "tip": "normal",
                                        "value": 4.605170185988092
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "summary": "科学数值计算",
                "tags": [
                    "科学计算"
                ],
                "description": "进行数学计算，支持类型可查询第二个接入点",
                "requestBody": {
                    "content": {
                        "application\/x-www-form-urlencoded": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "key": {
                                        "type": "string",
                                        "description": "API密钥"
                                    },
                                    "num": {
                                        "type": "string",
                                        "example": "100",
                                        "description": "数值，部分计算需两个数字以,分隔"
                                    },
                                    "type": {
                                        "type": "string",
                                        "example": "log",
                                        "description": "类型，可查询支持类型列表"
                                    }
                                },
                                "required": [
                                    "key",
                                    "num",
                                    "type"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "成功响应",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "tip": {
                                            "type": "string",
                                            "example": "normal",
                                            "description": "提示，数字错误err_num、缺失数字lack_num、类型不支持type_not"
                                        },
                                        "value": {
                                            "type": "int",
                                            "example": 102,
                                            "description": "计算结果值"
                                        }
                                    }
                                },
                                "example": {
                                    "msg": "success",
                                    "code": 200,
                                    "result": {
                                        "tip": "normal",
                                        "value": 4.605170185988092
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "\/scncalc\/sumlist": {
            "get": {
                "summary": "支持算法列表",
                "tags": [
                    "科学计算"
                ],
                "description": "查询科学计算支持的算法规则",
                "parameters": [
                    {
                        "name": "key",
                        "in": "query",
                        "description": "API密钥",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "description": "API密钥"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "成功响应",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "desc": {
                                            "type": "string",
                                            "example": "计算一个数的自然对数（以 E 为底）",
                                            "description": "描述说明"
                                        },
                                        "type": {
                                            "type": "string",
                                            "example": "log",
                                            "description": "规则类型"
                                        }
                                    }
                                },
                                "example": {
                                    "msg": "success",
                                    "code": 200,
                                    "result": {
                                        "list": [
                                            {
                                                "desc": "计算一个数的绝对值",
                                                "type": "abs"
                                            },
                                            {
                                                "desc": "计算一个数的反余弦，结果范围在0到π之间",
                                                "type": "acos"
                                            },
                                            {
                                                "desc": "计算一个数的反双曲余弦",
                                                "type": "acosh"
                                            },
                                            {
                                                "desc": "计算一个数的反正弦，结果范围在-π\/2到π\/2之间",
                                                "type": "asin"
                                            },
                                            {
                                                "desc": "计算一个数的反双曲正弦",
                                                "type": "asinh"
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "summary": "支持算法列表",
                "tags": [
                    "科学计算"
                ],
                "description": "查询科学计算支持的算法规则",
                "requestBody": {
                    "content": {
                        "application\/x-www-form-urlencoded": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "key": {
                                        "type": "string",
                                        "description": "API密钥"
                                    }
                                },
                                "required": [
                                    "key"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "成功响应",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "desc": {
                                            "type": "string",
                                            "example": "计算一个数的自然对数（以 E 为底）",
                                            "description": "描述说明"
                                        },
                                        "type": {
                                            "type": "string",
                                            "example": "log",
                                            "description": "规则类型"
                                        }
                                    }
                                },
                                "example": {
                                    "msg": "success",
                                    "code": 200,
                                    "result": {
                                        "list": [
                                            {
                                                "desc": "计算一个数的绝对值",
                                                "type": "abs"
                                            },
                                            {
                                                "desc": "计算一个数的反余弦，结果范围在0到π之间",
                                                "type": "acos"
                                            },
                                            {
                                                "desc": "计算一个数的反双曲余弦",
                                                "type": "acosh"
                                            },
                                            {
                                                "desc": "计算一个数的反正弦，结果范围在-π\/2到π\/2之间",
                                                "type": "asin"
                                            },
                                            {
                                                "desc": "计算一个数的反双曲正弦",
                                                "type": "asinh"
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}