This commit is contained in:
yumoqing 2026-03-24 11:44:12 +08:00
parent 5abf6282b9
commit 3248e39fee

View File

@ -32,16 +32,16 @@ model:
type: str type: str
label: "模型" label: "模型"
options: options:
- "viduq3-pro" - "viduq3-pro"
- "viduq3-turbo" - "viduq3-turbo"
resolution: resolution:
type: str type: str
label: "分辨率" label: "分辨率"
options: options:
- "1024p" - "1024p"
- "720p" - "720p"
- "540p" - "540p"
duration: duration:
type: int # 建议改为 int 或 strtimes 不是标准类型 type: int # 建议改为 int 或 strtimes 不是标准类型
@ -55,8 +55,8 @@ off_peak:
type: int # 建议改为 int 或 str因为值是 0 和 1 type: int # 建议改为 int 或 str因为值是 0 和 1
label: "错峰执行" label: "错峰执行"
options: options:
- off_peak # 正常时段 - off_peak # 正常时段
- normal # 错峰 - normal # 错峰
price: price:
type: float type: float
label: 单价 label: 单价
@ -66,41 +66,41 @@ pricing_program_timing表中的pricing_data字段的数据是一个只有一个
其值为定价条目列表每个定价条目是个字典key值为pricing_spec字段定义的字段 其值为定价条目列表每个定价条目是个字典key值为pricing_spec字段定义的字段
pricings: pricings:
- resolution: 480p - resolution: 480p
duration: 4 duration: 4
audio: false audio: false
- resolution: 480p - resolution: 480p
duration: 8 duration: 8
audio: false audio: false
- resolution: 480p - resolution: 480p
duration: 12 duration: 12
audio: false audio: false
- resolution: 480p - resolution: 480p
duration: 4 duration: 4
audio: true audio: true
- resolution: 480p - resolution: 480p
duration: 8 duration: 8
audio: true audio: true
- resolution: 480p - resolution: 480p
duration: 12 duration: 12
audio: true audio: true
- resolution: 720p - resolution: 720p
duration: 4 duration: 4
audio: false audio: false
- resolution: 720p - resolution: 720p
duration: 8 duration: 8
audio: false audio: false
- resolution: 720p - resolution: 720p
duration: 12 duration: 12
audio: false audio: false
- resolution: 720p - resolution: 720p
duration: 4 duration: 4
audio: true audio: true
- resolution: 720p - resolution: 720p
duration: 8 duration: 8
audio: true audio: true
- resolution: 720p - resolution: 720p
duration: 12 duration: 12
audio: true audio: true
""" """
typefuncs = { typefuncs = {
@ -174,7 +174,7 @@ class PricingProgram:
fp = fs.realPath(webpath_xlsx) fp = fs.realPath(webpath_xlsx)
d = load_xlsx_pricing(fp) d = load_xlsx_pricing(fp)
async with get_sor_context(env, 'pricing') as sor: async with get_sor_context(env, 'pricing') as sor:
ppts = await sor.R('pricing_program_timing', {'id': pptid}) ppts = await sor.R('pricing_program_timing', {'id': pptid})
if ppts: if ppts:
ppt = ppts[0] ppt = ppts[0]
ppt.pricing_data = yaml.dump(dd) ppt.pricing_data = yaml.dump(dd)
@ -212,30 +212,30 @@ class PricingProgram:
@staticmethod @staticmethod
def pp_app2db(pp): def pp_app2db(pp):
try: try:
pp.pricing_spec = yaml.dump(pp.pricing_spec) pp.pricing_spec = yaml.dump(pp.pricing_spec)
except Exception as e: except Exception as e:
e = f'{pp.pricing_spec}:导出到yaml失败' e = f'{pp.pricing_spec}:导出到yaml失败'
exception(e) exception(e)
raise Exception(e) raise Exception(e)
@staticmethod @staticmethod
def ppt_db2app(ppt): def ppt_db2app(ppt):
try: try:
ppt.pricing_data = yaml.safe_load(ppt.pricing_data) ppt.pricing_data = yaml.safe_load(ppt.pricing_data)
except Exception as e: except Exception as e:
e = f'{ppt.pricing_data}:yaml数据格式错误' e = f'{ppt.pricing_data}:yaml数据格式错误'
exception(e) exception(e)
raise Exception(e) raise Exception(e)
@staticmethod @staticmethod
def ppt_app2db(ppt): def ppt_app2db(ppt):
try: try:
ppt.pricing_data = yaml.dump(ppt.pricing_data) ppt.pricing_data = yaml.dump(ppt.pricing_data)
except Exception as e: except Exception as e:
e = f'{ppt.pricing_data}:yaml数据格式错误' e = f'{ppt.pricing_data}:yaml数据格式错误'
exception(e) exception(e)
raise Exception(e) raise Exception(e)
@staticmethod @staticmethod
async def pricing(ppid, data): async def pricing(ppid, data):