Files

25 lines
833 B
Dart
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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'],
);
}