# -*- coding: utf-8 -*- # !/usr/bin/env python from typing import TYPE_CHECKING, Optional from apilib.utils_string import cn if TYPE_CHECKING: pass def gen_quick_pay_purchase_subject(major_type, logicalCode, port = None): # type:(basestring, basestring, Optional[basestring]) -> unicode if port and port not in ['None', -1, '-1']: subject = cn(u'自助服务-{major_type}/{logicalCode}-{port}'.format( major_type = major_type, logicalCode = logicalCode, port = port)) return subject else: subject = cn(u'自助服务-{major_type}/{logicalCode}'.format( major_type = major_type, logicalCode = logicalCode)) return subject def gen_recharge_purchase_subject(major_type, logicalCode): # type:(str, str) -> unicode subject = cn(u'自助服务-充值-{major_type}/{logicalCode}'.format( major_type = major_type, logicalCode = logicalCode)) return subject