Android里面AVIMTypedMessage声明为:
public abstract class AVIMTypedMessage extends AVIMMessage {
public AVIMTypedMessage();
public int getMessageType();
@Override
public final String getContent();
@Override
public final void setContent(String content);
}
为什么不声明一个Map getAttrs() / void setAttrs(Map attr); 方法
像AVIMTextMessage、AVIMFileMessage等子类都声明了attrs的方法。为什么不在基类上统一声明,而要单独声明。
对应IOS的SDK
@interface AVIMTypedMessage : AVIMMessage
@property(nonatomic) AVIMMessageMediaType mediaType;//消息类型,可自定义
@property(nonatomic, strong) NSString *text; // 消息文本
@property(nonatomic, strong) NSDictionary *attributes;// 自定义属性
@property(nonatomic, strong, readonly) AVFile *file; // 附件
@property(nonatomic, strong, readonly) AVGeoPoint *location; // 位置
@end
建议统一下。
-
创建时间
15年8月12日
-
最后回复
15年8月18日
-
1
回复
-
867
浏览
-
2
用户