#pragma once
#include "Utils/httplib.h"
#include "Utils/Utils.h"
enum class AuthorityType
{
	None		= 0b00000000000000000000000000000000,
	CreateCard	= 0b00000000000000000000000000000001,
	DisableCard = 0b00000000000000000000000000000010,
	DeleteCard	= 0b00000000000000000000000000000100,
	AddChild	= 0b00000000000000000000000000001000,
};
class User
{
public:
	User() {};
	int Id;
	std::string UserName;
	std::string Pwd;
	DateTime CreateTime;
	std::string LastIP;
	int Level;
	int Parent;
	UINT64 Authority;
	List<int> Products;
	List<int> Childs;
	bool CanCreateCard()
	{
		return (UINT32)AuthorityType::CreateCard & Authority;
	}
	bool CanDisableCard()
	{
		return (UINT32)AuthorityType::DisableCard & Authority;
	}
	bool CanDeleteCard()
	{
		return (UINT32)AuthorityType::DeleteCard & Authority;
	}
	bool CanAddChild()
	{
		return (UINT32)AuthorityType::AddChild & Authority;
	}
};

