perf: ad as asset

This commit is contained in:
ibuler
2025-04-02 19:12:09 +08:00
committed by 老广
parent 5e25361ee8
commit 3f452daee8
24 changed files with 391 additions and 19 deletions

View File

@@ -131,9 +131,26 @@ class Account(AbsConnectivity, LabeledMixin, BaseAccount, JSONFilterMixin):
@lazyproperty
def alias(self):
"""
别称,因为有虚拟账号,@INPUT @MANUAL @USER, 否则为 id
"""
if self.username.startswith('@'):
return self.username
return self.name
return self.id
@lazyproperty
def ad_domain(self):
if self.username.startswith('@'):
return None
if self.platform.category == 'ad':
return self.asset.ad.domain_name
return None
@lazyproperty
def full_username(self):
if self.ad_domain:
return '{}@{}'.format(self.username, self.ad_domain)
return self.username
@lazyproperty
def has_secret(self):