Merge remote-tracking branch 'origin/master' into codex/wechat-mini-program-virtual-payment
# Conflicts: # .hermes/shared-memory/decision-log.md
This commit is contained in:
@@ -237,6 +237,22 @@ pub fn build_system_username(prefix: &str, sequence: u64) -> String {
|
||||
format!("{prefix}_{sequence:08}")
|
||||
}
|
||||
|
||||
pub fn build_wechat_username(display_name: &str, provider_uid: &str) -> String {
|
||||
let normalized_display_name = display_name.trim();
|
||||
let normalized_provider_uid = provider_uid.trim();
|
||||
let fallback_display_name = if normalized_display_name.is_empty() {
|
||||
"微信旅人"
|
||||
} else {
|
||||
normalized_display_name
|
||||
};
|
||||
let fallback_provider_uid = if normalized_provider_uid.is_empty() {
|
||||
"openid"
|
||||
} else {
|
||||
normalized_provider_uid
|
||||
};
|
||||
format!("{fallback_display_name}_{fallback_provider_uid}")
|
||||
}
|
||||
|
||||
// 公开陶泥号是稳定的公开检索键,不替代内部 user_id,仅用于展示、分享与搜索。
|
||||
pub fn build_public_user_code(sequence: u64) -> String {
|
||||
format!("SY-{sequence:08}")
|
||||
|
||||
Reference in New Issue
Block a user