from sqlalchemy import select
from sqlalchemy.ext.asyncio import AsyncSession
from module_admin.entity.do.user_do import SysUser
from utils.page_util import PageUtil
from module_admin.entity.vo.test_vo import TestUserNamePage


class TestDao:
    @classmethod
    async def get_user_name(cls, db: AsyncSession, query_paramter: TestUserNamePage):
        query = (
            select(SysUser.user_name)
        )
        # user_name = await db.execute(select(SysUser.user_name))
        user_name = await PageUtil.paginate(db, query, query_paramter.page_num, query_paramter.page_size, True)
        return user_name
