from user.user_impl import create_user_impl, login_impl, send_vcode_to_user_impl class User: """ 用户对象 Parameters: uid str 用户ID email str 邮箱 name str 用户名 pwd str 密码 role str 角色 duty str 职责 """ def __init__(self): self.uid = None self.email = None self.name = None self.pwd = None self.role = None class UserManage(User): """ 用户管理 """ def send_vcode_to_user(self): """ 发送验证码 Returns: 发送成功 bool 返回True 发送失败 str 返回异常信息 """ return send_vcode_to_user_impl(self.email) def create_user(self): """ 创建用户 Returns: 创建成功 bool 返回True 创建失败 str 返回异常信息 """ return create_user_impl(self.email, self.name, self.pwd, self.role) def list_user(self): """ 用户信息列表 """ # TODO def disable_user(self): """ 禁用用户 """ # TODO def delete_user(self): """ 删除用户 """ # TODO def manage_role_of_user(self): """ 管理用户角色 """ # TODO class UserOperation(User): """ 用户操作 """ def __init__(self): super().__init__() self.token = None self.block = None self.vcode = None # 登录 def login(self): """ 用户登录 """ return login_impl(self.email, self.pwd, self.vcode)