32 lines
547 B
Python
32 lines
547 B
Python
from __future__ import annotations
|
|
|
|
from typing import Literal
|
|
|
|
from pydantic import BaseModel
|
|
from ulid import ULID
|
|
|
|
|
|
class BaseRef(BaseModel):
|
|
"""基础引用模型"""
|
|
|
|
ref_type: str
|
|
ref_id: ULID
|
|
|
|
|
|
class AccountRef(BaseRef):
|
|
"""账户引用"""
|
|
|
|
ref_type: Literal["ACCOUNT"] = "ACCOUNT"
|
|
|
|
|
|
class ChannelRef(BaseRef):
|
|
"""渠道引用"""
|
|
|
|
ref_type: Literal["CHANNEL"] = "CHANNEL"
|
|
|
|
|
|
class TransactionRef(BaseRef):
|
|
"""交易引用"""
|
|
|
|
ref_type: Literal["TRANSACTION"] = "TRANSACTION"
|