#!/usr/bin/env python3
# -*- coding: utf-8 -*-

from fastapi import APIRouter, Request, Depends
from database import get_db
from sqlalchemy.orm import Session
from models import *
import json
from common.auth_user import *

router = APIRouter()

@router.get('/getInfo')
async def getInfo(request: Request,db: Session = Depends(get_db), user: AuthUser = Depends(get_auth_user)):
    return {
    "code": 200,
    "msg": "操作成功",
    "data": {
        "user": {
            "userId": 1,
            "tenantId": "000000",
            "deptId": 103,
            "userName": "admin",
            "nickName": "疯狂的狮子Li",
            "userType": "sys_user",
            "email": "crazyLionLi@163.com",
            "phonenumber": "15888888888",
            "sex": "1",
            "avatar": "http://43.138.9.96:9000/ruoyi/2024/08/07/ecee69404ef2416c9505a4d8803096a1.jpeg",
            "status": "0",
            "loginIp": "223.74.44.187",
            "loginDate": "2024-08-07 21:22:25",
            "remark": "管理员",
            "createTime": "2024-05-20 13:16:22",
            "deptName": "研发部门",
            "roles": [
                {
                    "roleId": 1,
                    "roleName": "超级管理员",
                    "roleKey": "superadmin",
                    "roleSort": 1,
                    "dataScope": "1",
                    "menuCheckStrictly": None,
                    "deptCheckStrictly": None,
                    "status": "0",
                    "remark": None,
                    "createTime": None,
                    "flag": False,
                    "superAdmin": True
                }
            ],
            "roleIds": None,
            "postIds": None,
            "roleId": None
        },
        "permissions": [
            "*:*:*"
        ],
        "roles": [
            "superadmin"
        ]
    }
}


@router.get('/deptTree')
async def deptTree(request: Request,db: Session = Depends(get_db), user: AuthUser = Depends(get_auth_user)):
    pass


@router.get('/list')
async def userlist(request: Request,db: Session = Depends(get_db), user: AuthUser = Depends(get_auth_user)):
    pass


