package jj.tech.paolu.biz.webadmin.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import jj.tech.paolu.config.enums.UserType;
import jj.tech.paolu.repository.mybatis.dao.SysAdminMapper;
import jj.tech.paolu.repository.mybatis.entity.SysAdmin;
@Service
public class SuperSysAdminComponent {
	public static String id="1";
	
	@Autowired
	SysAdminMapper sysAdminMapper;
	
	

	public static boolean isSystemAdmin(SysAdmin user){
		return user.getId().equalsIgnoreCase(id);
	}

	public boolean isOrganizationAdmin(SysAdmin user){
		return user.getType().equals(UserType.ORG_ADMIN.getCode());

	}
	
	public SysAdmin getSystemAdminUser(){
		return sysAdminMapper.selectByPrimaryKey("1").get();
	}

}
