Browse Source

徽章列表

master
zxc 5 years ago
parent
commit
c5dadab50b
  1. 17
      epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/service/impl/BadgeServiceImpl.java
  2. 10
      epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java
  3. 5
      epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java

17
epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/badege/service/impl/BadgeServiceImpl.java

@ -1,5 +1,10 @@
package com.epmet.modules.badege.service.impl;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.form.UserBadgeListFormDTO;
import com.epmet.dto.result.UserBadgeListResultDTO;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.modules.badege.service.BadgeService;
import com.epmet.resi.mine.dto.from.BadgeListFormDTO;
@ -8,6 +13,7 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
/**
@ -23,6 +29,15 @@ public class BadgeServiceImpl implements BadgeService {
@Override
public List<BadgeListResultDTO> getBadgeList(BadgeListFormDTO badgeListFormDTO) {
return null;
UserBadgeListFormDTO form = ConvertUtils.sourceToTarget(badgeListFormDTO, UserBadgeListFormDTO.class);
Result<List<UserBadgeListResultDTO>> listResult = epmetUserOpenFeignClient.selectBadgeList(form);
if (!listResult.success()){
throw new RenException("获取徽章点亮列表失败......");
}
if (null == listResult.getData()){
return new ArrayList<>();
}
List<BadgeListResultDTO> result = ConvertUtils.sourceToTarget(listResult.getData(), BadgeListResultDTO.class);
return result;
}
}

10
epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java

@ -337,4 +337,14 @@ public interface EpmetUserOpenFeignClient {
*/
@PostMapping("/epmetuser/userresiinfo/edituserinfo")
Result editUserInfo(@RequestBody EditInfoFormDTO formDTO);
/**
* @Description 查询已经点亮的徽章
* @Param userBadgeListFormDTO
* @author zxc
* @date 2020/11/3 1:33 下午
*/
@PostMapping("/epmetuser/badge/badgelist")
Result<List<UserBadgeListResultDTO>> selectBadgeList(@RequestBody UserBadgeListFormDTO userBadgeListFormDTO);
}

5
epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java

@ -225,4 +225,9 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien
public Result editUserInfo(EditInfoFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "editUserInfo", formDTO);
}
@Override
public Result<List<UserBadgeListResultDTO>> selectBadgeList(UserBadgeListFormDTO userBadgeListFormDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "selectBadgeList", userBadgeListFormDTO);
}
}

Loading…
Cancel
Save