|
|
|
@ -1,9 +1,11 @@
|
|
|
|
|
package com.luoo.user.controller;
|
|
|
|
|
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.Arrays;
|
|
|
|
|
import java.util.Collections;
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
import java.util.HashSet;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Set;
|
|
|
|
|
import java.util.function.Function;
|
|
|
|
@ -36,7 +38,6 @@ import constants.Constants;
|
|
|
|
|
import controller.BaseController;
|
|
|
|
|
|
|
|
|
|
import com.luoo.user.dto.UserInfoUpdateDto;
|
|
|
|
|
import com.luoo.user.dto.response.UserBadge;
|
|
|
|
|
import com.luoo.user.dto.response.UserRespDTO;
|
|
|
|
|
import com.luoo.user.util.IpUtil;
|
|
|
|
|
|
|
|
|
@ -277,7 +278,15 @@ public class MyController extends BaseController {
|
|
|
|
|
UserRespDTO userRespDTO = new UserRespDTO();
|
|
|
|
|
BeanUtils.copyProperties(user, userRespDTO);
|
|
|
|
|
if(!StringTools.isEmpty(user.getBadges())) {
|
|
|
|
|
userRespDTO.setBadgeList(Arrays.stream(user.getBadges().split(",")).map(this::getUserBadge).collect(Collectors.toList()));
|
|
|
|
|
Set<Integer> badgeSet = new HashSet<>();
|
|
|
|
|
Arrays.stream(user.getBadges().split(",")).forEach(b->{
|
|
|
|
|
int code=Integer.valueOf(b.substring(0, 1));
|
|
|
|
|
badgeSet.add(code);
|
|
|
|
|
if(code==UserBadgeEnum.CONTRIBUTOR.getCode()) {
|
|
|
|
|
userRespDTO.setContributorRole(UserBadgeEnum.getByCode(Integer.valueOf(b)).getDesc());
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
userRespDTO.setBadgeList(new ArrayList<>(badgeSet));
|
|
|
|
|
}
|
|
|
|
|
if (null != userRespDTO.getAvatar()) {
|
|
|
|
|
userRespDTO.setAvatar(Constants.RESOURCE_PREFIX + userRespDTO.getAvatar());
|
|
|
|
@ -313,13 +322,6 @@ public class MyController extends BaseController {
|
|
|
|
|
return userRespDTO;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private UserBadge getUserBadge(String code) {
|
|
|
|
|
UserBadge userBadge=new UserBadge();
|
|
|
|
|
userBadge.setCode(Integer.valueOf(code));
|
|
|
|
|
userBadge.setDesc(UserBadgeEnum.getByCode(userBadge.getCode()).getDesc());
|
|
|
|
|
return userBadge;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 查询我的获赞
|
|
|
|
|
@ApiOperation(value = "9.查询我的获赞的分页列表", notes = "游客无法获取")
|
|
|
|
|
@GetMapping("/myThumbupList/{page}/{size}")
|
|
|
|
|