Compare commits
35 Commits
ef4c4afafc
...
main
Author | SHA1 | Date | |
---|---|---|---|
9830c827a4 | |||
4e4e8cdb7f | |||
b577d6287f | |||
a5a164514c | |||
6162ceddb7 | |||
86e262461c | |||
d211c9ee7e | |||
a3813e77d6 | |||
14df704f6c | |||
4052d53720 | |||
dd81331a57 | |||
74e908f5de | |||
7860d08c81 | |||
8483e4509b | |||
28ff2a93e1 | |||
ec38a25087 | |||
f5147e7951 | |||
22a2ead9f4 | |||
21c5be3121 | |||
cbabf9c956 | |||
ec35818b13 | |||
9349d582b6 | |||
b821e316ca | |||
13730b1e92 | |||
caca8500b6 | |||
3e3343fa81 | |||
649195dfeb | |||
8ad6275847 | |||
6a1a67ac07 | |||
a941049482 | |||
fb715c2a83 | |||
f3b79dc883 | |||
0f199e5d29 | |||
e85799be93 | |||
59ed6b110e |
@@ -3,3 +3,22 @@ EXCEL_PATH = r'D:\dsWork\YunNanProject\Doc\数据库-2015-2024-v2.xlsx'
|
|||||||
|
|
||||||
# Echarts的静态资源路径
|
# Echarts的静态资源路径
|
||||||
ONLINE_HOST = "https://gcore.jsdelivr.net/npm/echarts@6.0.0/dist/"
|
ONLINE_HOST = "https://gcore.jsdelivr.net/npm/echarts@6.0.0/dist/"
|
||||||
|
|
||||||
|
# DeepSeek大模型 【DeepSeek深度求索官方】训练时用这个
|
||||||
|
LLM_API_KEY = "sk-44ae895eeb614aa1a9c6460579e322f1"
|
||||||
|
LLM_BASE_URL = "https://api.deepseek.com"
|
||||||
|
LLM_MODEL_NAME = "deepseek-chat"
|
||||||
|
# LLM_MODEL_NAME = "deepseek-reasoner"
|
||||||
|
|
||||||
|
# 嵌入向量模型
|
||||||
|
EMBED_MODEL_NAME = "BAAI/bge-m3"
|
||||||
|
EMBED_API_KEY = "sk-pbqibyjwhrgmnlsmdygplahextfaclgnedetybccknxojlyl"
|
||||||
|
EMBED_BASE_URL = "https://api.siliconflow.cn/v1"
|
||||||
|
EMBED_DIM = 1024
|
||||||
|
EMBED_MAX_TOKEN_SIZE = 8192
|
||||||
|
|
||||||
|
# 重排模型
|
||||||
|
RERANK_MODEL = 'BAAI/bge-reranker-v2-m3'
|
||||||
|
RERANK_BASE_URL = 'https://api.siliconflow.cn/v1/rerank'
|
||||||
|
RERANK_BINDING_API_KEY = 'sk-pbqibyjwhrgmnlsmdygplahextfaclgnedetybccknxojlyl'
|
||||||
|
|
||||||
|
Binary file not shown.
67
Controller/EducationDataController.py
Normal file
67
Controller/EducationDataController.py
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
from fastapi import APIRouter, Query
|
||||||
|
from Model.EducationDataModel import EducationDataModel
|
||||||
|
|
||||||
|
|
||||||
|
# 创建APIRouter实例
|
||||||
|
router = APIRouter(prefix="/EducationData", tags=["教育统计数据"])
|
||||||
|
|
||||||
|
|
||||||
|
@router.get("/byYear")
|
||||||
|
async def get_education_data_by_year(
|
||||||
|
year: int = Query(default=2023, ge=2015, le=2028,
|
||||||
|
description="年份: 2015-2028范围内的年份")
|
||||||
|
):
|
||||||
|
"""获取指定年份所有学段的教育数据"""
|
||||||
|
try:
|
||||||
|
# 调用EducationDataModel的方法获取数据
|
||||||
|
data = EducationDataModel.get_education_data_by_year(year)
|
||||||
|
|
||||||
|
# 返回包含状态和数据的响应
|
||||||
|
return {
|
||||||
|
"code": 200,
|
||||||
|
"message": "success",
|
||||||
|
"data": data
|
||||||
|
}
|
||||||
|
except Exception as e:
|
||||||
|
# 异常处理
|
||||||
|
return {
|
||||||
|
"code": 500,
|
||||||
|
"message": f"获取数据失败: {str(e)}",
|
||||||
|
"data": []
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@router.get("/populationByYear")
|
||||||
|
async def get_population_data_by_year(
|
||||||
|
year: int = Query(default=2023, ge=2015, le=2028,
|
||||||
|
description="年份: 2015-2028范围内的年份")
|
||||||
|
):
|
||||||
|
"""获取指定年份的云南省人口数据"""
|
||||||
|
try:
|
||||||
|
# 调用EducationDataModel的方法获取人口数据
|
||||||
|
data = EducationDataModel.get_population_data_by_year(year)
|
||||||
|
|
||||||
|
if data:
|
||||||
|
# 返回包含状态和数据的响应
|
||||||
|
return {
|
||||||
|
"code": 200,
|
||||||
|
"message": "success",
|
||||||
|
"data": data
|
||||||
|
}
|
||||||
|
else:
|
||||||
|
# 未找到数据的情况
|
||||||
|
return {
|
||||||
|
"code": 404,
|
||||||
|
"message": f"未找到{year}年的云南省人口数据",
|
||||||
|
"data": None
|
||||||
|
}
|
||||||
|
except Exception as e:
|
||||||
|
# 异常处理
|
||||||
|
return {
|
||||||
|
"code": 500,
|
||||||
|
"message": f"获取数据失败: {str(e)}",
|
||||||
|
"data": None
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@@ -1,21 +1,26 @@
|
|||||||
from fastapi import APIRouter
|
from fastapi import APIRouter, Query
|
||||||
|
|
||||||
from Model.RuYuanZaiYuanCountModel import RuYuanZaiYuanModel
|
from Model.RuYuanZaiYuanCountModel import RuYuanZaiYuanModel
|
||||||
|
|
||||||
# 创建APIRouter实例
|
# 创建APIRouter实例
|
||||||
router = APIRouter(prefix="/RuYuanZaiYuan", tags=["大屏展示"])
|
router = APIRouter(prefix="/RuYuanZaiYuan", tags=["入校、在校人数统计"])
|
||||||
|
|
||||||
# 默认的根路由
|
|
||||||
@router.get("/")
|
@router.get("/school/chart")
|
||||||
async def root():
|
async def get_education_chart_config(
|
||||||
return {"message": "Welcome to YunNan Education World!"}
|
education_stage: str = Query(default="preschool", pattern="^(preschool|primary|junior|senior|vocational)$",
|
||||||
|
description="教育阶段: preschool(学前), primary(小学), junior(初中), senior(高中), vocational(中职)"),
|
||||||
@router.get("/school/preschool/chart")
|
area_name: str = Query(default="云南省", description="区域名称,默认为云南省")
|
||||||
async def get_preschool_education_chart_config():
|
):
|
||||||
return RuYuanZaiYuanModel.generate_preschool_education_config()
|
return RuYuanZaiYuanModel.generate_preschool_education_config(education_stage, area_name)
|
||||||
|
|
||||||
@router.get("/school/preschool/inschool/chart")
|
@router.get("/school/inschool/chart")
|
||||||
async def get_preschool_in_school_chart_config():
|
async def get_in_school_chart_config(
|
||||||
return RuYuanZaiYuanModel.generate_in_school_education_config()
|
education_stage: str = Query(default="preschool", pattern="^(preschool|primary|junior|senior|vocational)$",
|
||||||
|
description="教育阶段: preschool(学前), primary(小学), junior(初中), senior(高中), vocational(中职)"),
|
||||||
|
area_name: str = Query(default="云南省", description="区域名称,默认为云南省")
|
||||||
|
):
|
||||||
|
return RuYuanZaiYuanModel.generate_in_school_education_config(education_stage, area_name)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
BIN
Controller/__pycache__/EducationDataController.cpython-310.pyc
Normal file
BIN
Controller/__pycache__/EducationDataController.cpython-310.pyc
Normal file
Binary file not shown.
Binary file not shown.
40060
Data/ClassCount.json
40060
Data/ClassCount.json
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
BIN
Doc/计算方法/微信图片_20250912144631_42_716.png
Normal file
BIN
Doc/计算方法/微信图片_20250912144631_42_716.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 178 KiB |
BIN
Doc/计算方法/数据计算说明.docx
Normal file
BIN
Doc/计算方法/数据计算说明.docx
Normal file
Binary file not shown.
BIN
Doc/计算方法/最新计算数据表20250912/2015-2024年州市县人口指标数据0415.xlsx
Normal file
BIN
Doc/计算方法/最新计算数据表20250912/2015-2024年州市县人口指标数据0415.xlsx
Normal file
Binary file not shown.
BIN
Doc/计算方法/最新计算数据表20250912/2024学前教职工数新测算0904.xlsx
Normal file
BIN
Doc/计算方法/最新计算数据表20250912/2024学前教职工数新测算0904.xlsx
Normal file
Binary file not shown.
BIN
Doc/计算方法/最新计算数据表20250912/20250908学前用教职工数测算的汇总数据表/.DS_Store
vendored
Normal file
BIN
Doc/计算方法/最新计算数据表20250912/20250908学前用教职工数测算的汇总数据表/.DS_Store
vendored
Normal file
Binary file not shown.
BIN
Doc/计算方法/最新计算数据表20250912/20250908学前用教职工数测算的汇总数据表/1-54数据整理/.DS_Store
vendored
Normal file
BIN
Doc/计算方法/最新计算数据表20250912/20250908学前用教职工数测算的汇总数据表/1-54数据整理/.DS_Store
vendored
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Doc/计算方法/最新计算数据表20250912/20250908学前用教职工数测算的汇总数据表/106—146 数据整理/.DS_Store
vendored
Normal file
BIN
Doc/计算方法/最新计算数据表20250912/20250908学前用教职工数测算的汇总数据表/106—146 数据整理/.DS_Store
vendored
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user