convertGroupDetailsToGroupList.js 1018 B

123456789101112131415161718192021222324
  1. export default function convertGroupDetailsToGroupList(detailsData) {
  2. const groupListData = {};
  3. // 转换重合字段名
  4. groupListData.groupName = detailsData.name;
  5. groupListData.groupId = detailsData.id;
  6. groupListData.maxUsers = detailsData.maxusers;
  7. groupListData.allowInvites = detailsData.allowinvites;
  8. groupListData.affiliationsCount = detailsData.affiliations_count;
  9. //将返回群列表里面的不存在的属性从群详情新增。
  10. groupListData.shieldgroup = detailsData.shieldgroup;
  11. groupListData.affiliations = detailsData.affiliations;
  12. groupListData.mute = detailsData.mute;
  13. groupListData.custom = detailsData.custom;
  14. groupListData.created = detailsData.created;
  15. groupListData.owner = detailsData.owner;
  16. groupListData.membersonly = detailsData.membersonly;
  17. //两个数据结构重合的属性值
  18. groupListData.description = detailsData.description;
  19. groupListData.disabled = detailsData.disabled;
  20. groupListData.public = detailsData.public;
  21. return groupListData;
  22. }