业务更新User所需(企业成员、聊天室群组成员)
This commit is contained in:
24
apps/im_app/lib/domain/entities/company_member.dart
Normal file
24
apps/im_app/lib/domain/entities/company_member.dart
Normal 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'],
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user