|
@@ -20,6 +20,7 @@ import javax.annotation.Resource;
|
|
|
import java.util.Arrays;
|
|
import java.util.Arrays;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
|
|
+import java.util.Objects;
|
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -364,22 +365,43 @@ public class FamilyController {
|
|
|
}
|
|
}
|
|
|
return familyService.deleteComment(momentsRequest.getCommentId());
|
|
return familyService.deleteComment(momentsRequest.getCommentId());
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- // TODO 自己发的家族圈列表.
|
|
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 自己发的家族圈列表.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param pageIndex
|
|
|
|
|
+ * @param pageSize
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
|
|
+ @Auth(value = AuthType.COOKIES)
|
|
|
|
|
+ @RequestMapping(value = "/member/moment/self", method = RequestMethod.GET)
|
|
|
|
|
+ public Object getUserFamilyMomentsList(@RequestParam Integer pageIndex, @RequestParam Integer pageSize){
|
|
|
|
|
+ return familyService.getUserFamilyMomentsList(AppContext.getUid(), pageIndex, pageSize);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 家族圈部分可见校验.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param memberInfo
|
|
|
|
|
+ * @param momentsRequest
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
private boolean checkVisibleLegitimacy(FamilyMemberInfo memberInfo, MomentsRequest momentsRequest){
|
|
private boolean checkVisibleLegitimacy(FamilyMemberInfo memberInfo, MomentsRequest momentsRequest){
|
|
|
- if(momentsRequest.getVisibleType() == 0){
|
|
|
|
|
|
|
+ if(Objects.equals(momentsRequest.getVisibleType(), MomentsVisibleTypeEnum.ALL_MEMBER.getType())){
|
|
|
return true;
|
|
return true;
|
|
|
}
|
|
}
|
|
|
// 可见范围:0:全员 1:支系堂派 2:聚落 3:家族内男性 4:出生地
|
|
// 可见范围:0:全员 1:支系堂派 2:聚落 3:家族内男性 4:出生地
|
|
|
- if(momentsRequest.getVisibleType() == 1
|
|
|
|
|
|
|
+ if(Objects.equals(momentsRequest.getVisibleType(), MomentsVisibleTypeEnum.SPECIAL_BRANCH_HALL.getType())
|
|
|
&& StringUtils.isBlank(memberInfo.getBranchFamilyHall())){
|
|
&& StringUtils.isBlank(memberInfo.getBranchFamilyHall())){
|
|
|
throw new AppRuntimeException("仅支持发布到自己设置的支系堂派!");
|
|
throw new AppRuntimeException("仅支持发布到自己设置的支系堂派!");
|
|
|
- } else if (momentsRequest.getVisibleType() == 2
|
|
|
|
|
|
|
+ } else if (Objects.equals(momentsRequest.getVisibleType(), MomentsVisibleTypeEnum.SPECIAL_CLUSTER_PLACE.getType())
|
|
|
&& StringUtils.isBlank(memberInfo.getClusterPlace())) {
|
|
&& StringUtils.isBlank(memberInfo.getClusterPlace())) {
|
|
|
throw new AppRuntimeException("仅支持发布到自己设置的聚落!");
|
|
throw new AppRuntimeException("仅支持发布到自己设置的聚落!");
|
|
|
- } else if (momentsRequest.getVisibleType() == 4
|
|
|
|
|
|
|
+ } else if (Objects.equals(momentsRequest.getVisibleType(), MomentsVisibleTypeEnum.SPECIAL_SEX.getType())
|
|
|
|
|
+ && (StringUtils.isBlank(momentsRequest.getVisibleValue())
|
|
|
|
|
+ || (!"1".equals(momentsRequest.getVisibleValue()) && !"2".equals(momentsRequest.getVisibleValue())))) {
|
|
|
|
|
+ throw new AppRuntimeException("性别可见设置错误!");
|
|
|
|
|
+ } else if (Objects.equals(momentsRequest.getVisibleType(), MomentsVisibleTypeEnum.SPECIAL_BIRTH_PLACE.getType())
|
|
|
&& StringUtils.isBlank(memberInfo.getBirthPlace())) {
|
|
&& StringUtils.isBlank(memberInfo.getBirthPlace())) {
|
|
|
throw new AppRuntimeException("仅支持发布到自己设置的出生第!");
|
|
throw new AppRuntimeException("仅支持发布到自己设置的出生第!");
|
|
|
}
|
|
}
|