Commit 3d1c126f authored by shiyu's avatar shiyu

新增个人简介

parent aa1cec65
package com.wwdz.ch.core.consts;
public class FollowFansEnum {
public enum RelationEnum {
NO_FOLLOWED(0, "未关注"),
FOLLOWED(1, "已关注"),
BOTH_FOLLOWED(2, "互相关注"),
BACK_FOLLOWED(3, "回关"),
;
private int code;
private String des;
RelationEnum(int code, String des) {
this.code = code;
this.des = des;
}
public static String getNameByCode(int code) {
for (FollowFansEnum.RelationEnum relationEnum : FollowFansEnum.RelationEnum.values()) {
if (code == relationEnum.getCode()) {
return relationEnum.getDes();
}
}
return null;
}
public int getCode() {
return code;
}
public String getDes() {
return des;
}
}
}
......@@ -22,6 +22,11 @@ public class FollowFansRecordVo implements Entity {
*/
private String fansIcon;
/**
* 粉丝个人简介
*/
private String fansProfile;
/**
* 被关注者id
*/
......@@ -35,10 +40,20 @@ public class FollowFansRecordVo implements Entity {
private String followerIcon;
/**
* 关系(已关注,互相关注, 回关)
* 关注的人个人简介
*/
private String followerProfile;
/**
* 关系(已关注,互相关注,未关注)
*/
private String relation;
/**
* 关系(已关注,互相关注,未关注)
*/
private Integer relationCode;
/**
* 创建时间
*/
......
package com.wwdz.ch.wx.impl;
import com.wwdz.ch.core.consts.FollowFansEnum;
import com.wwdz.ch.core.consts.MessageEnum;
import com.wwdz.ch.core.consts.ResultCode;
import com.wwdz.ch.core.type.Result;
......@@ -157,10 +158,13 @@ public class FollowFansRecordServiceImpl implements FollowFansRecordService {
EntityMapper.copyAttribute(f, followFansRecordVo);
followFansRecordVo.setFollowerName(cacheUtil.getAppletUserNameById(f.getFollowerId()));
followFansRecordVo.setFollowerIcon(cacheUtil.getAppletUsers(f.getFollowerId()).getAvatar());
followFansRecordVo.setFansProfile(cacheUtil.getAppletUsers(f.getFollowerId()).getProfile());
if (fansIdList.contains(f.getFollowerId().longValue())) {
followFansRecordVo.setRelation("互相关注");
followFansRecordVo.setRelationCode(FollowFansEnum.RelationEnum.BOTH_FOLLOWED.getCode());
} else {
followFansRecordVo.setRelation("已关注");
followFansRecordVo.setRelationCode(FollowFansEnum.RelationEnum.FOLLOWED.getCode());
}
followFansRecordVos.add(followFansRecordVo);
});
......@@ -193,10 +197,13 @@ public class FollowFansRecordServiceImpl implements FollowFansRecordService {
EntityMapper.copyAttribute(f, followFansRecordVo);
followFansRecordVo.setFansName(cacheUtil.getAppletUserNameById(f.getFansId()));
followFansRecordVo.setFansIcon(cacheUtil.getAppletUsers(f.getFansId()).getAvatar());
followFansRecordVo.setFansProfile(cacheUtil.getAppletUsers(f.getFansId()).getProfile());
if (followerIdList.contains(f.getFansId().longValue())) {
followFansRecordVo.setRelation("互相关注");
followFansRecordVo.setRelationCode(FollowFansEnum.RelationEnum.BOTH_FOLLOWED.getCode());
} else {
followFansRecordVo.setRelation("回关");
followFansRecordVo.setRelationCode(FollowFansEnum.RelationEnum.BACK_FOLLOWED.getCode());
}
followFansRecordVos.add(followFansRecordVo);
});
......@@ -227,12 +234,16 @@ public class FollowFansRecordServiceImpl implements FollowFansRecordService {
long followerId = followFansRecordVo.getFollowerId();
if (currentFollowIdList.contains(followerId) && currentFansIdList.contains(followerId)) {
followFansRecordVo.setRelation("互相关注");
followFansRecordVo.setRelationCode(FollowFansEnum.RelationEnum.BOTH_FOLLOWED.getCode());
} else if (currentFollowIdList.contains(followerId) && !currentFansIdList.contains(followerId)) {
followFansRecordVo.setRelation("已关注");
followFansRecordVo.setRelationCode(FollowFansEnum.RelationEnum.FOLLOWED.getCode());
} else if (!currentFollowIdList.contains(followerId) && currentFansIdList.contains(followerId)) {
followFansRecordVo.setRelation("回关");
followFansRecordVo.setRelationCode(FollowFansEnum.RelationEnum.BACK_FOLLOWED.getCode());
} else {
followFansRecordVo.setRelation("");
followFansRecordVo.setRelation("未关注");
followFansRecordVo.setRelationCode(FollowFansEnum.RelationEnum.NO_FOLLOWED.getCode());
}
});
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment