16 lines
469 B
Python
16 lines
469 B
Python
from app.common.context import current_admin_id
|
|
from app.exception.err_exception import ErrException
|
|
from app.lib.response.admin_return import AdminReturn
|
|
|
|
|
|
class BaseAdminService:
|
|
def __init__(self, admin_return: AdminReturn) -> None:
|
|
self.admin_return = admin_return
|
|
|
|
@property
|
|
def admin_id(self) -> int:
|
|
admin_id = current_admin_id.get()
|
|
if admin_id <= 0:
|
|
raise ErrException("账户不存在")
|
|
return admin_id
|