-
Notifications
You must be signed in to change notification settings - Fork 0
/
user.model
39 lines (33 loc) · 828 Bytes
/
user.model
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
struct user_model {
unsigned id;
<<<<<<< HEAD
std::string name;
std::string display_name;
};
std::string user_model_name_key(unsigned id)
{
std::ostringstream K;
K << "movepoint.ru:user:" << id << ":name";
return K.str();
}
std::string get_user_by_name(const std::string &name)
{
auto redis = get_redis();
return redis.command<std::string>("get", user_model_name_key(id).c_str());
}
std::string get_user_name(long long id)
{
auto redis = get_redis();
return redis.command<std::string>("get", user_model_name_key(id).c_str());
}
void set_user_name(unsigned id, const std::string &name)
{
auto redis = get_redis();
redis.set(user_model_name_key(id), name);
}
=======
std::string username;
std::string display_name;
};
>>>>>>> a4e2e06b81c5dcabd220f3eeb74d4814fe7bd244
// vim: syntax=cpp