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