88 lines
3.2 KiB
C++
88 lines
3.2 KiB
C++
#include "precompile.h"
|
|
|
|
#include "typeconvert.h"
|
|
#include "cs_proto.pb.h"
|
|
#include "ss_proto.pb.h"
|
|
|
|
void TypeConvert::Convert(const cs::MFFriendApply& apply_pb, FriendApply& apply)
|
|
{
|
|
apply.idx = apply_pb.idx();
|
|
apply.applyid = apply_pb.applyid();
|
|
apply.sender_id = apply_pb.account_id();
|
|
apply.sender_nickname = apply_pb.nickname();
|
|
apply.sender_avatar_url = apply_pb.avatar_url();
|
|
apply.sender_sex = apply_pb.sex();
|
|
}
|
|
|
|
void TypeConvert::Convert(const FriendApply& apply, cs::MFFriendApply& apply_pb)
|
|
{
|
|
apply_pb.set_idx(apply.idx);
|
|
apply_pb.set_applyid(apply.applyid);
|
|
apply_pb.set_account_id(apply.sender_id);
|
|
apply_pb.set_nickname(apply.nickname);
|
|
apply_pb.set_avatar_url(apply.avatar_url);
|
|
apply_pb.set_sex(apply.sex);
|
|
}
|
|
|
|
void TypeConvert::Convert(const BaseUserData& base_data, ss::MFBaseUserDataDB& base_data_pb)
|
|
{
|
|
base_data_pb.set_account_id(base_data.account_id);
|
|
base_data_pb.set_nickname(base_data.nickname);
|
|
base_data_pb.set_avatar_url(base_data.avatar_url);
|
|
base_data_pb.set_sex(base_data.sex);
|
|
#if 0
|
|
base_data_pb.set_group_id(base_data.group_id);
|
|
#endif
|
|
base_data_pb.set_user_value1(base_data.user_value1);
|
|
base_data_pb.set_user_value2(base_data.user_value2);
|
|
base_data_pb.set_user_value3(base_data.user_value3);
|
|
base_data_pb.set_base_data_version(base_data.base_data_version);
|
|
}
|
|
|
|
void TypeConvert::Convert(const ss::MFBaseUserDataDB& base_data_pb, BaseUserData& base_data)
|
|
{
|
|
base_data.account_id = base_data_pb.account_id();
|
|
base_data.nickname = base_data_pb.nickname();
|
|
base_data.avatar_url = base_data_pb.avatar_url();
|
|
base_data.sex = base_data_pb.sex();
|
|
#if 0
|
|
base_data.group_id = base_data_pb.group_id();
|
|
#endif
|
|
base_data.user_value1 = base_data_pb.user_value1();
|
|
base_data.user_value2 = base_data_pb.user_value2();
|
|
base_data.user_value3 = base_data_pb.user_value3();
|
|
base_data.base_data_version = base_data_pb.base_data_version();
|
|
}
|
|
|
|
void TypeConvert::Convert(const BaseUserData& base_data, cs::MFBaseUserData& base_data_pb)
|
|
{
|
|
base_data_pb.set_account_id(base_data.account_id);
|
|
base_data_pb.set_nickname(base_data.nickname);
|
|
base_data_pb.set_avatar_url(base_data.avatar_url);
|
|
base_data_pb.set_sex(base_data.sex);
|
|
base_data_pb.set__online(base_data.online);
|
|
#if 0
|
|
base_data_pb.set_group_id(base_data.group_id);
|
|
#endif
|
|
base_data_pb.set_user_value1(base_data.user_value1);
|
|
base_data_pb.set_user_value2(base_data.user_value2);
|
|
base_data_pb.set_user_value3(base_data.user_value3);
|
|
base_data_pb.set_base_data_version(base_data.base_data_version);
|
|
}
|
|
|
|
void TypeConvert::Convert(const cs::MFUserTempCustomData& temp_custom_data_pb,
|
|
UserTempCustomData& temp_custom_data)
|
|
{
|
|
temp_custom_data.value1 = temp_custom_data_pb.value1();
|
|
temp_custom_data.value2 = temp_custom_data_pb.value2();
|
|
temp_custom_data.value3 = temp_custom_data_pb.value3();
|
|
}
|
|
|
|
void TypeConvert::Convert(const UserTempCustomData& temp_custom_data,
|
|
cs::MFUserTempCustomData& temp_custom_data_pb)
|
|
{
|
|
temp_custom_data_pb.set_value1(temp_custom_data.value1);
|
|
temp_custom_data_pb.set_value2(temp_custom_data.value2);
|
|
temp_custom_data_pb.set_value3(temp_custom_data.value3);
|
|
}
|