业务更新User所需(企业成员、聊天室群组成员)

This commit is contained in:
Happi (哈比)
2026-03-09 19:15:51 +08:00
parent c278d1329e
commit 8f77a14818
22 changed files with 1030 additions and 238 deletions

View File

@@ -0,0 +1,24 @@
import 'package:im_app/domain/entities/user.dart';
/// 企业成员的部分 [User] 表示,数据来源于企业成员接口。
///
/// 企业 API 返回的用户信息极为精简,仅包含身份、显示名称和在线状态。
/// 如需完整用户信息,请通过用户详情接口获取完整的 [User]。
///
/// 注意企业 API 的字段名与标准用户接口不同:
/// - `user_id` → [uid] (非 `uid`
/// - `name` → [nickname] (非 `nickname`
class CompanyMember extends User {
const CompanyMember({
required super.uid,
super.nickname,
super.lastOnline,
super.requireUpsert = true,
});
factory CompanyMember.fromJson(Map<String, dynamic> json) => CompanyMember(
uid: json['user_id'] as int,
nickname: json['name'],
lastOnline: json['last_online'],
);
}