00001 #pragma once 00002 00003 #include <string> 00004 #include <vector> 00005 00006 using namespace std; 00007 00008 namespace mycq 00009 { 00011 namespace UserType 00012 { 00014 enum Enum 00015 { 00017 SUPER_USER = 0, 00019 NORMAL_USER = 1, 00020 }; 00021 } 00022 00024 class UserInfo 00025 { 00026 public: 00028 string username; 00030 UserType::Enum type; 00031 }; 00032 00034 class LoginUserInfo 00035 { 00036 public: 00038 string username; 00040 UserType::Enum type; 00042 string ip; 00043 }; 00044 00046 00048 class UserManager 00049 { 00050 public: 00056 virtual void createUser(string username, string password, UserType::Enum userType) = 0; 00057 00061 virtual void deleteUser(string username) = 0; 00062 00067 virtual void changePassword(string username, string password) = 0; 00068 00073 virtual void changeUserType(string username, UserType::Enum userType) = 0; 00074 00078 virtual std::vector<UserInfo> getAllUserInfo() = 0; 00079 }; 00080 }