From 0a2339dbf1755d3975b75babb29072895471794d Mon Sep 17 00:00:00 2001 From: P3ngSaM <61768364+P3ngSaM@users.noreply.github.com> Date: Fri, 13 Jan 2023 15:22:00 +0800 Subject: [PATCH] =?UTF-8?q?changes=20=E5=87=80=E8=B5=84=E4=BA=A7/=E5=87=80?= =?UTF-8?q?=E8=B5=84=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 基本信用评级指标/规模/净资产.py | 2 +- 基本信用评级指标/规模/净资本.py | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 基本信用评级指标/规模/净资本.py diff --git a/基本信用评级指标/规模/净资产.py b/基本信用评级指标/规模/净资产.py index fa107c1..61a6400 100644 --- a/基本信用评级指标/规模/净资产.py +++ b/基本信用评级指标/规模/净资产.py @@ -1,7 +1,7 @@ from fastapi import APIRouter from pydantic import BaseModel -INDEX = "净资本(亿元)" +INDEX = "净资产(亿元)" router = APIRouter() diff --git a/基本信用评级指标/规模/净资本.py b/基本信用评级指标/规模/净资本.py new file mode 100644 index 0000000..d2d73a4 --- /dev/null +++ b/基本信用评级指标/规模/净资本.py @@ -0,0 +1,21 @@ +from fastapi import APIRouter +from pydantic import BaseModel + +INDEX = "净资本(亿元)" + +router = APIRouter() + + +class Params(BaseModel): + 净资本: float + + +# 计算接口 +@router.post("/{}".format(INDEX)) +def func(p: Params): + try: + result = p.净资本 / 100000000 + return round(result, 2) + + except Exception: + return "计算错误"