added CommunityModerator and CommunityFollower views
This commit is contained in:
parent
f0bfdba132
commit
3aa92f695d
|
@ -84,3 +84,90 @@ class CommunityView {
|
|||
factory CommunityView.fromJson(Map<String, dynamic> json) =>
|
||||
_$CommunityViewFromJson(json);
|
||||
}
|
||||
|
||||
|
||||
/// based on https://github.com/LemmyNet/lemmy/blob/464ea862b10fa7b226b2550268e40d8e685a939c/server/lemmy_db/src/community_view.rs#L336
|
||||
@JsonSerializable(fieldRename: FieldRename.snake, createToJson: false)
|
||||
class CommunityFollowerView {
|
||||
final int id;
|
||||
final int communityId;
|
||||
final int userId;
|
||||
final DateTime published;
|
||||
final String userActorId;
|
||||
final bool userLocal;
|
||||
final String userName;
|
||||
|
||||
/// can be null
|
||||
final String userPreferredUsername;
|
||||
|
||||
/// can be null
|
||||
final String avatar;
|
||||
final String communityActorId;
|
||||
final bool communityLocal;
|
||||
final String communityName;
|
||||
|
||||
/// can be null
|
||||
final String communityIcon;
|
||||
|
||||
const CommunityFollowerView({
|
||||
this.id,
|
||||
this.communityId,
|
||||
this.userId,
|
||||
this.published,
|
||||
this.userActorId,
|
||||
this.userLocal,
|
||||
this.userName,
|
||||
this.userPreferredUsername,
|
||||
this.avatar,
|
||||
this.communityActorId,
|
||||
this.communityLocal,
|
||||
this.communityName,
|
||||
this.communityIcon,
|
||||
});
|
||||
|
||||
factory CommunityFollowerView.fromJson(Map<String, dynamic> json) =>
|
||||
_$CommunityFollowerViewFromJson(json);
|
||||
}
|
||||
|
||||
/// based on https://github.com/LemmyNet/lemmy/blob/464ea862b10fa7b226b2550268e40d8e685a939c/server/lemmy_db/src/community_view.rs#L298
|
||||
@JsonSerializable(fieldRename: FieldRename.snake, createToJson: false)
|
||||
class CommunityModeratorView {
|
||||
final int id;
|
||||
final int communityId;
|
||||
final int userId;
|
||||
final DateTime published;
|
||||
final String userActorId;
|
||||
final bool userLocal;
|
||||
final String userName;
|
||||
|
||||
/// can be null
|
||||
final String userPreferredUsername;
|
||||
|
||||
/// can be null
|
||||
final String avatar;
|
||||
final String communityActorId;
|
||||
final bool communityLocal;
|
||||
final String communityName;
|
||||
|
||||
/// can be null
|
||||
final String communityIcon;
|
||||
|
||||
const CommunityModeratorView({
|
||||
this.id,
|
||||
this.communityId,
|
||||
this.userId,
|
||||
this.published,
|
||||
this.userActorId,
|
||||
this.userLocal,
|
||||
this.userName,
|
||||
this.userPreferredUsername,
|
||||
this.avatar,
|
||||
this.communityActorId,
|
||||
this.communityLocal,
|
||||
this.communityName,
|
||||
this.communityIcon,
|
||||
});
|
||||
|
||||
factory CommunityModeratorView.fromJson(Map<String, dynamic> json) =>
|
||||
_$CommunityModeratorViewFromJson(json);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue