From b4a3aafd1b1e26d22af148ec091b985c3a6e0596 Mon Sep 17 00:00:00 2001 From: tianfeng <769204422@qq.com> Date: Tue, 23 Dec 2025 15:28:36 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=B6=E6=97=8F=E5=88=97=E8=A1=A8=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E6=96=B0=E5=A2=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cmd/famliy/FamilyBaseInfoQryCmd.java | 2 +- .../model/dto/approval/ApprovalFamilyDTO.java | 2 +- .../model/dto/famliy/FamilyBaseInfoDTO.java | 2 +- .../model/dto/famliy/FamilyDetailsDTO.java | 2 +- .../app/family/FamilyRestController.java | 66 ++++++---------- .../app/command/family/FamilyCreateExe.java | 5 +- .../app/command/family/FamilyListExe.java | 79 +++++++++++++++++++ .../command/family/MyFamilyApplyListExe.java | 7 +- .../app/service/family/FamilyServiceImpl.java | 10 +++ .../clientobject/family/FamilyBaseInfoCO.java | 2 +- .../dto/clientobject/family/FamilyListCO.java | 55 +++++++++++++ .../clientobject/family/FamilyUserInfoCO.java | 2 +- .../app/dto/cmd/family/FamilyListCmd.java | 14 ++++ .../app/service/family/FamilyService.java | 6 ++ .../entity/live/assist/FamilyProfile.java | 2 +- .../rds/entity/family/FamilyBaseInfo.java | 2 +- .../impl/FamilyMemberInfoServiceImpl.java | 4 +- 17 files changed, 204 insertions(+), 58 deletions(-) create mode 100644 rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/family/FamilyListExe.java create mode 100644 rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/dto/clientobject/family/FamilyListCO.java create mode 100644 rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/dto/cmd/family/FamilyListCmd.java diff --git a/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/model/cmd/famliy/FamilyBaseInfoQryCmd.java b/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/model/cmd/famliy/FamilyBaseInfoQryCmd.java index 20a1e349..4ea77752 100644 --- a/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/model/cmd/famliy/FamilyBaseInfoQryCmd.java +++ b/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/model/cmd/famliy/FamilyBaseInfoQryCmd.java @@ -36,7 +36,7 @@ public class FamilyBaseInfoQryCmd extends HistoryRangeTimeQryPageCmd { /** * 家族账号. */ - private Long familyAccount; + private String familyAccount; /** * 族长ID. diff --git a/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/model/dto/approval/ApprovalFamilyDTO.java b/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/model/dto/approval/ApprovalFamilyDTO.java index 60594bbe..5893cf90 100644 --- a/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/model/dto/approval/ApprovalFamilyDTO.java +++ b/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/model/dto/approval/ApprovalFamilyDTO.java @@ -29,7 +29,7 @@ public class ApprovalFamilyDTO implements Serializable { /** * 家族账号 */ - private Long familyAccount; + private String familyAccount; /** diff --git a/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/model/dto/famliy/FamilyBaseInfoDTO.java b/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/model/dto/famliy/FamilyBaseInfoDTO.java index 9d2f0196..189467c2 100644 --- a/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/model/dto/famliy/FamilyBaseInfoDTO.java +++ b/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/model/dto/famliy/FamilyBaseInfoDTO.java @@ -42,7 +42,7 @@ public class FamilyBaseInfoDTO implements Serializable { * 家族账号. */ @JsonSerialize(using = ToStringSerializer.class) - private Long familyAccount; + private String familyAccount; /** * 家族头像. diff --git a/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/model/dto/famliy/FamilyDetailsDTO.java b/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/model/dto/famliy/FamilyDetailsDTO.java index 04edefe7..b28ce901 100644 --- a/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/model/dto/famliy/FamilyDetailsDTO.java +++ b/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/model/dto/famliy/FamilyDetailsDTO.java @@ -37,7 +37,7 @@ public class FamilyDetailsDTO implements Serializable { * 家族账号. */ @JsonSerialize(using = ToStringSerializer.class) - private Long familyAccount; + private String familyAccount; /** * 家族头像. diff --git a/rc-service/rc-service-other/other-adapter/src/main/java/com/red/circle/other/adapter/app/family/FamilyRestController.java b/rc-service/rc-service-other/other-adapter/src/main/java/com/red/circle/other/adapter/app/family/FamilyRestController.java index 06bae14d..574ce1c4 100644 --- a/rc-service/rc-service-other/other-adapter/src/main/java/com/red/circle/other/adapter/app/family/FamilyRestController.java +++ b/rc-service/rc-service-other/other-adapter/src/main/java/com/red/circle/other/adapter/app/family/FamilyRestController.java @@ -8,6 +8,7 @@ import com.red.circle.other.app.dto.clientobject.family.FamilyBaseInfoCO; import com.red.circle.other.app.dto.clientobject.family.FamilyCreateRulesCO; import com.red.circle.other.app.dto.clientobject.family.FamilyLeaderboardCO; import com.red.circle.other.app.dto.clientobject.family.FamilyLevelParentCacheCO; +import com.red.circle.other.app.dto.clientobject.family.FamilyListCO; import com.red.circle.other.app.dto.clientobject.family.FamilyMemberCO; import com.red.circle.other.app.dto.clientobject.family.FamilyMsgListCO; import com.red.circle.other.app.dto.clientobject.family.MyFamilyApplyCO; @@ -23,6 +24,7 @@ import com.red.circle.other.app.dto.cmd.family.FamilyGrantUserRoleCmd; import com.red.circle.other.app.dto.cmd.family.FamilyGroupChatPayCheckCmd; import com.red.circle.other.app.dto.cmd.family.FamilyGroupChatQueryCmd; import com.red.circle.other.app.dto.cmd.family.FamilyInfoEditCmd; +import com.red.circle.other.app.dto.cmd.family.FamilyListCmd; import com.red.circle.other.app.dto.cmd.family.FamilyMemberListCmd; import com.red.circle.other.app.dto.cmd.family.FamilyMemberListQueryCmd; import com.red.circle.other.app.dto.cmd.family.FamilyMessageHandleCmd; @@ -33,6 +35,7 @@ import com.red.circle.other.app.dto.cmd.family.FamilyRemoveUserCmd; import com.red.circle.other.app.dto.cmd.family.FamilyUserInfoQueryCmd; import com.red.circle.other.app.dto.cmd.family.ReceiveFamilyAwardCmd; import com.red.circle.other.app.service.family.FamilyService; +import com.red.circle.framework.dto.PageResult; import java.math.BigDecimal; import java.util.List; import lombok.RequiredArgsConstructor; @@ -61,6 +64,14 @@ public class FamilyRestController extends BaseController { private final FamilyService familyService; + /** + * 家族列表. + */ + @GetMapping("/list") + public PageResult familyList(FamilyListCmd cmd) { + return familyService.familyList(cmd); + } + /** * 创建家族. */ @@ -119,20 +130,7 @@ public class FamilyRestController extends BaseController { } /** - * 家族族长信息(与家族成员信息 数据结构一致). - * - * @eo.name 家族族长信息(与家族成员信息 数据结构一致). - * @eo.url /admin - * @eo.method get - * @eo.request-type formdata - */ - @GetMapping("/admin") - public FamilyMemberCO getAdmin(FamilyAdminQueryCmd cmd) { - return familyService.getAdmin(cmd); - } - - /** - * 家族成员信息.(旧:list_member) + * 家族成员信息 */ @GetMapping("/list/member") public List listMember(FamilyMemberListQueryCmd cmd) { @@ -140,25 +138,7 @@ public class FamilyRestController extends BaseController { } /** - * 家族成员信息-不分页. - * @eo.name 家族成员信息. - * @eo.url /members - * @eo.method get - * @eo.request-type formdata - */ - @GetMapping("/members") - public List getMembers(FamilyMemberListCmd cmd) { - return familyService.getMembers(cmd); - } - - - /** - * 授权用户家族权限.(旧:grant_user_role) - * - * @eo.name 授权用户家族权限. - * @eo.url /grant-user-role - * @eo.method post - * @eo.request-type json + * 授权用户家族权限 */ @PostMapping("/grant-user-role") public void grantUserRole(@RequestBody FamilyGrantUserRoleCmd cmd) { @@ -186,7 +166,7 @@ public class FamilyRestController extends BaseController { * @eo.method get * @eo.request-type formdata */ - @GetMapping("/list/level-config") +// @GetMapping("/list/level-config") public List listLevelConfig(AppExtCommand cmd) { return familyService.listLevelConfig(cmd); } @@ -199,7 +179,7 @@ public class FamilyRestController extends BaseController { * @eo.method get * @eo.request-type formdata */ - @GetMapping("/list/online-room") +// @GetMapping("/list/online-room") public List listOnlineRoom(@Validated FamilyOnlineRoomQueryCmd cmd) { return familyService.listOnlineRoom(cmd); } @@ -238,7 +218,7 @@ public class FamilyRestController extends BaseController { * @eo.method get * @eo.request-type formdata */ - @GetMapping("/member-user-info") +// @GetMapping("/member-user-info") public FamilyUserInfoCO memberUserInfo(@Validated FamilyUserInfoQueryCmd cmd) { return familyService.memberUserInfo(cmd); } @@ -251,7 +231,7 @@ public class FamilyRestController extends BaseController { * @eo.method get * @eo.request-type formdata */ - @GetMapping("/trigger-daily-task") +// @GetMapping("/trigger-daily-task") public void triggerDailyTask(FamilyDailyTaskCmd cmd) { familyService.triggerDailyTask(cmd); } @@ -264,7 +244,7 @@ public class FamilyRestController extends BaseController { * @eo.method get * @eo.request-type formdata */ - @GetMapping("/family-create-rule") +// @GetMapping("/family-create-rule") public FamilyCreateRulesCO familyCreateRule(AppExtCommand cmd) { return familyService.familyCreateRule(cmd); } @@ -277,7 +257,7 @@ public class FamilyRestController extends BaseController { * @eo.method get * @eo.request-type formdata */ - @GetMapping("/my-family-reward") +// @GetMapping("/my-family-reward") public FamilyRewardCO myFamilyReward(AppExtCommand cmd) { return familyService.myFamilyReward(cmd); } @@ -290,7 +270,7 @@ public class FamilyRestController extends BaseController { * @eo.method post * @eo.request-type json */ - @PostMapping("/receive-award") +// @PostMapping("/receive-award") public void receiveAward(@RequestBody @Validated ReceiveFamilyAwardCmd cmd) { familyService.receiveFamilyAward(cmd); } @@ -303,7 +283,7 @@ public class FamilyRestController extends BaseController { * @eo.method post * @eo.request-type json */ - @PostMapping("/purchasing/group-chat") +// @PostMapping("/purchasing/group-chat") public BigDecimal purchasingFamilyGroupChat(@RequestBody @Validated FamilyGroupChatQueryCmd cmd) { return familyService.purchasingFamilyGroupChat(cmd); } @@ -311,7 +291,7 @@ public class FamilyRestController extends BaseController { /** * 解散-家族群聊. */ - @PostMapping("/dismiss/group-chat") +// @PostMapping("/dismiss/group-chat") public void dismissFamilyGroupChat(@RequestBody FamilyGroupChatQueryCmd cmd) { familyService.dismissFamilyGroupChat(cmd); @@ -325,7 +305,7 @@ public class FamilyRestController extends BaseController { * @eo.method get * @eo.request-type json */ - @GetMapping("/group/chat/exists") +// @GetMapping("/group/chat/exists") public Boolean getFamilyGroupChatIsPay(@Validated FamilyGroupChatPayCheckCmd cmd) { return familyService.getFamilyGroupChatIsPay(cmd); } diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/family/FamilyCreateExe.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/family/FamilyCreateExe.java index 6faec7c0..a97ee416 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/family/FamilyCreateExe.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/family/FamilyCreateExe.java @@ -12,6 +12,7 @@ import com.red.circle.framework.core.response.ResponseErrorCode; import com.red.circle.other.app.common.account.FamilyAccountShortProduction; import com.red.circle.other.app.dto.cmd.family.FamilyCreateCmd; import com.red.circle.other.domain.gateway.user.UserProfileGateway; +import com.red.circle.other.domain.model.user.UserProfile; import com.red.circle.other.infra.common.family.FamilyCommon; import com.red.circle.other.infra.database.rds.entity.family.FamilyBaseInfo; import com.red.circle.other.infra.database.rds.entity.family.FamilyCreateRules; @@ -136,9 +137,11 @@ public class FamilyCreateExe { } private void createFamily(FamilyCreateCmd cmd, Long levelConfigId, Long familyId) { + UserProfile userProfile = userProfileGateway.getByUserId(cmd.getReqUserId()); + familyBaseInfoService.save(new FamilyBaseInfo() .setId(familyId) - .setFamilyAccount(shortAccountManager.getFamilyAccount()) + .setFamilyAccount(userProfile.getAccount()) .setFamilyAvatar(ResponseAssert.requiredSuccess( ossServiceClient .processImgSaveAsCompressZoom(cmd.getFamilyAvatar(), ImageSizeConst.COVER_HEIGHT) diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/family/FamilyListExe.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/family/FamilyListExe.java new file mode 100644 index 00000000..9252413d --- /dev/null +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/family/FamilyListExe.java @@ -0,0 +1,79 @@ +package com.red.circle.other.app.command.family; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.red.circle.framework.dto.PageResult; +import com.red.circle.framework.mybatis.entity.TimestampBaseEntity; +import com.red.circle.other.app.dto.clientobject.family.FamilyListCO; +import com.red.circle.other.app.dto.cmd.family.FamilyListCmd; +import com.red.circle.other.infra.database.rds.entity.family.FamilyBaseInfo; +import com.red.circle.other.infra.database.rds.entity.family.FamilyLevelConfig; +import com.red.circle.other.infra.database.rds.service.family.FamilyBaseInfoService; +import com.red.circle.other.infra.database.rds.service.family.FamilyLevelConfigService; +import com.red.circle.other.infra.database.rds.service.family.FamilyMemberInfoService; +import com.red.circle.tool.core.collection.CollectionUtils; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Component; + +/** + * 家族列表查询. + */ +@Component +@RequiredArgsConstructor +public class FamilyListExe { + + private final FamilyBaseInfoService familyBaseInfoService; + private final FamilyLevelConfigService familyLevelConfigService; + private final FamilyMemberInfoService familyMemberInfoService; + + public PageResult execute(FamilyListCmd cmd) { + Page page = new Page<>(); + IPage baseInfoIPage = familyBaseInfoService.page(page, + Wrappers.lambdaQuery().orderByDesc(TimestampBaseEntity::getCreateTime)); + + PageResult pageResult = new PageResult<>(); + pageResult.setCurrent(page.getCurrent()); + pageResult.setSize(page.getSize()); + pageResult.setTotal(baseInfoIPage.getTotal()); + + if (CollectionUtils.isEmpty(baseInfoIPage.getRecords())) { + return PageResult.newPageResult(0); + } + + List familyList = baseInfoIPage.getRecords(); + + Set familyIds = familyList.stream() + .map(FamilyBaseInfo::getId) + .collect(Collectors.toSet()); + + Set levelIds = familyList.stream() + .map(FamilyBaseInfo::getFamilyLevelId) + .collect(Collectors.toSet()); + + Map memberCountMap = familyMemberInfoService.mapMemberCountByFamilyIds(familyIds); + Map levelConfigMap = familyLevelConfigService.mapByIds(levelIds); + + List records = familyList.stream().map(family -> { + FamilyLevelConfig levelConfig = levelConfigMap.get(family.getFamilyLevelId()); + Long currentMember = memberCountMap.getOrDefault(family.getId(), 0L); + + return new FamilyListCO() + .setFamilyId(family.getId()) + .setFamilyAccount(family.getFamilyAccount()) + .setFamilyAvatar(family.getFamilyAvatar()) + .setFamilyName(family.getFamilyName()) + .setFamilyIntro(family.getFamilyIntro()) + .setFamilyNotice(family.getFamilyNotice()) + .setCurrentMember(currentMember.intValue()) + .setMaxMember(levelConfig != null ? levelConfig.getMaxMember() : 0); + }).toList(); + + pageResult.setRecords(records); + return pageResult; + } +} diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/family/MyFamilyApplyListExe.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/family/MyFamilyApplyListExe.java index 6bc3dd99..b01a66af 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/family/MyFamilyApplyListExe.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/family/MyFamilyApplyListExe.java @@ -13,10 +13,8 @@ import com.red.circle.other.inner.enums.FamilyMessageStatusEnum; import com.red.circle.other.inner.model.dto.famliy.FamilyDetailsDTO; import com.red.circle.tool.core.collection.CollectionUtils; import com.red.circle.tool.core.date.TimestampUtils; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; + +import java.util.*; import java.util.stream.Collectors; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Component; @@ -37,6 +35,7 @@ public class MyFamilyApplyListExe { List msgList = familyMessageService.query() .eq(FamilyMessage::getSenderUser, cmd.getReqUserId()) .lt(Objects.nonNull(cmd.getLastId()), FamilyMessage::getId, cmd.getLastId()) + .in(FamilyMessage::getStatus, Arrays.asList(FamilyMessageStatusEnum.PENDING.getCode(), FamilyMessageStatusEnum.REJECTED.getCode())) .orderByDesc(FamilyMessage::getId) .last(PageConstant.DEFAULT_LIMIT) .list(); diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/service/family/FamilyServiceImpl.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/service/family/FamilyServiceImpl.java index 3d1aae80..7d7983c9 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/service/family/FamilyServiceImpl.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/service/family/FamilyServiceImpl.java @@ -26,10 +26,12 @@ import com.red.circle.other.app.command.family.FamilyUserExitExe; import com.red.circle.other.app.command.family.FamilyUserInfoExe; import com.red.circle.other.app.command.family.ReceiveFamilyAwardExe; import com.red.circle.other.app.command.family.MyFamilyApplyListExe; +import com.red.circle.other.app.command.family.FamilyListExe; import com.red.circle.other.app.dto.clientobject.family.FamilyBaseInfoCO; import com.red.circle.other.app.dto.clientobject.family.FamilyCreateRulesCO; import com.red.circle.other.app.dto.clientobject.family.FamilyLeaderboardCO; import com.red.circle.other.app.dto.clientobject.family.FamilyLevelParentCacheCO; +import com.red.circle.other.app.dto.clientobject.family.FamilyListCO; import com.red.circle.other.app.dto.clientobject.family.FamilyMemberCO; import com.red.circle.other.app.dto.clientobject.family.FamilyMsgListCO; import com.red.circle.other.app.dto.clientobject.family.MyFamilyApplyCO; @@ -45,6 +47,7 @@ import com.red.circle.other.app.dto.cmd.family.FamilyGrantUserRoleCmd; import com.red.circle.other.app.dto.cmd.family.FamilyGroupChatPayCheckCmd; import com.red.circle.other.app.dto.cmd.family.FamilyGroupChatQueryCmd; import com.red.circle.other.app.dto.cmd.family.FamilyInfoEditCmd; +import com.red.circle.other.app.dto.cmd.family.FamilyListCmd; import com.red.circle.other.app.dto.cmd.family.FamilyMemberListCmd; import com.red.circle.other.app.dto.cmd.family.FamilyMemberListQueryCmd; import com.red.circle.other.app.dto.cmd.family.FamilyMessageHandleCmd; @@ -54,6 +57,7 @@ import com.red.circle.other.app.dto.cmd.family.FamilyOnlineRoomQueryCmd; import com.red.circle.other.app.dto.cmd.family.FamilyRemoveUserCmd; import com.red.circle.other.app.dto.cmd.family.FamilyUserInfoQueryCmd; import com.red.circle.other.app.dto.cmd.family.ReceiveFamilyAwardCmd; +import com.red.circle.framework.dto.PageResult; import java.math.BigDecimal; import java.util.List; import java.util.Objects; @@ -99,6 +103,7 @@ public class FamilyServiceImpl implements FamilyService { private final FamilyMemberIdGetUserIdExe familyMemberIdGetUserIdExe; private final FamilyPurchasingGroupChatExe familyPurchasingGroupChatExe; private final MyFamilyApplyListExe myFamilyApplyListExe; + private final FamilyListExe familyListExe; private final DistributedLockUtil distributedLockUtil; @Override @@ -236,4 +241,9 @@ public class FamilyServiceImpl implements FamilyService { return myFamilyApplyListExe.execute(cmd); } + @Override + public PageResult familyList(FamilyListCmd cmd) { + return familyListExe.execute(cmd); + } + } diff --git a/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/dto/clientobject/family/FamilyBaseInfoCO.java b/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/dto/clientobject/family/FamilyBaseInfoCO.java index 14a70c06..4f8a4a7e 100644 --- a/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/dto/clientobject/family/FamilyBaseInfoCO.java +++ b/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/dto/clientobject/family/FamilyBaseInfoCO.java @@ -35,7 +35,7 @@ public class FamilyBaseInfoCO extends ClientObject { /** * 家族账号. */ - private Long familyAccount; + private String familyAccount; /** * 家族头像. diff --git a/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/dto/clientobject/family/FamilyListCO.java b/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/dto/clientobject/family/FamilyListCO.java new file mode 100644 index 00000000..afe7d484 --- /dev/null +++ b/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/dto/clientobject/family/FamilyListCO.java @@ -0,0 +1,55 @@ +package com.red.circle.other.app.dto.clientobject.family; + +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * 家族列表信息. + */ +@Data +@Accessors(chain = true) +public class FamilyListCO { + + /** + * 家族id. + */ + @JsonSerialize(using = ToStringSerializer.class) + private Long familyId; + + /** + * 家族账号. + */ + private String familyAccount; + + /** + * 家族头像. + */ + private String familyAvatar; + + /** + * 家族名称. + */ + private String familyName; + + /** + * 家族介绍. + */ + private String familyIntro; + + /** + * 家族公告. + */ + private String familyNotice; + + /** + * 家族当前成员数. + */ + private Integer currentMember; + + /** + * 最大成员数. + */ + private Integer maxMember; +} diff --git a/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/dto/clientobject/family/FamilyUserInfoCO.java b/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/dto/clientobject/family/FamilyUserInfoCO.java index 240491c2..0717be7a 100644 --- a/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/dto/clientobject/family/FamilyUserInfoCO.java +++ b/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/dto/clientobject/family/FamilyUserInfoCO.java @@ -33,7 +33,7 @@ public class FamilyUserInfoCO extends ClientObject { /** * 家族账号. */ - private Long familyAccount; + private String familyAccount; /** * 家族头像. diff --git a/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/dto/cmd/family/FamilyListCmd.java b/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/dto/cmd/family/FamilyListCmd.java new file mode 100644 index 00000000..77ea9a96 --- /dev/null +++ b/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/dto/cmd/family/FamilyListCmd.java @@ -0,0 +1,14 @@ +package com.red.circle.other.app.dto.cmd.family; + +import com.red.circle.common.business.dto.PageQueryCmd; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 家族列表查询. + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class FamilyListCmd extends PageQueryCmd { + +} diff --git a/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/service/family/FamilyService.java b/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/service/family/FamilyService.java index 25252209..a6eb767f 100644 --- a/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/service/family/FamilyService.java +++ b/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/service/family/FamilyService.java @@ -2,6 +2,7 @@ package com.red.circle.other.app.service.family; import com.red.circle.common.business.dto.cmd.AppExtCommand; +import com.red.circle.framework.dto.PageResult; import com.red.circle.other.app.dto.clientobject.family.*; import com.red.circle.other.app.dto.clientobject.room.RoomVoiceProfileCO; import com.red.circle.other.app.dto.cmd.family.*; @@ -139,4 +140,9 @@ public interface FamilyService { * 我的家族申请列表. */ List myApplyList(MyFamilyApplyListCmd cmd); + + /** + * 家族列表. + */ + PageResult familyList(FamilyListCmd cmd); } diff --git a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/mongo/entity/live/assist/FamilyProfile.java b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/mongo/entity/live/assist/FamilyProfile.java index 999510dc..d569219b 100644 --- a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/mongo/entity/live/assist/FamilyProfile.java +++ b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/mongo/entity/live/assist/FamilyProfile.java @@ -29,7 +29,7 @@ public class FamilyProfile implements Serializable { /** * 家族account. */ - Long familyAccount; + String familyAccount; /** diff --git a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/entity/family/FamilyBaseInfo.java b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/entity/family/FamilyBaseInfo.java index 74e7f655..036a660c 100644 --- a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/entity/family/FamilyBaseInfo.java +++ b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/entity/family/FamilyBaseInfo.java @@ -43,7 +43,7 @@ public class FamilyBaseInfo extends TimestampBaseEntity { * 家族账号. */ @TableField("family_account") - private Long familyAccount; + private String familyAccount; /** * 家族头像. diff --git a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/service/family/impl/FamilyMemberInfoServiceImpl.java b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/service/family/impl/FamilyMemberInfoServiceImpl.java index 4d58a72a..e4759cd6 100644 --- a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/service/family/impl/FamilyMemberInfoServiceImpl.java +++ b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/service/family/impl/FamilyMemberInfoServiceImpl.java @@ -90,7 +90,6 @@ public class FamilyMemberInfoServiceImpl extends @Override public Integer getFamilyMemberCount(Long familyId) { return Optional.ofNullable(query().eq(FamilyMemberInfo::getFamilyId, familyId) - //.in(FamilyMemberInfo::getMemberRole, "ADMIN","MEMBER") .count()) .map(Long::intValue) .orElse(0); @@ -104,7 +103,8 @@ public class FamilyMemberInfoServiceImpl extends return Maps.newHashMap(); } - return Optional.ofNullable(query().in(FamilyMemberInfo::getFamilyId, familyIds).list()) + return Optional.ofNullable(query().in(FamilyMemberInfo::getFamilyId, familyIds) + .select(FamilyMemberInfo::getFamilyId).list()) .map(members -> members.stream() .collect(Collectors.groupingBy(FamilyMemberInfo::getFamilyId, Collectors.counting()))) .orElse(Maps.newHashMap());