2022-12-30 09:28:54 +08:00
|
|
|
import uvicorn
|
2022-10-13 17:07:52 +08:00
|
|
|
from fastapi import FastAPI
|
2022-10-09 13:43:06 +08:00
|
|
|
from fastapi.middleware.cors import CORSMiddleware
|
|
|
|
|
2022-12-22 15:34:49 +08:00
|
|
|
import 基本信用评级指标
|
2022-09-26 00:02:17 +08:00
|
|
|
|
2022-10-11 09:49:50 +08:00
|
|
|
app = FastAPI(
|
|
|
|
title="指标函数计算接口",
|
2022-10-13 17:07:52 +08:00
|
|
|
description="1.发送计算请求,返回结果数值\n"
|
|
|
|
"2.发送描述请求,返回指标描述信息",
|
2022-10-11 09:49:50 +08:00
|
|
|
version="v1.0.0"
|
|
|
|
)
|
2022-09-26 00:02:17 +08:00
|
|
|
|
2022-10-09 13:43:06 +08:00
|
|
|
app.add_middleware(
|
|
|
|
CORSMiddleware,
|
|
|
|
allow_origins=["*"],
|
|
|
|
allow_credentials=True,
|
|
|
|
allow_methods=["*"],
|
|
|
|
allow_headers=["*"],
|
|
|
|
)
|
|
|
|
|
2022-10-13 17:07:52 +08:00
|
|
|
|
|
|
|
# 路由
|
2022-10-13 18:03:57 +08:00
|
|
|
PREFIX = "/api/index_function"
|
2022-12-22 15:34:49 +08:00
|
|
|
app.include_router(基本信用评级指标.router, prefix=PREFIX)
|
2022-12-30 09:28:54 +08:00
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
uvicorn.run(app, host="127.0.0.1", port=8002)
|