392 lines
8.0 KiB
Python
392 lines
8.0 KiB
Python
|
# _*_ coding : UTF-8 _*_
|
||
|
# @Time : 2025/03/24 02:29:03
|
||
|
# @UpdateTime : 2025/03/24 02:29:03
|
||
|
# @Author : sonder
|
||
|
# @File : version.py
|
||
|
# @Comment : 本程序用于生成版本信息参数和响应模型
|
||
|
|
||
|
from datetime import datetime
|
||
|
from typing import Optional, List
|
||
|
from pydantic import BaseModel, Field, ConfigDict
|
||
|
from pydantic.alias_generators import to_snake
|
||
|
from schemas.common import BaseResponse, ListQueryResult
|
||
|
|
||
|
|
||
|
class VersionInfo(BaseModel):
|
||
|
"""税率编码版本信息"""
|
||
|
model_config = ConfigDict(alias_generator=to_snake, populate_by_name=True)
|
||
|
|
||
|
id: Optional[str] = Field(
|
||
|
title="主键"
|
||
|
)
|
||
|
|
||
|
create_time: Optional[datetime] = Field(
|
||
|
title="创建时间"
|
||
|
)
|
||
|
|
||
|
update_time: Optional[datetime] = Field(
|
||
|
title="更新时间"
|
||
|
)
|
||
|
|
||
|
version: str = Field(
|
||
|
title="版本号"
|
||
|
)
|
||
|
|
||
|
date: str = Field(
|
||
|
title="版本日期"
|
||
|
)
|
||
|
|
||
|
url: str = Field(
|
||
|
title="下载地址"
|
||
|
)
|
||
|
|
||
|
|
||
|
class AddVersionParams(BaseModel):
|
||
|
"""新增税率编码版本参数"""
|
||
|
model_config = ConfigDict(alias_generator=to_snake, populate_by_name=True)
|
||
|
|
||
|
version: str = Field(
|
||
|
title="版本号"
|
||
|
)
|
||
|
|
||
|
date: str = Field(
|
||
|
title="版本日期"
|
||
|
)
|
||
|
|
||
|
url: str = Field(
|
||
|
title="下载地址"
|
||
|
)
|
||
|
|
||
|
|
||
|
class UpdateVersionParams(BaseModel):
|
||
|
"""更新税率编码版本参数"""
|
||
|
model_config = ConfigDict(alias_generator=to_snake, populate_by_name=True)
|
||
|
|
||
|
version: str = Field(
|
||
|
title="版本号"
|
||
|
)
|
||
|
|
||
|
date: str = Field(
|
||
|
title="版本日期"
|
||
|
)
|
||
|
|
||
|
url: str = Field(
|
||
|
title="下载地址"
|
||
|
)
|
||
|
|
||
|
|
||
|
class GetVersionInfoResponse(BaseResponse):
|
||
|
"""获取税率编码版本信息响应"""
|
||
|
data: VersionInfo = Field(None, title="版本信息信息")
|
||
|
|
||
|
|
||
|
class GetVersionInfoListResult(ListQueryResult):
|
||
|
"""获取税率编码版本信息列表响应结果"""
|
||
|
result: List[VersionInfo] = Field(None, title="版本信息信息列表")
|
||
|
|
||
|
|
||
|
class GetVersionListResponse(BaseResponse):
|
||
|
"""获取税率编码版本信息列表响应"""
|
||
|
data: GetVersionInfoListResult = Field(None, title="版本信息信息列表")
|
||
|
|
||
|
|
||
|
class HTSClassInfo(BaseModel):
|
||
|
"""编码类别信息"""
|
||
|
model_config = ConfigDict(alias_generator=to_snake, populate_by_name=True)
|
||
|
|
||
|
id: Optional[str] = Field(
|
||
|
title="主键"
|
||
|
)
|
||
|
|
||
|
create_time: Optional[datetime] = Field(
|
||
|
title="创建时间"
|
||
|
)
|
||
|
|
||
|
update_time: Optional[datetime] = Field(
|
||
|
title="更新时间"
|
||
|
)
|
||
|
|
||
|
class_name: str = Field(
|
||
|
title="类名"
|
||
|
)
|
||
|
|
||
|
class_description: str = Field(
|
||
|
title="类描述"
|
||
|
)
|
||
|
|
||
|
chapter_name: str = Field(
|
||
|
title="章节"
|
||
|
)
|
||
|
|
||
|
chapter_description: str = Field(
|
||
|
title="章节描述"
|
||
|
)
|
||
|
|
||
|
|
||
|
class AddHTSClassParams(BaseModel):
|
||
|
"""新增编码类别参数"""
|
||
|
model_config = ConfigDict(alias_generator=to_snake, populate_by_name=True)
|
||
|
|
||
|
class_name: str = Field(
|
||
|
title="类名"
|
||
|
)
|
||
|
|
||
|
class_description: str = Field(
|
||
|
title="类描述"
|
||
|
)
|
||
|
|
||
|
chapter_name: str = Field(
|
||
|
title="章节"
|
||
|
)
|
||
|
|
||
|
chapter_description: str = Field(
|
||
|
title="章节描述"
|
||
|
)
|
||
|
|
||
|
|
||
|
class UpdateHTSClassParams(BaseModel):
|
||
|
"""更新编码类别参数"""
|
||
|
model_config = ConfigDict(alias_generator=to_snake, populate_by_name=True)
|
||
|
|
||
|
class_name: str = Field(
|
||
|
title="类名"
|
||
|
)
|
||
|
|
||
|
class_description: str = Field(
|
||
|
title="类描述"
|
||
|
)
|
||
|
|
||
|
chapter_name: str = Field(
|
||
|
title="章节"
|
||
|
)
|
||
|
|
||
|
chapter_description: str = Field(
|
||
|
title="章节描述"
|
||
|
)
|
||
|
|
||
|
|
||
|
class GetHTSClassInfoResponse(BaseResponse):
|
||
|
"""获取编码类别信息响应"""
|
||
|
data: HTSClassInfo = Field(None, title="编码类信息信息")
|
||
|
|
||
|
|
||
|
class GetHTSClassInfoListResult(ListQueryResult):
|
||
|
"""获取编码类别信息列表响应结果"""
|
||
|
result: List[HTSClassInfo] = Field(None, title="编码类信息信息列表")
|
||
|
|
||
|
|
||
|
class GetHTSClassListResponse(BaseResponse):
|
||
|
"""获取编码类别信息列表响应"""
|
||
|
data: GetHTSClassInfoListResult = Field(None, title="编码类信息信息列表")
|
||
|
|
||
|
|
||
|
class HtsItemInfo(BaseModel):
|
||
|
"""编码项目信息"""
|
||
|
model_config = ConfigDict(alias_generator=to_snake, populate_by_name=True)
|
||
|
|
||
|
id: Optional[str] = Field(
|
||
|
title="主键"
|
||
|
)
|
||
|
|
||
|
create_time: Optional[datetime] = Field(
|
||
|
title="创建时间"
|
||
|
)
|
||
|
|
||
|
update_time: Optional[datetime] = Field(
|
||
|
title="更新时间"
|
||
|
)
|
||
|
|
||
|
parent_id: Optional[str] = Field(
|
||
|
title="父编码"
|
||
|
)
|
||
|
|
||
|
htsno: str = Field(
|
||
|
title="编码"
|
||
|
)
|
||
|
|
||
|
indent: int = Field(
|
||
|
title="层级"
|
||
|
)
|
||
|
|
||
|
description: str = Field(
|
||
|
title="描述"
|
||
|
)
|
||
|
|
||
|
units: dict = Field(
|
||
|
title="单位列表"
|
||
|
)
|
||
|
|
||
|
general: str = Field(
|
||
|
title="通用税率"
|
||
|
)
|
||
|
|
||
|
special: str = Field(
|
||
|
title="特殊税率,适用于特定国家或地区"
|
||
|
)
|
||
|
|
||
|
other: str = Field(
|
||
|
title="其他税率"
|
||
|
)
|
||
|
|
||
|
quota_quantity: str = Field(
|
||
|
title="配额数量"
|
||
|
)
|
||
|
|
||
|
additional_duties: str = Field(
|
||
|
title="附加税"
|
||
|
)
|
||
|
|
||
|
footnotes: dict = Field(
|
||
|
title="脚注列表"
|
||
|
)
|
||
|
|
||
|
class_id: str = Field(
|
||
|
title="所属类"
|
||
|
)
|
||
|
|
||
|
version_id: str = Field(
|
||
|
title="所属版本"
|
||
|
)
|
||
|
|
||
|
|
||
|
class AddHtsItemParams(BaseModel):
|
||
|
"""新增编码项目参数"""
|
||
|
model_config = ConfigDict(alias_generator=to_snake, populate_by_name=True)
|
||
|
|
||
|
parent_id: Optional[str] = Field(
|
||
|
title="父编码"
|
||
|
)
|
||
|
|
||
|
htsno: str = Field(
|
||
|
title="编码"
|
||
|
)
|
||
|
|
||
|
indent: int = Field(
|
||
|
title="层级"
|
||
|
)
|
||
|
|
||
|
description: str = Field(
|
||
|
title="描述"
|
||
|
)
|
||
|
|
||
|
units: dict = Field(
|
||
|
title="单位列表"
|
||
|
)
|
||
|
|
||
|
general: str = Field(
|
||
|
title="通用税率"
|
||
|
)
|
||
|
|
||
|
special: str = Field(
|
||
|
title="特殊税率,适用于特定国家或地区"
|
||
|
)
|
||
|
|
||
|
other: str = Field(
|
||
|
title="其他税率"
|
||
|
)
|
||
|
|
||
|
quota_quantity: str = Field(
|
||
|
title="配额数量"
|
||
|
)
|
||
|
|
||
|
additional_duties: str = Field(
|
||
|
title="附加税"
|
||
|
)
|
||
|
|
||
|
footnotes: dict = Field(
|
||
|
title="脚注列表"
|
||
|
)
|
||
|
|
||
|
class_id: str = Field(
|
||
|
title="所属类"
|
||
|
)
|
||
|
|
||
|
version_id: str = Field(
|
||
|
title="所属版本"
|
||
|
)
|
||
|
|
||
|
|
||
|
class UpdateHtsItemParams(BaseModel):
|
||
|
"""更新编码项目参数"""
|
||
|
model_config = ConfigDict(alias_generator=to_snake, populate_by_name=True)
|
||
|
|
||
|
parent_id: Optional[str] = Field(
|
||
|
title="父编码"
|
||
|
)
|
||
|
|
||
|
htsno: str = Field(
|
||
|
title="编码"
|
||
|
)
|
||
|
|
||
|
indent: int = Field(
|
||
|
title="层级"
|
||
|
)
|
||
|
|
||
|
description: str = Field(
|
||
|
title="描述"
|
||
|
)
|
||
|
|
||
|
units: dict = Field(
|
||
|
title="单位列表"
|
||
|
)
|
||
|
|
||
|
general: str = Field(
|
||
|
title="通用税率"
|
||
|
)
|
||
|
|
||
|
special: str = Field(
|
||
|
title="特殊税率,适用于特定国家或地区"
|
||
|
)
|
||
|
|
||
|
other: str = Field(
|
||
|
title="其他税率"
|
||
|
)
|
||
|
|
||
|
quota_quantity: str = Field(
|
||
|
title="配额数量"
|
||
|
)
|
||
|
|
||
|
additional_duties: str = Field(
|
||
|
title="附加税"
|
||
|
)
|
||
|
|
||
|
footnotes: dict = Field(
|
||
|
title="脚注列表"
|
||
|
)
|
||
|
|
||
|
class_id: str = Field(
|
||
|
title="所属类"
|
||
|
)
|
||
|
|
||
|
version_id: str = Field(
|
||
|
title="所属版本"
|
||
|
)
|
||
|
|
||
|
|
||
|
class ImportHtsItemParams(BaseModel):
|
||
|
model_config = ConfigDict(alias_generator=to_snake, populate_by_name=True)
|
||
|
file_id: str = Field(
|
||
|
title="文件ID"
|
||
|
)
|
||
|
version_id: str = Field(
|
||
|
title="版本ID"
|
||
|
)
|
||
|
class_id: str = Field(
|
||
|
title="类ID"
|
||
|
)
|
||
|
|
||
|
|
||
|
class GetHtsItemInfoResponse(BaseResponse):
|
||
|
"""获取编码项目信息响应"""
|
||
|
data: HtsItemInfo = Field(None, title="编码项信息信息")
|
||
|
|
||
|
|
||
|
class GetHtsItemInfoListResult(ListQueryResult):
|
||
|
"""获取编码项目信息列表响应结果"""
|
||
|
result: List[HtsItemInfo] = Field(None, title="编码项信息信息列表")
|
||
|
|
||
|
|
||
|
class GetHtsItemListResponse(BaseResponse):
|
||
|
"""获取编码项目信息列表响应"""
|
||
|
data: GetHtsItemInfoListResult = Field(None, title="编码项信息信息列表")
|