user.py 645 Bytes
Newer Older
Weizhi Cui's avatar
Weizhi Cui committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
# @Version     : Python 3.11.4
# @Software    : Sublime Text 4
# @Author      : StudentCWZ
# @Email       : StudentCWZ@outlook.com
# @Date        : 2023/10/29 00:03
# @File        : user.py
# @Description :
"""

from application.dao import UserDao


class UserService:

    @classmethod
    def get_all_users(cls):
        return UserDao.get_all()

    @classmethod
    def get_user_by_id(cls, user_id: int):
        return UserDao.get_by_id(user_id)

    @classmethod
    def create_user(cls, username: str, password: str, email: str):
        return UserDao.create(username, password, email)