feat: 新增用车需求服务及线索管理全功能
- 新增后台用车服务配置模块,支持维护服务简介、优势与使用流程 - 新增需求线索管理页面,支持筛选、查看与更新用车线索状态 - 新增小程序用车需求页面,优化登录路径与回跳逻辑 - 优化车型卡片跳转与用车需求提交功能 - 新增服务端API与数据处理逻辑,完善权限校验 - 更新全站配置与API文档,新增相关测试用例
This commit is contained in:
1 parent
b7a81964c9
commit
d42f69bd47
36 files changed
+1290
-33
No files matched your search
@@ -5,7 +5,7 @@ import json
|
||||
from sqlalchemy import delete, select
|
||||
from sqlalchemy.orm import Session
|
||||
from .auth import hash_password
|
||||
from .content import DEMAND_FEATURE_CARDS, DEMAND_FORM, DEMAND_HERO, DESTINATION_HERO, HERO_SLIDES, VEHICLE_OPTIONS
|
||||
from .content import DEMAND_FEATURE_CARDS, DEMAND_FORM, DEMAND_HERO, DESTINATION_HERO, HERO_SLIDES, VEHICLE_OPTIONS, VEHICLE_SERVICE
|
||||
from .database import Base, SessionLocal, engine
|
||||
from .models import (
|
||||
AdminUser,
|
||||
@@ -17,6 +17,7 @@ from .models import (
|
||||
MediaAsset,
|
||||
SiteVersion,
|
||||
VehicleOption,
|
||||
VehicleServiceConfig,
|
||||
utc_now,
|
||||
)
|
||||
def create_media(db: Session, url: str | None, group: str, name: str | None = None) -> None:
|
||||
@@ -31,7 +32,7 @@ def create_media(db: Session, url: str | None, group: str, name: str | None = No
|
||||
|
||||
|
||||
def reset_guizhou_content(db: Session) -> dict:
|
||||
for model in [SiteVersion, DemandForm, DemandFeatureCard, DemandHero, VehicleOption, DestinationHero, HeroSlide, MediaAsset]:
|
||||
for model in [SiteVersion, DemandForm, DemandFeatureCard, DemandHero, VehicleOption, VehicleServiceConfig, DestinationHero, HeroSlide, MediaAsset]:
|
||||
db.execute(delete(model))
|
||||
db.flush()
|
||||
|
||||
@@ -69,6 +70,8 @@ def reset_guizhou_content(db: Session) -> dict:
|
||||
)
|
||||
)
|
||||
|
||||
db.add(VehicleServiceConfig(**VEHICLE_SERVICE))
|
||||
|
||||
for index, item in enumerate(DEMAND_HERO):
|
||||
db.add(
|
||||
DemandHero(
|
||||
@@ -99,6 +102,7 @@ def reset_guizhou_content(db: Session) -> dict:
|
||||
"heroSlides": len(HERO_SLIDES),
|
||||
"destinationHero": len(DESTINATION_HERO),
|
||||
"vehicleOptions": len(VEHICLE_OPTIONS),
|
||||
"vehicleService": 1,
|
||||
"demandHero": len(DEMAND_HERO),
|
||||
"demandFeatureCards": len(DEMAND_FEATURE_CARDS),
|
||||
"demandForm": 1,
|
||||
@@ -110,6 +114,7 @@ def reset_guizhou_content(db: Session) -> dict:
|
||||
"heroSlides": len(HERO_SLIDES),
|
||||
"destinationHero": len(DESTINATION_HERO),
|
||||
"vehicleOptions": len(VEHICLE_OPTIONS),
|
||||
"vehicleService": 1,
|
||||
"demandHero": len(DEMAND_HERO),
|
||||
"demandFeatureCards": len(DEMAND_FEATURE_CARDS),
|
||||
"demandForm": 1,
|
||||
|
||||
Reference in new issue
Block a user