feat: 用户信息增加别名

This commit is contained in:
HuChundong 2025-04-02 00:32:25 +08:00
parent 59bccbb931
commit 72361fe932
4 changed files with 8 additions and 3 deletions

View File

@ -1,4 +1,4 @@
#pragma once #pragma once
#include <map> #include <map>
#include <string> #include <string>
@ -55,6 +55,7 @@ typedef struct {
string name; string name;
string mobile; string mobile;
string home; string home;
string alias;
} UserInfo_t; } UserInfo_t;
typedef struct { typedef struct {

View File

@ -1,4 +1,4 @@
syntax = "proto3"; syntax = "proto3";
package wcf; package wcf;
option java_package = "com.iamteer"; option java_package = "com.iamteer";
@ -178,6 +178,7 @@ message UserInfo
string name = 2; // string name = 2; //
string mobile = 3; // string mobile = 3; //
string home = 4; // / string home = 4; // /
string alias = 5; // wxid
} }
message DecPath message DecPath

View File

@ -82,6 +82,7 @@ UserInfo_t get_user_info()
ui.home = get_home_path().generic_string(); ui.home = get_home_path().generic_string();
ui.name = get_string_value(service_addr, OsAcc::NAME); ui.name = get_string_value(service_addr, OsAcc::NAME);
ui.mobile = get_string_value(service_addr, OsAcc::MOBILE); ui.mobile = get_string_value(service_addr, OsAcc::MOBILE);
ui.alias = get_string_value(service_addr, OsAcc::ALIAS);
return ui; return ui;
} }
@ -104,6 +105,7 @@ bool rpc_get_user_info(uint8_t *out, size_t *len)
rsp.msg.ui.name = (char *)ui.name.c_str(); rsp.msg.ui.name = (char *)ui.name.c_str();
rsp.msg.ui.mobile = (char *)ui.mobile.c_str(); rsp.msg.ui.mobile = (char *)ui.mobile.c_str();
rsp.msg.ui.home = (char *)ui.home.c_str(); rsp.msg.ui.home = (char *)ui.home.c_str();
rsp.msg.ui.alias = (char *)ui.alias.c_str();
}); });
} }

View File

@ -1,4 +1,4 @@
#pragma once #pragma once
#include <cstdint> #include <cstdint>
@ -13,6 +13,7 @@ namespace Account
constexpr uint64_t NAME = 0x1E8; // 昵称 constexpr uint64_t NAME = 0x1E8; // 昵称
constexpr uint64_t MOBILE = 0x128; // 手机号 constexpr uint64_t MOBILE = 0x128; // 手机号
constexpr uint64_t LOGIN = 0x7F8; // 登录状态 constexpr uint64_t LOGIN = 0x7F8; // 登录状态
constexpr uint64_t ALIAS = 0x108; // 修改后的WXID
} }
namespace Chatroom namespace Chatroom