Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Qi-Zhen-xin committed May 10, 2024
1 parent 21be9e3 commit 12e7301
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/main/java/com/qzx/xdupartner/entity/User.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,17 +83,17 @@ public class User implements Serializable {
/**
* 需求倾向
*/
private Integer highTag;
private Integer highTag = 0;

/**
* MBTI性格测试结果编号,16种具体在mbti表里
*/
private Integer mbti;
private Integer mbti = 0;

/**
* 星座编号,具体星座在星座表里找
*/
private Integer constellation;
private Integer constellation = 0;

/**
* 创建时间
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public enum ConstellationEnum {
private final String title;
private final String description;

public static ConstellationEnum match(int code) {
public static ConstellationEnum match(Integer code) {
for (ConstellationEnum constellation : ConstellationEnum.values()) {
if (constellation.id == code) return constellation;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public enum MbtiEnum {
private final int id;
private final String title;

public static MbtiEnum match(int code) {
public static MbtiEnum match(Integer code) {
for (MbtiEnum mbtiEnum : MbtiEnum.values()) {
if (mbtiEnum.id == code) return mbtiEnum;
}
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/com/qzx/xdupartner/util/UserUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ public static UserInfoVo convertToUserInfoVo(User user) {
.setConstellationDesc(ConstellationEnum.match(user.getConstellation()).getTitle())
.setMbti(user.getMbti())
.setMbtiDesc(MbtiEnum.match(user.getMbti()).getTitle())
.setPicture(StrUtil.split(user.getPicture(), SystemConstant.PICTURE_CONJUNCTION))
.setPicture(StrUtil.split(StrUtil.blankToDefault(user.getPicture(), ""),
SystemConstant.PICTURE_CONJUNCTION))
.setHighTag(user.getHighTag())
.setHighTagDesc(HighTag.match(user.getHighTag()).getDisplay())
.setVerified(StrUtil.isNotBlank(user.getStuId()));
Expand Down

0 comments on commit 12e7301

Please sign in to comment.