package com.example.demo.admin.module.admin;

import com.example.demo.admin.table.AdminUser;
import com.example.demo.common.GlobalRoot;
import pers.jc.sql.SQL;

/**
 * 后台服务-管理员相关
 */
public class AdminService {
    public static AdminService ins = new AdminService();
    private AdminUser superAdmin = null;

    public AdminUser getSuperAdmin() {
        if (superAdmin == null) {
            superAdmin = GlobalRoot.db.selectOne(AdminUser.class, new SQL());
        }
        return superAdmin;
    }
    public void updateSuperAdmin(AdminUser adminUser) {
        GlobalRoot.db.update(adminUser);
        superAdmin = adminUser;
    }
}
